<div dir="ltr">Hi Greg, will you have some time to look at this today? It's definitely this patch that started causing the failure, so I suspect there is something wrong on all platforms</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 18, 2015 at 12:41 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Greg,<div><br></div><div>This has broken TestCppValueCast on Windows. Ironically, it has also *fixed* TestCxxWcharT on Windows. In any case, here is the important line from the log file of TestCppValueCast.</div><div><br></div><div><div>Traceback (most recent call last):</div><div> File "D:\src\llvm\tools\lldb\test\lldbtest.py", line 483, in wrapper</div><div> return func(self, *args, **kwargs)</div><div> File "D:\src\llvm\tools\lldb\test\lldbtest.py", line 551, in wrapper</div><div> return func(self, *args, **kwargs)</div><div> File "D:\src\llvm\tools\lldb\test\lang\cpp\dynamic-value\TestCppValueCast.py", line 49, in test_value_cast_with_dwarf_and_regular_inheritance</div><div> self.do_sbvalue_cast(self.exe_name)</div><div> File "D:\src\llvm\tools\lldb\test\lang\cpp\dynamic-value\TestCppValueCast.py", line 99, in do_sbvalue_cast</div><div> self.assertTrue(tellerA.GetChildMemberWithName('m_base_val').GetValueAsUnsigned(error, 0) == 20)</div><div>AssertionError: False is not True</div></div><div><br></div><div>Is it possible your patch has an error?</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 17, 2015 at 3:25 PM Greg Clayton via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gclayton<br>
Date: Thu Sep 17 17:23:34 2015<br>
New Revision: 247953<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=247953&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=247953&view=rev</a><br>
Log:<br>
TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.<br>
<br>
This cleans up type systems to be more pluggable. Prior to this we had issues:<br>
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"<br>
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem<br>
- Cleaned up Module so that it no longer has dedicated type system member variables:<br>
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.<br>
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.<br>
<br>
Now we have a type system map:<br>
<br>
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;<br>
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module<br>
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:<br>
<br>
class CompilerType<br>
{<br>
...<br>
<br>
//----------------------------------------------------------------------<br>
// Return a new CompilerType that is a L value reference to this type if<br>
// this type is valid and the type system supports L value references,<br>
// else return an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
GetLValueReferenceType () const;<br>
<br>
//----------------------------------------------------------------------<br>
// Return a new CompilerType that is a R value reference to this type if<br>
// this type is valid and the type system supports R value references,<br>
// else return an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
GetRValueReferenceType () const;<br>
<br>
//----------------------------------------------------------------------<br>
// Return a new CompilerType adds a const modifier to this type if<br>
// this type is valid and the type system supports const modifiers,<br>
// else return an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
AddConstModifier () const;<br>
<br>
//----------------------------------------------------------------------<br>
// Return a new CompilerType adds a volatile modifier to this type if<br>
// this type is valid and the type system supports volatile modifiers,<br>
// else return an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
AddVolatileModifier () const;<br>
<br>
//----------------------------------------------------------------------<br>
// Return a new CompilerType adds a restrict modifier to this type if<br>
// this type is valid and the type system supports restrict modifiers,<br>
// else return an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
AddRestrictModifier () const;<br>
<br>
//----------------------------------------------------------------------<br>
// Create a typedef to this type using "name" as the name of the typedef<br>
// this type is valid and the type system supports typedefs, else return<br>
// an invalid type.<br>
//----------------------------------------------------------------------<br>
CompilerType<br>
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;<br>
<br>
};<br>
<br>
Other changes include:<br>
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"<br>
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed<br>
<br>
<br>
<br>
Modified:<br>
lldb/trunk/include/lldb/Core/Module.h<br>
lldb/trunk/include/lldb/Core/PluginManager.h<br>
lldb/trunk/include/lldb/Symbol/ClangASTContext.h<br>
lldb/trunk/include/lldb/Symbol/CompilerType.h<br>
lldb/trunk/include/lldb/Symbol/GoASTContext.h<br>
lldb/trunk/include/lldb/Symbol/SymbolFile.h<br>
lldb/trunk/include/lldb/Symbol/Type.h<br>
lldb/trunk/include/lldb/Symbol/TypeSystem.h<br>
lldb/trunk/include/lldb/lldb-forward.h<br>
lldb/trunk/include/lldb/lldb-private-interfaces.h<br>
lldb/trunk/source/API/SBModule.cpp<br>
lldb/trunk/source/API/SBType.cpp<br>
lldb/trunk/source/API/SystemInitializerFull.cpp<br>
lldb/trunk/source/Commands/CommandObjectArgs.cpp<br>
lldb/trunk/source/Core/Module.cpp<br>
lldb/trunk/source/Core/PluginManager.cpp<br>
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp<br>
lldb/trunk/source/Core/ValueObjectRegister.cpp<br>
lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
lldb/trunk/source/DataFormatters/VectorType.cpp<br>
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp<br>
lldb/trunk/source/Expression/ClangExpressionParser.cpp<br>
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp<br>
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp<br>
lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp<br>
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp<br>
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br>
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h<br>
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp<br>
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp<br>
lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h<br>
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp<br>
lldb/trunk/source/Symbol/ClangASTContext.cpp<br>
lldb/trunk/source/Symbol/CompilerType.cpp<br>
lldb/trunk/source/Symbol/GoASTContext.cpp<br>
lldb/trunk/source/Symbol/SymbolFile.cpp<br>
lldb/trunk/source/Symbol/Type.cpp<br>
lldb/trunk/source/Symbol/TypeSystem.cpp<br>
lldb/trunk/source/Symbol/Variable.cpp<br>
lldb/trunk/source/Target/ThreadPlanTracer.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/Core/Module.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/Module.h (original)<br>
+++ lldb/trunk/include/lldb/Core/Module.h Thu Sep 17 17:23:34 2015<br>
@@ -944,9 +944,6 @@ public:<br>
bool<br>
GetIsDynamicLinkEditor ();<br>
<br>
- ClangASTContext &<br>
- GetClangASTContext ();<br>
-<br>
TypeSystem *<br>
GetTypeSystemForLanguage (lldb::LanguageType language);<br>
<br>
@@ -1101,6 +1098,7 @@ public:<br>
bool &match_name_after_lookup);<br>
<br>
protected:<br>
+ typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;<br>
//------------------------------------------------------------------<br>
// Member Variables<br>
//------------------------------------------------------------------<br>
@@ -1119,15 +1117,13 @@ protected:<br>
lldb::SymbolVendorUP m_symfile_ap; ///< A pointer to the symbol vendor for this module.<br>
std::vector<lldb::SymbolVendorUP> m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file,<br>
///< we need to keep all old symbol files around in case anyone has type references to them<br>
- lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.<br>
- lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.<br>
+ TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module<br>
PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are<br>
lldb::SectionListUP m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info<br>
<br>
std::atomic<bool> m_did_load_objfile;<br>
std::atomic<bool> m_did_load_symbol_vendor;<br>
std::atomic<bool> m_did_parse_uuid;<br>
- std::atomic<bool> m_did_init_ast;<br>
mutable bool m_file_has_changed:1,<br>
m_first_file_changed_log:1; /// See if the module was modified after it was initially opened.<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Core/PluginManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Core/PluginManager.h (original)<br>
+++ lldb/trunk/include/lldb/Core/PluginManager.h Thu Sep 17 17:23:34 2015<br>
@@ -419,6 +419,22 @@ public:<br>
static InstrumentationRuntimeCreateInstance<br>
GetInstrumentationRuntimeCreateCallbackForPluginName (const ConstString &name);<br>
<br>
+ //------------------------------------------------------------------<br>
+ // TypeSystem<br>
+ //------------------------------------------------------------------<br>
+ static bool<br>
+ RegisterPlugin (const ConstString &name,<br>
+ const char *description,<br>
+ TypeSystemCreateInstance create_callback);<br>
+<br>
+ static bool<br>
+ UnregisterPlugin (TypeSystemCreateInstance create_callback);<br>
+<br>
+ static TypeSystemCreateInstance<br>
+ GetTypeSystemCreateCallbackAtIndex (uint32_t idx);<br>
+<br>
+ static TypeSystemCreateInstance<br>
+ GetTypeSystemCreateCallbackForPluginName (const ConstString &name);<br>
<br>
//------------------------------------------------------------------<br>
// Some plug-ins might register a DebuggerInitializeCallback<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Sep 17 17:23:34 2015<br>
@@ -55,7 +55,28 @@ public:<br>
ClangASTContext (const char *triple = NULL);<br>
<br>
~ClangASTContext() override;<br>
-<br>
+<br>
+ //------------------------------------------------------------------<br>
+ // PluginInterface functions<br>
+ //------------------------------------------------------------------<br>
+ ConstString<br>
+ GetPluginName() override;<br>
+<br>
+ uint32_t<br>
+ GetPluginVersion() override;<br>
+<br>
+ static ConstString<br>
+ GetPluginNameStatic ();<br>
+<br>
+ static lldb::TypeSystemSP<br>
+ CreateInstance (lldb::LanguageType language, const lldb_private::ArchSpec &arch);<br>
+<br>
+ static void<br>
+ Initialize ();<br>
+<br>
+ static void<br>
+ Terminate ();<br>
+<br>
static ClangASTContext*<br>
GetASTContext (clang::ASTContext* ast_ctx);<br>
<br>
@@ -153,7 +174,7 @@ public:<br>
//------------------------------------------------------------------<br>
CompilerType<br>
GetBuiltinTypeForEncodingAndBitSize (lldb::Encoding encoding,<br>
- uint32_t bit_size);<br>
+ size_t bit_size) override;<br>
<br>
static CompilerType<br>
GetBuiltinTypeForEncodingAndBitSize (clang::ASTContext *ast,<br>
@@ -448,13 +469,7 @@ public:<br>
//------------------------------------------------------------------<br>
// Integer type functions<br>
//------------------------------------------------------------------<br>
-<br>
- CompilerType<br>
- GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override<br>
- {<br>
- return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);<br>
- }<br>
-<br>
+<br>
static CompilerType<br>
GetIntTypeFromBitSize (clang::ASTContext *ast,<br>
size_t bit_size, bool is_signed);<br>
@@ -471,12 +486,6 @@ public:<br>
//------------------------------------------------------------------<br>
// Floating point functions<br>
//------------------------------------------------------------------<br>
-<br>
- CompilerType<br>
- GetFloatTypeFromBitSize (size_t bit_size) override<br>
- {<br>
- return GetFloatTypeFromBitSize (getASTContext(), bit_size);<br>
- }<br>
<br>
static CompilerType<br>
GetFloatTypeFromBitSize (clang::ASTContext *ast,<br>
@@ -673,7 +682,10 @@ public:<br>
<br>
bool<br>
IsVoidType (void *type) override;<br>
-<br>
+<br>
+ bool<br>
+ SupportsLanguage (lldb::LanguageType language) override;<br>
+<br>
static bool<br>
GetCXXClassName (const CompilerType& type, std::string &class_name);<br>
<br>
@@ -710,15 +722,6 @@ public:<br>
// Creating related types<br>
//----------------------------------------------------------------------<br>
<br>
- static CompilerType<br>
- AddConstModifier (const CompilerType& type);<br>
-<br>
- static CompilerType<br>
- AddRestrictModifier (const CompilerType& type);<br>
-<br>
- static CompilerType<br>
- AddVolatileModifier (const CompilerType& type);<br>
-<br>
// Using the current type, create a new typedef to that type using "typedef_name"<br>
// as the name and "decl_ctx" as the decl context.<br>
static CompilerType<br>
@@ -752,9 +755,6 @@ public:<br>
TypeMemberFunctionImpl<br>
GetMemberFunctionAtIndex (void *type, size_t idx) override;<br>
<br>
- static CompilerType<br>
- GetLValueReferenceType (const CompilerType& type);<br>
-<br>
CompilerType<br>
GetNonReferenceType (void *type) override;<br>
<br>
@@ -763,10 +763,25 @@ public:<br>
<br>
CompilerType<br>
GetPointerType (void *type) override;<br>
-<br>
- static CompilerType<br>
- GetRValueReferenceType (const CompilerType& type);<br>
-<br>
+<br>
+ CompilerType<br>
+ GetLValueReferenceType (void *type) override;<br>
+<br>
+ CompilerType<br>
+ GetRValueReferenceType (void *type) override;<br>
+<br>
+ CompilerType<br>
+ AddConstModifier (void *type) override;<br>
+<br>
+ CompilerType<br>
+ AddVolatileModifier (void *type) override;<br>
+<br>
+ CompilerType<br>
+ AddRestrictModifier (void *type) override;<br>
+<br>
+ CompilerType<br>
+ CreateTypedef (void *type, const char *name, const CompilerDeclContext &decl_ctx) override;<br>
+<br>
// If the current object represents a typedef type, get the underlying type<br>
CompilerType<br>
GetTypedefedType (void *type) override;<br>
@@ -804,7 +819,10 @@ public:<br>
<br>
uint32_t<br>
GetNumChildren (void *type, bool omit_empty_base_classes) override;<br>
-<br>
+<br>
+ CompilerType<br>
+ GetBuiltinTypeByName (const ConstString &name) override;<br>
+<br>
lldb::BasicType<br>
GetBasicTypeEnumeration (void *type) override;<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/CompilerType.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/CompilerType.h Thu Sep 17 17:23:34 2015<br>
@@ -272,15 +272,75 @@ public:<br>
TypeMemberFunctionImpl<br>
GetMemberFunctionAtIndex (size_t idx);<br>
<br>
+ //----------------------------------------------------------------------<br>
+ // If this type is a reference to a type (L value or R value reference),<br>
+ // return a new type with the reference removed, else return the current<br>
+ // type itself.<br>
+ //----------------------------------------------------------------------<br>
CompilerType<br>
GetNonReferenceType () const;<br>
<br>
+ //----------------------------------------------------------------------<br>
+ // If this type is a pointer type, return the type that the pointer<br>
+ // points to, else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
CompilerType<br>
GetPointeeType () const;<br>
<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType that is a pointer to this type<br>
+ //----------------------------------------------------------------------<br>
CompilerType<br>
GetPointerType () const;<br>
<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType that is a L value reference to this type if<br>
+ // this type is valid and the type system supports L value references,<br>
+ // else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ GetLValueReferenceType () const;<br>
+<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType that is a R value reference to this type if<br>
+ // this type is valid and the type system supports R value references,<br>
+ // else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ GetRValueReferenceType () const;<br>
+<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType adds a const modifier to this type if<br>
+ // this type is valid and the type system supports const modifiers,<br>
+ // else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ AddConstModifier () const;<br>
+<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType adds a volatile modifier to this type if<br>
+ // this type is valid and the type system supports volatile modifiers,<br>
+ // else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ AddVolatileModifier () const;<br>
+<br>
+ //----------------------------------------------------------------------<br>
+ // Return a new CompilerType adds a restrict modifier to this type if<br>
+ // this type is valid and the type system supports restrict modifiers,<br>
+ // else return an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ AddRestrictModifier () const;<br>
+<br>
+ //----------------------------------------------------------------------<br>
+ // Create a typedef to this type using "name" as the name of the typedef<br>
+ // this type is valid and the type system supports typedefs, else return<br>
+ // an invalid type.<br>
+ //----------------------------------------------------------------------<br>
+ CompilerType<br>
+ CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;<br>
+<br>
// If the current object represents a typedef type, get the underlying type<br>
CompilerType<br>
GetTypedefedType () const;<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/GoASTContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/GoASTContext.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/GoASTContext.h Thu Sep 17 17:23:34 2015<br>
@@ -27,6 +27,28 @@ class GoASTContext : public TypeSystem<br>
GoASTContext();<br>
~GoASTContext();<br>
<br>
+ //------------------------------------------------------------------<br>
+ // PluginInterface functions<br>
+ //------------------------------------------------------------------<br>
+ ConstString<br>
+ GetPluginName() override;<br>
+<br>
+ uint32_t<br>
+ GetPluginVersion() override;<br>
+<br>
+ static ConstString<br>
+ GetPluginNameStatic ();<br>
+<br>
+ static lldb::TypeSystemSP<br>
+ CreateInstance (lldb::LanguageType language, const lldb_private::ArchSpec &arch);<br>
+<br>
+ static void<br>
+ Initialize ();<br>
+<br>
+ static void<br>
+ Terminate ();<br>
+<br>
+<br>
DWARFASTParser *GetDWARFParser() override;<br>
<br>
void<br>
@@ -101,7 +123,7 @@ class GoASTContext : public TypeSystem<br>
CompilerType CreateBaseType(int go_kind, const ConstString &type_name_const_str, uint64_t byte_size);<br>
<br>
// For interface, map, chan.<br>
- CompilerType CreateTypedef(int kind, const ConstString &name, CompilerType impl);<br>
+ CompilerType CreateTypedefType(int kind, const ConstString &name, CompilerType impl);<br>
<br>
CompilerType CreateVoidType(const ConstString &name);<br>
CompilerType CreateFunctionType(const lldb_private::ConstString &name, CompilerType *params, size_t params_count,<br>
@@ -124,37 +146,39 @@ class GoASTContext : public TypeSystem<br>
static bool IsDirectIface(uint8_t kind);<br>
static bool IsPointerKind(uint8_t kind);<br>
<br>
- virtual bool IsArrayType(void *type, CompilerType *element_type, uint64_t *size, bool *is_incomplete) override;<br>
+ bool IsArrayType(void *type, CompilerType *element_type, uint64_t *size, bool *is_incomplete) override;<br>
<br>
- virtual bool IsAggregateType(void *type) override;<br>
+ bool IsAggregateType(void *type) override;<br>
<br>
- virtual bool IsCharType(void *type) override;<br>
+ bool IsCharType(void *type) override;<br>
<br>
- virtual bool IsCompleteType(void *type) override;<br>
+ bool IsCompleteType(void *type) override;<br>
<br>
- virtual bool IsDefined(void *type) override;<br>
+ bool IsDefined(void *type) override;<br>
<br>
- virtual bool IsFloatingPointType(void *type, uint32_t &count, bool &is_complex) override;<br>
+ bool IsFloatingPointType(void *type, uint32_t &count, bool &is_complex) override;<br>
<br>
- virtual bool IsFunctionType(void *type, bool *is_variadic_ptr = NULL) override;<br>
+ bool IsFunctionType(void *type, bool *is_variadic_ptr = NULL) override;<br>
<br>
- virtual size_t GetNumberOfFunctionArguments(void *type) override;<br>
+ size_t GetNumberOfFunctionArguments(void *type) override;<br>
<br>
- virtual CompilerType GetFunctionArgumentAtIndex(void *type, const size_t index) override;<br>
+ CompilerType GetFunctionArgumentAtIndex(void *type, const size_t index) override;<br>
<br>
- virtual bool IsFunctionPointerType(void *type) override;<br>
+ bool IsFunctionPointerType(void *type) override;<br>
<br>
- virtual bool IsIntegerType(void *type, bool &is_signed) override;<br>
+ bool IsIntegerType(void *type, bool &is_signed) override;<br>
<br>
- virtual bool IsPossibleDynamicType(void *type,<br>
+ bool IsPossibleDynamicType(void *type,<br>
CompilerType *target_type, // Can pass NULL<br>
bool check_cplusplus, bool check_objc) override;<br>
<br>
- virtual bool IsPointerType(void *type, CompilerType *pointee_type = NULL) override;<br>
+ bool IsPointerType(void *type, CompilerType *pointee_type = NULL) override;<br>
+<br>
+ bool IsScalarType(void *type) override;<br>
<br>
- virtual bool IsScalarType(void *type) override;<br>
+ bool IsVoidType(void *type) override;<br>
<br>
- virtual bool IsVoidType(void *type) override;<br>
+ bool SupportsLanguage (lldb::LanguageType language) override;<br>
<br>
//----------------------------------------------------------------------<br>
// Type Completion<br>
@@ -217,9 +241,9 @@ class GoASTContext : public TypeSystem<br>
virtual uint32_t GetNumChildren(void *type, bool omit_empty_base_classes) override;<br>
<br>
virtual lldb::BasicType GetBasicTypeEnumeration(void *type) override;<br>
- virtual CompilerType GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override;<br>
- virtual CompilerType GetFloatTypeFromBitSize (size_t bit_size) override;<br>
<br>
+ virtual CompilerType GetBuiltinTypeForEncodingAndBitSize (lldb::Encoding encoding,<br>
+ size_t bit_size) override;<br>
<br>
virtual uint32_t GetNumFields(void *type) override;<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Thu Sep 17 17:23:34 2015<br>
@@ -147,8 +147,6 @@ public:<br>
virtual size_t GetTypes (lldb_private::SymbolContextScope *sc_scope,<br>
uint32_t type_mask,<br>
lldb_private::TypeList &type_list) = 0;<br>
- virtual ClangASTContext &<br>
- GetClangASTContext ();<br>
<br>
virtual lldb_private::TypeSystem *<br>
GetTypeSystemForLanguage (lldb::LanguageType language);<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/Type.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/Type.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/Type.h Thu Sep 17 17:23:34 2015<br>
@@ -14,7 +14,6 @@<br>
#include "lldb/Core/ClangForward.h"<br>
#include "lldb/Core/ConstString.h"<br>
#include "lldb/Core/UserID.h"<br>
-#include "lldb/Symbol/ClangASTContext.h"<br>
#include "lldb/Symbol/CompilerType.h"<br>
#include "lldb/Symbol/Declaration.h"<br>
<br>
@@ -254,9 +253,6 @@ public:<br>
CompilerType<br>
GetForwardCompilerType ();<br>
<br>
- ClangASTContext &<br>
- GetClangASTContext ();<br>
-<br>
static int<br>
Compare(const Type &a, const Type &b);<br>
<br>
@@ -422,7 +418,7 @@ public:<br>
GetPointerType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetLayoutCompilerType ().GetPointerType();<br>
+ return type_sp->GetForwardCompilerType().GetPointerType();<br>
return clang_type.GetPointerType();<br>
}<br>
<br>
@@ -430,7 +426,7 @@ public:<br>
GetPointeeType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetFullCompilerType ().GetPointeeType();<br>
+ return type_sp->GetForwardCompilerType ().GetPointeeType();<br>
return clang_type.GetPointeeType();<br>
}<br>
<br>
@@ -438,39 +434,43 @@ public:<br>
GetReferenceType () const<br>
{<br>
if (type_sp)<br>
- return ClangASTContext::GetLValueReferenceType(type_sp->GetLayoutCompilerType ());<br>
- return ClangASTContext::GetLValueReferenceType(clang_type);<br>
+ return type_sp->GetForwardCompilerType ().GetLValueReferenceType();<br>
+ else<br>
+ return clang_type.GetLValueReferenceType();<br>
}<br>
<br>
CompilerType<br>
GetTypedefedType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetFullCompilerType ().GetTypedefedType();<br>
- return clang_type.GetTypedefedType();<br>
+ return type_sp->GetForwardCompilerType ().GetTypedefedType();<br>
+ else<br>
+ return clang_type.GetTypedefedType();<br>
}<br>
<br>
CompilerType<br>
GetDereferencedType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetFullCompilerType ().GetNonReferenceType();<br>
- return clang_type.GetNonReferenceType();<br>
+ return type_sp->GetForwardCompilerType ().GetNonReferenceType();<br>
+ else<br>
+ return clang_type.GetNonReferenceType();<br>
}<br>
<br>
CompilerType<br>
GetUnqualifiedType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetLayoutCompilerType ().GetFullyUnqualifiedType();<br>
- return clang_type.GetFullyUnqualifiedType();<br>
+ return type_sp->GetForwardCompilerType ().GetFullyUnqualifiedType();<br>
+ else<br>
+ return clang_type.GetFullyUnqualifiedType();<br>
}<br>
<br>
CompilerType<br>
GetCanonicalType () const<br>
{<br>
if (type_sp)<br>
- return type_sp->GetFullCompilerType ().GetCanonicalType();<br>
+ return type_sp->GetForwardCompilerType ().GetCanonicalType();<br>
return clang_type.GetCanonicalType();<br>
}<br>
<br>
<br>
Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)<br>
+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Thu Sep 17 17:23:34 2015<br>
@@ -14,6 +14,7 @@<br>
#include <string><br>
#include "lldb/lldb-private.h"<br>
#include "lldb/Core/ClangForward.h"<br>
+#include "lldb/Core/PluginInterface.h"<br>
#include "lldb/Expression/Expression.h"<br>
#include "lldb/Symbol/CompilerDeclContext.h"<br>
#include "clang/AST/CharUnits.h"<br>
@@ -28,7 +29,7 @@ namespace lldb_private {<br>
//----------------------------------------------------------------------<br>
// Interface for representing the Type Systems in different languages.<br>
//----------------------------------------------------------------------<br>
-class TypeSystem<br>
+class TypeSystem : public PluginInterface<br>
{<br>
public:<br>
//----------------------------------------------------------------------<br>
@@ -71,6 +72,9 @@ public:<br>
<br>
LLVMCastKind getKind() const { return m_kind; }<br>
<br>
+ static lldb::TypeSystemSP<br>
+ CreateInstance (lldb::LanguageType language, const lldb_private::ArchSpec &arch);<br>
+<br>
//----------------------------------------------------------------------<br>
// Constructors and Destructors<br>
//----------------------------------------------------------------------<br>
@@ -182,7 +186,11 @@ public:<br>
<br>
virtual bool<br>
IsVoidType (void *type) = 0;<br>
-<br>
+<br>
+ // TypeSystems can support more than one language<br>
+ virtual bool<br>
+ SupportsLanguage (lldb::LanguageType language) = 0;<br>
+<br>
//----------------------------------------------------------------------<br>
// Type Completion<br>
//----------------------------------------------------------------------<br>
@@ -245,7 +253,25 @@ public:<br>
<br>
virtual CompilerType<br>
GetPointerType (void *type) = 0;<br>
-<br>
+<br>
+ virtual CompilerType<br>
+ GetLValueReferenceType (void *type);<br>
+<br>
+ virtual CompilerType<br>
+ GetRValueReferenceType (void *type);<br>
+<br>
+ virtual CompilerType<br>
+ AddConstModifier (void *type);<br>
+<br>
+ virtual CompilerType<br>
+ AddVolatileModifier (void *type);<br>
+<br>
+ virtual CompilerType<br>
+ AddRestrictModifier (void *type);<br>
+<br>
+ virtual CompilerType<br>
+ CreateTypedef (void *type, const char *name, const CompilerDeclContext &decl_ctx);<br>
+<br>
//----------------------------------------------------------------------<br>
// Exploring the type<br>
//----------------------------------------------------------------------<br>
@@ -261,7 +287,10 @@ public:<br>
<br>
virtual uint32_t<br>
GetNumChildren (void *type, bool omit_empty_base_classes) = 0;<br>
-<br>
+<br>
+ virtual CompilerType<br>
+ GetBuiltinTypeByName (const ConstString &name);<br>
+<br>
virtual lldb::BasicType<br>
GetBasicTypeEnumeration (void *type) = 0;<br>
<br>
@@ -417,10 +446,8 @@ public:<br>
GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;<br>
<br>
virtual CompilerType<br>
- GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;<br>
-<br>
- virtual CompilerType<br>
- GetFloatTypeFromBitSize (size_t bit_size) = 0;<br>
+ GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding,<br>
+ size_t bit_size) = 0;<br>
<br>
virtual bool<br>
IsBeingDefined (void *type) = 0;<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-forward.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/lldb-forward.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-forward.h Thu Sep 17 17:23:34 2015<br>
@@ -426,6 +426,7 @@ namespace lldb {<br>
typedef std::shared_ptr<lldb_private::TypeMemberFunctionImpl> TypeMemberFunctionImplSP;<br>
typedef std::shared_ptr<lldb_private::TypeEnumMemberImpl> TypeEnumMemberImplSP;<br>
typedef std::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;<br>
+ typedef std::shared_ptr<lldb_private::TypeSystem> TypeSystemSP;<br>
typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;<br>
typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;<br>
typedef std::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP;<br>
<br>
Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/include/lldb/lldb-private-interfaces.h (original)<br>
+++ lldb/trunk/include/lldb/lldb-private-interfaces.h Thu Sep 17 17:23:34 2015<br>
@@ -46,6 +46,7 @@ namespace lldb_private<br>
typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance) (const lldb::ProcessSP &process_sp);<br>
typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType) ();<br>
typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance) (const lldb::ProcessSP &process_sp);<br>
+ typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, const lldb_private::ArchSpec &arch);<br>
typedef int (*ComparisonFunction)(const void *, const void *);<br>
typedef void (*DebuggerInitializeCallback)(Debugger &debugger);<br>
<br>
<br>
Modified: lldb/trunk/source/API/SBModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SBModule.cpp (original)<br>
+++ lldb/trunk/source/API/SBModule.cpp Thu Sep 17 17:23:34 2015<br>
@@ -20,10 +20,10 @@<br>
#include "lldb/Core/StreamString.h"<br>
#include "lldb/Core/ValueObjectList.h"<br>
#include "lldb/Core/ValueObjectVariable.h"<br>
-#include "lldb/Symbol/ClangASTContext.h"<br>
#include "lldb/Symbol/ObjectFile.h"<br>
#include "lldb/Symbol/SymbolVendor.h"<br>
#include "lldb/Symbol/Symtab.h"<br>
+#include "lldb/Symbol/TypeSystem.h"<br>
#include "lldb/Symbol/VariableList.h"<br>
#include "lldb/Target/Target.h"<br>
<br>
@@ -521,7 +521,11 @@ SBModule::FindFirstType (const char *nam<br>
sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));<br>
<br>
if (!sb_type.IsValid())<br>
- sb_type = SBType (ClangASTContext::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));<br>
+ {<br>
+ TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);<br>
+ if (type_system)<br>
+ sb_type = SBType (type_system->GetBuiltinTypeByName(name));<br>
+ }<br>
}<br>
return sb_type;<br>
}<br>
@@ -531,7 +535,11 @@ SBModule::GetBasicType(lldb::BasicType t<br>
{<br>
ModuleSP module_sp (GetSP ());<br>
if (module_sp)<br>
- return SBType (ClangASTContext::GetBasicType (module_sp->GetClangASTContext().getASTContext(), type));<br>
+ {<br>
+ TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);<br>
+ if (type_system)<br>
+ return SBType (type_system->GetBasicTypeFromAST(type));<br>
+ }<br>
return SBType();<br>
}<br>
<br>
@@ -564,9 +572,13 @@ SBModule::FindTypes (const char *type)<br>
}<br>
else<br>
{<br>
- SBType sb_type(ClangASTContext::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));<br>
- if (sb_type.IsValid())<br>
- retval.Append(sb_type);<br>
+ TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);<br>
+ if (type_system)<br>
+ {<br>
+ CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);<br>
+ if (compiler_type)<br>
+ retval.Append(SBType(compiler_type));<br>
+ }<br>
}<br>
}<br>
<br>
<br>
Modified: lldb/trunk/source/API/SBType.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SBType.cpp (original)<br>
+++ lldb/trunk/source/API/SBType.cpp Thu Sep 17 17:23:34 2015<br>
@@ -16,6 +16,7 @@<br>
#include "lldb/Core/Stream.h"<br>
#include "lldb/Symbol/CompilerType.h"<br>
#include "lldb/Symbol/Type.h"<br>
+#include "lldb/Symbol/TypeSystem.h"<br>
<br>
#include "llvm/ADT/APSInt.h"<br>
#include "clang/AST/Decl.h"<br>
<br>
Modified: lldb/trunk/source/API/SystemInitializerFull.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)<br>
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu Sep 17 17:23:34 2015<br>
@@ -24,6 +24,8 @@<br>
#include "lldb/Host/Host.h"<br>
#include "lldb/Initialization/SystemInitializerCommon.h"<br>
#include "lldb/Interpreter/CommandInterpreter.h"<br>
+#include "lldb/Symbol/ClangASTContext.h"<br>
+#include "lldb/Symbol/GoASTContext.h"<br>
<br>
#include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h"<br>
#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"<br>
@@ -251,6 +253,9 @@ SystemInitializerFull::Initialize()<br>
llvm::InitializeAllTargetMCs();<br>
llvm::InitializeAllDisassemblers();<br>
<br>
+ ClangASTContext::Initialize();<br>
+ GoASTContext::Initialize();<br>
+<br>
ABIMacOSX_i386::Initialize();<br>
ABIMacOSX_arm::Initialize();<br>
ABIMacOSX_arm64::Initialize();<br>
@@ -359,6 +364,10 @@ SystemInitializerFull::Terminate()<br>
<br>
// Terminate and unload and loaded system or user LLDB plug-ins<br>
PluginManager::Terminate();<br>
+<br>
+ ClangASTContext::Terminate();<br>
+ GoASTContext::Terminate();<br>
+<br>
ABIMacOSX_i386::Terminate();<br>
ABIMacOSX_arm::Terminate();<br>
ABIMacOSX_arm64::Terminate();<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Thu Sep 17 17:23:34 2015<br>
@@ -146,8 +146,14 @@ CommandObjectArgs::DoExecute (Args& args<br>
result.SetStatus (eReturnStatusFailed);<br>
return false;<br>
}<br>
-<br>
- ClangASTContext &ast_context = thread_module_sp->GetClangASTContext();<br>
+<br>
+ TypeSystem *type_system = thread_module_sp->GetTypeSystemForLanguage(eLanguageTypeC);<br>
+ if (type_system == nullptr)<br>
+ {<br>
+ result.AppendError ("Unable to create C type system.");<br>
+ result.SetStatus (eReturnStatusFailed);<br>
+ return false;<br>
+ }<br>
<br>
ValueList value_list;<br>
<br>
@@ -156,7 +162,7 @@ CommandObjectArgs::DoExecute (Args& args<br>
const char *arg_type_cstr = args.GetArgumentAtIndex(arg_index);<br>
Value value;<br>
value.SetValueType(Value::eValueTypeScalar);<br>
- CompilerType clang_type;<br>
+ CompilerType compiler_type;<br>
<br>
char *int_pos;<br>
if ((int_pos = strstr (const_cast<char*>(arg_type_cstr), "int")))<br>
@@ -198,10 +204,9 @@ CommandObjectArgs::DoExecute (Args& args<br>
result.SetStatus (eReturnStatusFailed);<br>
return false;<br>
}<br>
+ compiler_type = type_system->GetBuiltinTypeForEncodingAndBitSize(encoding, width);<br>
<br>
- clang_type = ast_context.GetBuiltinTypeForEncodingAndBitSize(encoding, width);<br>
-<br>
- if (!clang_type.IsValid())<br>
+ if (!compiler_type.IsValid())<br>
{<br>
result.AppendErrorWithFormat ("Couldn't get Clang type for format %s (%s integer, width %d).\n",<br>
arg_type_cstr,<br>
@@ -215,9 +220,9 @@ CommandObjectArgs::DoExecute (Args& args<br>
else if (strchr (arg_type_cstr, '*'))<br>
{<br>
if (!strcmp (arg_type_cstr, "void*"))<br>
- clang_type = ast_context.GetBasicType(eBasicTypeVoid).GetPointerType();<br>
+ compiler_type = type_system->GetBasicTypeFromAST(eBasicTypeVoid).GetPointerType();<br>
else if (!strcmp (arg_type_cstr, "char*"))<br>
- clang_type = ast_context.GetCStringType (false);<br>
+ compiler_type = type_system->GetBasicTypeFromAST(eBasicTypeChar).GetPointerType();<br>
else<br>
{<br>
result.AppendErrorWithFormat ("Invalid format: %s.\n", arg_type_cstr);<br>
@@ -232,7 +237,7 @@ CommandObjectArgs::DoExecute (Args& args<br>
return false;<br>
}<br>
<br>
- value.SetCompilerType (clang_type);<br>
+ value.SetCompilerType (compiler_type);<br>
value_list.PushValue(value);<br>
}<br>
<br>
<br>
Modified: lldb/trunk/source/Core/Module.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/Module.cpp (original)<br>
+++ lldb/trunk/source/Core/Module.cpp Thu Sep 17 17:23:34 2015<br>
@@ -15,6 +15,7 @@<br>
#include "lldb/Core/Log.h"<br>
#include "lldb/Core/ModuleList.h"<br>
#include "lldb/Core/ModuleSpec.h"<br>
+#include "lldb/Core/PluginManager.h"<br>
#include "lldb/Core/RegularExpression.h"<br>
#include "lldb/Core/Section.h"<br>
#include "lldb/Core/StreamString.h"<br>
@@ -23,17 +24,16 @@<br>
#include "lldb/Host/Symbols.h"<br>
#include "lldb/Interpreter/CommandInterpreter.h"<br>
#include "lldb/Interpreter/ScriptInterpreter.h"<br>
-#include "lldb/Symbol/ClangASTContext.h"<br>
#include "lldb/Symbol/CompileUnit.h"<br>
-#include "lldb/Symbol/GoASTContext.h"<br>
#include "lldb/Symbol/ObjectFile.h"<br>
#include "lldb/Symbol/SymbolContext.h"<br>
+#include "lldb/Symbol/SymbolFile.h"<br>
#include "lldb/Symbol/SymbolVendor.h"<br>
+#include "lldb/Symbol/TypeSystem.h"<br>
#include "lldb/Target/Language.h"<br>
#include "lldb/Target/Process.h"<br>
#include "lldb/Target/SectionLoadList.h"<br>
#include "lldb/Target/Target.h"<br>
-#include "lldb/Symbol/SymbolFile.h"<br>
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"<br>
#include "Plugins/Language/ObjC/ObjCLanguage.h"<br>
<br>
@@ -148,14 +148,12 @@ Module::Module (const ModuleSpec &module<br>
m_object_mod_time (),<br>
m_objfile_sp (),<br>
m_symfile_ap (),<br>
- m_ast (new ClangASTContext),<br>
- m_go_ast(),<br>
+ m_type_system_map(),<br>
m_source_mappings (),<br>
m_sections_ap(),<br>
m_did_load_objfile (false),<br>
m_did_load_symbol_vendor (false),<br>
m_did_parse_uuid (false),<br>
- m_did_init_ast (false),<br>
m_file_has_changed (false),<br>
m_first_file_changed_log (false)<br>
{<br>
@@ -253,14 +251,12 @@ Module::Module(const FileSpec& file_spec<br>
m_object_mod_time (),<br>
m_objfile_sp (),<br>
m_symfile_ap (),<br>
- m_ast (new ClangASTContext),<br>
- m_go_ast(),<br>
+ m_type_system_map(),<br>
m_source_mappings (),<br>
m_sections_ap(),<br>
m_did_load_objfile (false),<br>
m_did_load_symbol_vendor (false),<br>
m_did_parse_uuid (false),<br>
- m_did_init_ast (false),<br>
m_file_has_changed (false),<br>
m_first_file_changed_log (false)<br>
{<br>
@@ -300,14 +296,12 @@ Module::Module () :<br>
m_object_mod_time (),<br>
m_objfile_sp (),<br>
m_symfile_ap (),<br>
- m_ast (new ClangASTContext),<br>
- m_go_ast(),<br>
+ m_type_system_map(),<br>
m_source_mappings (),<br>
m_sections_ap(),<br>
m_did_load_objfile (false),<br>
m_did_load_symbol_vendor (false),<br>
m_did_parse_uuid (false),<br>
- m_did_init_ast (false),<br>
m_file_has_changed (false),<br>
m_first_file_changed_log (false)<br>
{<br>
@@ -424,64 +418,26 @@ Module::GetUUID()<br>
TypeSystem *<br>
Module::GetTypeSystemForLanguage (LanguageType language)<br>
{<br>
- if (language == eLanguageTypeGo)<br>
- {<br>
- Mutex::Locker locker (m_mutex);<br>
- if (!m_go_ast)<br>
- {<br>
- ObjectFile * objfile = GetObjectFile();<br>
- ArchSpec object_arch;<br>
- if (objfile && objfile->GetArchitecture(object_arch))<br>
- {<br>
- m_go_ast.reset(new GoASTContext);<br>
- m_go_ast->SetAddressByteSize(object_arch.GetAddressByteSize());<br>
- }<br>
- }<br>
- return m_go_ast.get();<br>
- }<br>
- else if (language != eLanguageTypeSwift)<br>
- {<br>
- // For now assume all languages except swift use the ClangASTContext for types<br>
- return &GetClangASTContext();<br>
- }<br>
- return nullptr;<br>
-}<br>
+ Mutex::Locker locker (m_mutex);<br>
+ TypeSystemMap::iterator pos = m_type_system_map.find(language);<br>
+ if (pos != m_type_system_map.end())<br>
+ return pos->second.get();<br>
<br>
-ClangASTContext &<br>
-Module::GetClangASTContext ()<br>
-{<br>
- if (m_did_init_ast.load() == false)<br>
+ for (const auto &pair : m_type_system_map)<br>
{<br>
- Mutex::Locker locker (m_mutex);<br>
- if (m_did_init_ast.load() == false)<br>
+ if (pair.second && pair.second->SupportsLanguage(language))<br>
{<br>
- ObjectFile * objfile = GetObjectFile();<br>
- ArchSpec object_arch;<br>
- if (objfile && objfile->GetArchitecture(object_arch))<br>
- {<br>
- m_did_init_ast = true;<br>
-<br>
- // LLVM wants this to be set to iOS or MacOSX; if we're working on<br>
- // a bare-boards type image, change the triple for llvm's benefit.<br>
- if (object_arch.GetTriple().getVendor() == llvm::Triple::Apple<br>
- && object_arch.GetTriple().getOS() == llvm::Triple::UnknownOS)<br>
- {<br>
- if (object_arch.GetTriple().getArch() == llvm::Triple::arm ||<br>
- object_arch.GetTriple().getArch() == llvm::Triple::aarch64 ||<br>
- object_arch.GetTriple().getArch() == llvm::Triple::thumb)<br>
- {<br>
- object_arch.GetTriple().setOS(llvm::Triple::IOS);<br>
- }<br>
- else<br>
- {<br>
- object_arch.GetTriple().setOS(llvm::Triple::MacOSX);<br>
- }<br>
- }<br>
- m_ast->SetArchitecture (object_arch);<br>
- }<br>
+ // Add a new mapping for "language" to point to an already existing<br>
+ // TypeSystem that supports this language<br>
+ m_type_system_map[language] = pair.second;<br>
+ return pair.second.get();<br>
}<br>
}<br>
- return *m_ast;<br>
+<br>
+ // Cache even if we get a shared pointer that contains null type system back<br>
+ lldb::TypeSystemSP type_system_sp = TypeSystem::CreateInstance (language, GetArchitecture());<br>
+ m_type_system_map[language] = type_system_sp;<br>
+ return type_system_sp.get();<br>
}<br>
<br>
void<br>
<br>
Modified: lldb/trunk/source/Core/PluginManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/PluginManager.cpp (original)<br>
+++ lldb/trunk/source/Core/PluginManager.cpp Thu Sep 17 17:23:34 2015<br>
@@ -2516,6 +2516,108 @@ PluginManager::GetInstrumentationRuntime<br>
return NULL;<br>
}<br>
<br>
+#pragma mark TypeSystem<br>
+<br>
+<br>
+struct TypeSystemInstance<br>
+{<br>
+ TypeSystemInstance() :<br>
+ name(),<br>
+ description(),<br>
+ create_callback(NULL)<br>
+ {<br>
+ }<br>
+<br>
+ ConstString name;<br>
+ std::string description;<br>
+ TypeSystemCreateInstance create_callback;<br>
+};<br>
+<br>
+typedef std::vector<TypeSystemInstance> TypeSystemInstances;<br>
+<br>
+static Mutex &<br>
+GetTypeSystemMutex ()<br>
+{<br>
+ static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);<br>
+ return g_instances_mutex;<br>
+}<br>
+<br>
+static TypeSystemInstances &<br>
+GetTypeSystemInstances ()<br>
+{<br>
+ static TypeSystemInstances g_instances;<br>
+ return g_instances;<br>
+}<br>
+<br>
+bool<br>
+PluginManager::RegisterPlugin (const ConstString &name,<br>
+ const char *description,<br>
+ TypeSystemCreateInstance create_callback)<br>
+{<br>
+ if (create_callback)<br>
+ {<br>
+ TypeSystemInstance instance;<br>
+ assert ((bool)name);<br>
+ <a href="http://instance.name" rel="noreferrer" target="_blank">instance.name</a> = name;<br>
+ if (description && description[0])<br>
+ instance.description = description;<br>
+ instance.create_callback = create_callback;<br>
+ Mutex::Locker locker (GetTypeSystemMutex ());<br>
+ GetTypeSystemInstances ().push_back (instance);<br>
+ }<br>
+ return false;<br>
+}<br>
+<br>
+bool<br>
+PluginManager::UnregisterPlugin (TypeSystemCreateInstance create_callback)<br>
+{<br>
+ if (create_callback)<br>
+ {<br>
+ Mutex::Locker locker (GetTypeSystemMutex ());<br>
+ TypeSystemInstances &instances = GetTypeSystemInstances ();<br>
+<br>
+ TypeSystemInstances::iterator pos, end = instances.end();<br>
+ for (pos = instances.begin(); pos != end; ++ pos)<br>
+ {<br>
+ if (pos->create_callback == create_callback)<br>
+ {<br>
+ instances.erase(pos);<br>
+ return true;<br>
+ }<br>
+ }<br>
+ }<br>
+ return false;<br>
+}<br>
+<br>
+TypeSystemCreateInstance<br>
+PluginManager::GetTypeSystemCreateCallbackAtIndex (uint32_t idx)<br>
+{<br>
+ Mutex::Locker locker (GetTypeSystemMutex ());<br>
+ TypeSystemInstances &instances = GetTypeSystemInstances ();<br>
+ if (idx < instances.size())<br>
+ return instances[idx].create_callback;<br>
+ return NULL;<br>
+}<br>
+<br>
+TypeSystemCreateInstance<br>
+PluginManager::GetTypeSystemCreateCallbackForPluginName (const ConstString &name)<br>
+{<br>
+ if (name)<br>
+ {<br>
+ Mutex::Locker locker (GetTypeSystemMutex ());<br>
+ TypeSystemInstances &instances = GetTypeSystemInstances ();<br>
+<br>
+ TypeSystemInstances::iterator pos, end = instances.end();<br>
+ for (pos = instances.begin(); pos != end; ++ pos)<br>
+ {<br>
+ if (name == pos->name)<br>
+ return pos->create_callback;<br>
+ }<br>
+ }<br>
+ return NULL;<br>
+}<br>
+<br>
+<br>
#pragma mark PluginManager<br>
<br>
void<br>
<br>
Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)<br>
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Thu Sep 17 17:23:34 2015<br>
@@ -154,7 +154,7 @@ FixupTypeAndOrName (const TypeAndOrName&<br>
if (parent.IsPointerType())<br>
corrected_type = orig_type.GetPointerType ();<br>
else if (parent.IsPointerOrReferenceType())<br>
- corrected_type = ClangASTContext::GetLValueReferenceType(orig_type);<br>
+ corrected_type = orig_type.GetLValueReferenceType();<br>
ret.SetCompilerType(corrected_type);<br>
}<br>
else /*if (m_dynamic_type_info.HasName())*/<br>
<br>
Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)<br>
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Thu Sep 17 17:23:34 2015<br>
@@ -319,8 +319,10 @@ ValueObjectRegister::GetCompilerTypeImpl<br>
Module *exe_module = target->GetExecutableModulePointer();<br>
if (exe_module)<br>
{<br>
- m_clang_type = exe_module->GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize (m_reg_info.encoding,<br>
- m_reg_info.byte_size * 8);<br>
+ TypeSystem *type_system = exe_module->GetTypeSystemForLanguage (eLanguageTypeC);<br>
+ if (type_system)<br>
+ m_clang_type = type_system->GetBuiltinTypeForEncodingAndBitSize (m_reg_info.encoding,<br>
+ m_reg_info.byte_size * 8);<br>
}<br>
}<br>
}<br>
<br>
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Thu Sep 17 17:23:34 2015<br>
@@ -229,7 +229,7 @@ FormatManager::GetPossibleMatches (Value<br>
if (non_ref_type.IsTypedefType())<br>
{<br>
CompilerType deffed_referenced_type = non_ref_type.GetTypedefedType();<br>
- deffed_referenced_type = is_rvalue_ref ? ClangASTContext::GetRValueReferenceType(deffed_referenced_type) : ClangASTContext::GetLValueReferenceType(deffed_referenced_type);<br>
+ deffed_referenced_type = is_rvalue_ref ? deffed_referenced_type.GetRValueReferenceType() : deffed_referenced_type.GetLValueReferenceType();<br>
GetPossibleMatches(valobj,<br>
deffed_referenced_type,<br>
reason | lldb_private::eFormatterChoiceCriterionNavigatedTypedefs,<br>
<br>
Modified: lldb/trunk/source/DataFormatters/VectorType.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/VectorType.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/VectorType.cpp Thu Sep 17 17:23:34 2015<br>
@@ -31,7 +31,7 @@ GetCompilerTypeForFormat (lldb::Format f<br>
{<br>
case lldb::eFormatAddressInfo:<br>
case lldb::eFormatPointer:<br>
- return type_system->GetIntTypeFromBitSize(8*type_system->GetPointerByteSize(), false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 8*type_system->GetPointerByteSize());<br>
<br>
case lldb::eFormatBoolean:<br>
return type_system->GetBasicTypeFromAST(lldb::eBasicTypeBool);<br>
@@ -70,37 +70,37 @@ GetCompilerTypeForFormat (lldb::Format f<br>
return type_system->GetBasicTypeFromAST(lldb::eBasicTypeChar);<br>
<br>
case lldb::eFormatVectorOfFloat32:<br>
- return type_system->GetFloatTypeFromBitSize(32);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingIEEE754, 32);<br>
<br>
case lldb::eFormatVectorOfFloat64:<br>
- return type_system->GetFloatTypeFromBitSize(64);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingIEEE754, 64);<br>
<br>
case lldb::eFormatVectorOfSInt16:<br>
- return type_system->GetIntTypeFromBitSize(16, true);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingSint, 16);<br>
<br>
case lldb::eFormatVectorOfSInt32:<br>
- return type_system->GetIntTypeFromBitSize(32, true);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingSint, 32);<br>
<br>
case lldb::eFormatVectorOfSInt64:<br>
- return type_system->GetIntTypeFromBitSize(64, true);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingSint, 64);<br>
<br>
case lldb::eFormatVectorOfSInt8:<br>
- return type_system->GetIntTypeFromBitSize(8, true);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingSint, 8);<br>
<br>
case lldb::eFormatVectorOfUInt128:<br>
- return type_system->GetIntTypeFromBitSize(128, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 128);<br>
<br>
case lldb::eFormatVectorOfUInt16:<br>
- return type_system->GetIntTypeFromBitSize(16, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 16);<br>
<br>
case lldb::eFormatVectorOfUInt32:<br>
- return type_system->GetIntTypeFromBitSize(32, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 32);<br>
<br>
case lldb::eFormatVectorOfUInt64:<br>
- return type_system->GetIntTypeFromBitSize(64, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 64);<br>
<br>
case lldb::eFormatVectorOfUInt8:<br>
- return type_system->GetIntTypeFromBitSize(8, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 8);<br>
<br>
case lldb::eFormatDefault:<br>
return element_type;<br>
@@ -113,7 +113,7 @@ GetCompilerTypeForFormat (lldb::Format f<br>
case lldb::eFormatOSType:<br>
case lldb::eFormatVoid:<br>
default:<br>
- return type_system->GetIntTypeFromBitSize(8, false);<br>
+ return type_system->GetBuiltinTypeForEncodingAndBitSize (eEncodingUint, 8);<br>
}<br>
}<br>
<br>
<br>
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)<br>
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Sep 17 17:23:34 2015<br>
@@ -1678,7 +1678,17 @@ ClangExpressionDeclMap::GetVariableValue<br>
return false;<br>
}<br>
<br>
- ASTContext *ast = var_type->GetClangASTContext().getASTContext();<br>
+ ClangASTContext *clang_ast = llvm::dyn_cast_or_null<ClangASTContext>(var_type->GetForwardCompilerType().GetTypeSystem());<br>
+<br>
+ if (!clang_ast)<br>
+ {<br>
+ if (log)<br>
+ log->PutCString("Skipped a definition because it has no Clang AST");<br>
+ return false;<br>
+ }<br>
+<br>
+<br>
+ ASTContext *ast = clang_ast->getASTContext();<br>
<br>
if (!ast)<br>
{<br>
@@ -1785,7 +1795,7 @@ ClangExpressionDeclMap::AddOneVariable (<br>
if (is_reference)<br>
var_decl = context.AddVarDecl(pt);<br>
else<br>
- var_decl = context.AddVarDecl(ClangASTContext::GetLValueReferenceType(pt));<br>
+ var_decl = context.AddVarDecl(pt.GetLValueReferenceType());<br>
<br>
std::string decl_name(context.m_decl_name.getAsString());<br>
ConstString entity_name(decl_name.c_str());<br>
@@ -1829,7 +1839,7 @@ ClangExpressionDeclMap::AddOneVariable(N<br>
return;<br>
}<br>
<br>
- NamedDecl *var_decl = context.AddVarDecl(ClangASTContext::GetLValueReferenceType(parser_type));<br>
+ NamedDecl *var_decl = context.AddVarDecl(parser_type.GetLValueReferenceType());<br>
<br>
llvm::cast<ClangExpressionVariable>(pvar_sp.get())->EnableParserVars(GetParserID());<br>
ClangExpressionVariable::ParserVars *parser_vars = llvm::cast<ClangExpressionVariable>(pvar_sp.get())->GetParserVars(GetParserID());<br>
@@ -1861,8 +1871,8 @@ ClangExpressionDeclMap::AddOneGenericVar<br>
<br>
ASTContext *scratch_ast_context = target->GetScratchClangASTContext()->getASTContext();<br>
<br>
- TypeFromUser user_type (ClangASTContext::GetLValueReferenceType(ClangASTContext::GetBasicType(scratch_ast_context, eBasicTypeVoid).GetPointerType()));<br>
- TypeFromParser parser_type (ClangASTContext::GetLValueReferenceType(ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid).GetPointerType()));<br>
+ TypeFromUser user_type (ClangASTContext::GetBasicType(scratch_ast_context, eBasicTypeVoid).GetPointerType().GetLValueReferenceType());<br>
+ TypeFromParser parser_type (ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid).GetPointerType().GetLValueReferenceType());<br>
NamedDecl *var_decl = context.AddVarDecl(parser_type);<br>
<br>
std::string decl_name(context.m_decl_name.getAsString());<br>
<br>
Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)<br>
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Thu Sep 17 17:23:34 2015<br>
@@ -28,6 +28,7 @@<br>
#include "lldb/Expression/IRInterpreter.h"<br>
#include "lldb/Host/File.h"<br>
#include "lldb/Host/HostInfo.h"<br>
+#include "lldb/Symbol/ClangASTContext.h"<br>
#include "lldb/Symbol/SymbolVendor.h"<br>
#include "lldb/Target/ExecutionContext.h"<br>
#include "lldb/Target/ObjCLanguageRuntime.h"<br>
<br>
Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)<br>
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu Sep 17 17:23:34 2015<br>
@@ -13,7 +13,8 @@<br>
#include "lldb/Host/HostInfo.h"<br>
#include "lldb/Core/Log.h"<br>
#include "lldb/Core/Timer.h"<br>
-<br>
+#include "lldb/Symbol/GoASTContext.h"<br>
+#include "lldb/Symbol/ClangASTContext.h"<br>
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"<br>
#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"<br>
#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"<br>
@@ -103,6 +104,9 @@ SystemInitializerCommon::Initialize()<br>
process_gdb_remote::ProcessGDBRemoteLog::Initialize();<br>
<br>
// Initialize plug-ins<br>
+ ClangASTContext::Initialize();<br>
+ GoASTContext::Initialize();<br>
+<br>
ObjectContainerBSDArchive::Initialize();<br>
ObjectFileELF::Initialize();<br>
ObjectFilePECOFF::Initialize();<br>
@@ -166,6 +170,9 @@ SystemInitializerCommon::Terminate()<br>
PlatformRemoteiOS::Terminate();<br>
PlatformiOSSimulator::Terminate();<br>
<br>
+ ClangASTContext::Terminate();<br>
+ GoASTContext::Terminate();<br>
+<br>
EmulateInstructionARM::Terminate();<br>
EmulateInstructionMIPS::Terminate();<br>
EmulateInstructionMIPS64::Terminate();<br>
<br>
Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Thu Sep 17 17:23:34 2015<br>
@@ -763,7 +763,7 @@ GetNSPathStore2Type (Target &target)<br>
return CompilerType();<br>
<br>
CompilerType voidstar = ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType();<br>
- CompilerType uint32 = ast_ctx->GetIntTypeFromBitSize(32, false);<br>
+ CompilerType uint32 = ast_ctx->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32);<br>
<br>
return ast_ctx->GetOrCreateStructForIdentifier(g_type_name, {<br>
{"isa",voidstar},<br>
<br>
Modified: lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp Thu Sep 17 17:23:34 2015<br>
@@ -30,8 +30,8 @@ lldb_private::formatters::CMTimeSummaryP<br>
return false;<br>
<br>
// fetch children by offset to compensate for potential lack of debug info<br>
- auto int64_ty = type_system->GetIntTypeFromBitSize(64, true);<br>
- auto int32_ty = type_system->GetIntTypeFromBitSize(32, true);<br>
+ auto int64_ty = type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, 64);<br>
+ auto int32_ty = type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, 32);<br>
<br>
auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true));<br>
auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true));<br>
<br>
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp?rev=247953&r1=247952&r2=247953&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp?rev=247953&r1=247952&r2=247953&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp (original)<br>
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp Thu Sep 17 17:23:34 2015<br>
@@ -177,7 +177,7 @@ DWARFASTParserGo::ParseTypeFromDWARF(con<br>
return type->shared_from_this();<br>
</blockquote></div></blockquote></div>