[Lldb-commits] [PATCH] D12942: Fix caching for clang::Decl in DWARFASTParserClang

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 17 11:29:14 PDT 2015


tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

Looks good with minor comment inline


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3228-3230
@@ -3227,3 +3227,5 @@
 
-    if (die.GetReferencedDIE(DW_AT_specification))
-        return GetClangDeclForDIE(die.GetReferencedDIE(DW_AT_specification));
+    const std::set<dw_tag_t> tags_with_decls { DW_TAG_variable, DW_TAG_constant, DW_TAG_formal_parameter, DW_TAG_imported_module, DW_TAG_imported_declaration };
+    if (tags_with_decls.find(die.Tag()) == tags_with_decls.end())
+        return nullptr;
+
----------------
I think using a switch would be both simpler and faster


http://reviews.llvm.org/D12942





More information about the lldb-commits mailing list