aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 0f34c48c7e82..b43423707ae1 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -479,10 +479,7 @@ void ClangASTSource::FindExternalLexicalDecls(
decl->getDeclKindName(), ast_dump);
}
- Decl *copied_decl = CopyDecl(decl);
-
- if (!copied_decl)
- continue;
+ CopyDecl(decl);
// FIXME: We should add the copied decl to the 'decls' list. This would
// add the copied Decl into the DeclContext and make sure that we
@@ -492,12 +489,6 @@ void ClangASTSource::FindExternalLexicalDecls(
// lookup issues later on.
// We can't just add them for now as the ASTImporter already added the
// decl into the DeclContext and this would add it twice.
-
- if (FieldDecl *copied_field = dyn_cast<FieldDecl>(copied_decl)) {
- QualType copied_field_type = copied_field->getType();
-
- m_ast_importer_sp->RequireCompleteType(copied_field_type);
- }
} else {
SkippedDecls = true;
}
@@ -850,8 +841,8 @@ void ClangASTSource::FindDeclInModules(NameSearchContext &context,
ConstString name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- ClangModulesDeclVendor *modules_decl_vendor =
- m_target->GetClangModulesDeclVendor();
+ std::shared_ptr<ClangModulesDeclVendor> modules_decl_vendor =
+ GetClangModulesDeclVendor();
if (!modules_decl_vendor)
return;
@@ -1143,8 +1134,8 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
// Check the modules only if the debug information didn't have a complete
// interface.
- if (ClangModulesDeclVendor *modules_decl_vendor =
- m_target->GetClangModulesDeclVendor()) {
+ if (std::shared_ptr<ClangModulesDeclVendor> modules_decl_vendor =
+ GetClangModulesDeclVendor()) {
ConstString interface_name(interface_decl->getNameAsString().c_str());
bool append = false;
uint32_t max_matches = 1;
@@ -1313,8 +1304,8 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
// Check the modules only if the debug information didn't have a complete
// interface.
- ClangModulesDeclVendor *modules_decl_vendor =
- m_target->GetClangModulesDeclVendor();
+ std::shared_ptr<ClangModulesDeclVendor> modules_decl_vendor =
+ GetClangModulesDeclVendor();
if (!modules_decl_vendor)
break;
@@ -1570,10 +1561,10 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
if (log) {
LLDB_LOG(log, "LRT returned:");
- LLDB_LOG(log, "LRT Original = (RecordDecl*)%p",
+ LLDB_LOG(log, "LRT Original = (RecordDecl*){0}",
static_cast<const void *>(origin_record.decl));
- LLDB_LOG(log, "LRT Size = %" PRId64, size);
- LLDB_LOG(log, "LRT Alignment = %" PRId64, alignment);
+ LLDB_LOG(log, "LRT Size = {0}", size);
+ LLDB_LOG(log, "LRT Alignment = {0}", alignment);
LLDB_LOG(log, "LRT Fields:");
for (RecordDecl::field_iterator fi = record->field_begin(),
fe = record->field_end();
@@ -1750,3 +1741,10 @@ CompilerType ClangASTSource::GuardedCopyType(const CompilerType &src_type) {
return m_clang_ast_context->GetType(copied_qual_type);
}
+
+std::shared_ptr<ClangModulesDeclVendor>
+ClangASTSource::GetClangModulesDeclVendor() {
+ auto persistent_vars = llvm::cast<ClangPersistentVariables>(
+ m_target->GetPersistentExpressionStateForLanguage(lldb::eLanguageTypeC));
+ return persistent_vars->GetClangModulesDeclVendor();
+}