[Lldb-commits] [PATCH] D18381: Decouple ClangASTContext from DWARF

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 23 14:49:57 PDT 2016


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

A few things in inlined comments, but this is very close.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParser.h:36
@@ -35,3 +35,3 @@
     virtual bool
-    CanCompleteType (const lldb_private::CompilerType &compiler_type)
+    CanCompleteType(const lldb_private::CompilerType &compiler_type)
     {
----------------
Can probably do this later when there are changes to this file other than clang format only changes.

================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParser.h:42
@@ -41,3 +41,3 @@
     virtual bool
-    CompleteType (const lldb_private::CompilerType &compiler_type)
+    CompleteType(const lldb_private::CompilerType &compiler_type)
     {
----------------
Can probably do this later when there are changes to this file other than clang format only changes.

================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1614-1622
@@ -1611,9 +1613,11 @@
     TypeSystem *type_system = compiler_type.GetTypeSystem();
-    if (type_system)
-    {
-        DWARFASTParser *dwarf_ast = type_system->GetDWARFParser();
-        if (dwarf_ast)
-            return dwarf_ast->CanCompleteType(compiler_type);
-    }
-    return false;
+    ClangASTContext *clang_type_system = llvm::dyn_cast_or_null<ClangASTContext>(type_system);
+    if (!clang_type_system)
+        return false;
+
+    DWARFASTParser *ast_parser = clang_type_system->GetDWARFParser();
+    if (!ast_parser)
+        return false;
+
+    return ast_parser->CanCompleteType(compiler_type);
 }
----------------
This can be reverted since GetDWARFParser is stying in TypeSystem


http://reviews.llvm.org/D18381





More information about the lldb-commits mailing list