Skip to content

[Swift] Replace calls to FuncDecl::getName & EnumElementDecl::getName with ValueDecl::getBaseIdentifier #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ void SwiftASTManipulatorBase::DoInitialization() {
break;
}
}
} else if (FD->hasName() &&
FD->getName().str().startswith(m_wrapper_func_prefix)) {
} else if (FD->hasName() && FD->getBaseIdentifier().str()
.startswith(m_wrapper_func_prefix)) {
m_wrapper_decl = FD;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class LLDBExprNameLookup : public LLDBNameLookup {
// must be moved to the source-file level to be legal. But we
// don't want to register them with lldb unless they are of the
// kind lldb explicitly wants to globalize.
if (shouldGlobalize(value_decl->getBaseName().getIdentifier(),
if (shouldGlobalize(value_decl->getBaseIdentifier(),
value_decl->getKind()))
m_staged_decls.AddDecl(value_decl, false, ConstString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void SwiftPersistentExpressionState::SwiftDeclMap::AddDecl(
std::string name_str;

if (alias.IsEmpty()) {
name_str = (value_decl->getBaseName().getIdentifier().str());
name_str = (value_decl->getBaseIdentifier().str());
} else {
name_str.assign(alias.GetCString());
}
Expand Down
8 changes: 4 additions & 4 deletions lldb/source/Symbol/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ class SwiftCStyleEnumDescriptor : public SwiftEnumDescriptor {
Dump(m_nopayload_elems_bitmask).c_str());

for (auto enum_case : elements_with_no_payload) {
ConstString case_name(enum_case.decl->getName().str());
ConstString case_name(enum_case.decl->getBaseIdentifier().str());
swift::ClusteredBitVector case_value =
enum_impl_strategy.getBitPatternForNoPayloadElement(enum_case.decl);

Expand Down Expand Up @@ -1081,7 +1081,7 @@ class SwiftAllPayloadEnumDescriptor : public SwiftEnumDescriptor {
auto module_ctx = enum_decl->getModuleContext();
const bool has_payload = true;
for (auto enum_case : elements_with_payload) {
ConstString case_name(enum_case.decl->getName().str());
ConstString case_name(enum_case.decl->getBaseIdentifier().str());

swift::EnumElementDecl *case_decl = enum_case.decl;
assert(case_decl);
Expand Down Expand Up @@ -6542,10 +6542,10 @@ TypeMemberFunctionImpl SwiftASTContext::GetMemberFunctionAtIndex(void *type,
swift::FuncDecl *func_decl =
llvm::dyn_cast<swift::FuncDecl>(*iter);
if (func_decl) {
if (func_decl->getName().empty())
if (func_decl->getBaseIdentifier().empty())
name.clear();
else
name.assign(func_decl->getName().get());
name.assign(func_decl->getBaseIdentifier().get());
if (func_decl->isStatic())
kind = lldb::eMemberFunctionKindStaticMethod;
else
Expand Down