summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-04-01 22:57:22 +0000
committerGreg Clayton <gclayton@apple.com>2016-04-01 22:57:22 +0000
commit58a15d5a235c57aafdc881250c25d8ce37a0f47e (patch)
tree0b077b7f3c06b2b9abad882ef6ccc777f9fc4d5c /lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
parent69c82bfae79426781e5a04b7ac450754dc33dc5d (diff)
downloadbcm5719-llvm-58a15d5a235c57aafdc881250c25d8ce37a0f47e.tar.gz
bcm5719-llvm-58a15d5a235c57aafdc881250c25d8ce37a0f47e.zip
Fixed an issue where if we have DWARF in an executable that has multiple languages where these languages use different type systems, you can end up trying to find the actualy definition for a forward declaration for a type, you will call:
TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &dwarf_decl_ctx); The problem was we might be looking for a type "Foo", and find one from another langauge. Then the DWARFASTParserClang would try to make an AST type using a CompilerType that might return an empty. This fix makes sure that when we create a DWARFDeclContext from a DWARFDIE that the DWARFDeclContext we set the language of the DIE. Then when we go to find matches for DWARFDeclContext, we end up with bunch of DIEs. We check each DWARFDIE that we found by asking it for its language and making sure the language is compatible with the type system that we want to use. This keeps us from using the wrong types to resolve forward declarations. <rdar://problem/25276165> llvm-svn: 265196
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
index 4c29447b47b..2452274a293 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
@@ -64,7 +64,8 @@ public:
};
DWARFDeclContext () :
- m_entries()
+ m_entries(),
+ m_language(lldb::eLanguageTypeUnknown)
{
}
@@ -115,10 +116,23 @@ public:
m_qualified_name.clear();
}
+ lldb::LanguageType
+ GetLanguage() const
+ {
+ return m_language;
+ }
+
+ void
+ SetLanguage(lldb::LanguageType language)
+ {
+ m_language = language;
+ }
+
protected:
typedef std::vector<Entry> collection;
collection m_entries;
mutable std::string m_qualified_name;
+ lldb::LanguageType m_language;
};
#endif // SymbolFileDWARF_DWARFDeclContext_h_
OpenPOWER on IntegriCloud