<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 9, 2015, at 3:58 PM, Ryan Brown <<a href="mailto:ribrdb@google.com" class="">ribrdb@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Sep 9, 2015 at 2:57 PM Enrico Granata <<a href="mailto:egranata@apple.com" class="">egranata@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 9, 2015, at 2:47 PM, Ryan Brown <<a href="mailto:ribrdb@google.com" target="_blank" class="">ribrdb@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class="">On Tue, Sep 8, 2015 at 3:10 PM Enrico Granata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: enrico<br class="">Date: Tue Sep  8 17:09:19 2015<br class="">New Revision: 247082<br class=""><br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project?rev=247082&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=247082&view=rev</a><br class="">Log:<br class="">Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness<br class=""><br class="">Modified:<br class="">   <span class=""> </span>lldb/trunk/include/lldb/Symbol/ClangASTContext.h<br class="">   <span class=""> </span>lldb/trunk/include/lldb/Symbol/TypeSystem.h<br class="">   <span class=""> </span>lldb/trunk/include/lldb/Target/Target.h<br class="">   <span class=""> </span>lldb/trunk/source/DataFormatters/CoreMedia.cpp<br class="">   <span class=""> </span>lldb/trunk/source/DataFormatters/VectorType.cpp<br class="">   <span class=""> </span>lldb/trunk/source/Target/Target.cpp<br class=""><br class="">Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)<br class="">+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Sep  8 17:09:19 2015<br class="">@@ -454,7 +454,7 @@ public:<br class="">     //------------------------------------------------------------------<br class=""><br class="">     CompilerType<br class="">-    GetIntTypeFromBitSize (size_t bit_size, bool is_signed)<br class="">+    GetIntTypeFromBitSize (size_t bit_size, bool is_signed) override<br class="">     {<br class="">         return GetIntTypeFromBitSize (getASTContext(), bit_size, is_signed);<br class="">     }<br class="">@@ -477,7 +477,7 @@ public:<br class="">     //------------------------------------------------------------------<br class=""><br class="">     CompilerType<br class="">-    GetFloatTypeFromBitSize (size_t bit_size)<br class="">+    GetFloatTypeFromBitSize (size_t bit_size) override<br class="">     {<br class="">         return GetFloatTypeFromBitSize (getASTContext(), bit_size);<br class="">     }<br class=""><br class="">Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original)<br class="">+++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Tue Sep  8 17:09:19 2015<br class="">@@ -400,6 +400,12 @@ public:<br class="">     virtual CompilerType<br class="">     GetBasicTypeFromAST (lldb::BasicType basic_type) = 0;<br class=""><br class="">+    virtual CompilerType<br class="">+    GetIntTypeFromBitSize (size_t bit_size, bool is_signed) = 0;<br class="">+<br class="">+    virtual CompilerType<br class="">+    GetFloatTypeFromBitSize (size_t bit_size) = 0;<br class="">+<br class=""></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">Why do these need to be here?</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">They are convenient to have when you are not transacting in terms of “int” or “float” but in terms of “I want a type that can represent a 32-bit unsigned integer value"</div></div></div><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">It seems like everything using these is clang specific.</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">That might be because at the moment open-source LLDB does not have fully-baked type systems for non-clang languages</div><div class="">I suspect that most languages have a notion of numeric types of a certain bit-size and signedness, so the API itself is not clang-specific whatsoever</div></div></div></blockquote><div class=""><br class=""></div><div class="">I ask because I'm trying to add another TypeSystem.</div><div class="">I could implement these, but I don't really like adding functionality that  isn't used and that I don't really have any way to test.</div><div class=""> </div></div></div></div></blockquote><div><br class=""></div><div>Returning a nullptr TypeSystem and hollow CompilerTypes is fine if you’re not going to make any use of these</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><blockquote type="cite" class=""><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">     virtual bool<br class="">     IsBeingDefined (void *type) = 0;<br class=""><br class=""><br class="">Modified: lldb/trunk/include/lldb/Target/Target.h<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Target/Target.h (original)<br class="">+++ lldb/trunk/include/lldb/Target/Target.h Tue Sep  8 17:09:19 2015<br class="">@@ -1230,6 +1230,14 @@ public:<br class="">     ClangASTContext *<br class="">     GetScratchClangASTContext(bool create_on_demand=true);<br class=""><br class="">+    TypeSystem*<br class="">+    GetTypeSystemForLanguage (lldb::LanguageType language);<br class="">+<br class="">+    CompilerType<br class="">+    GetBasicType (lldb::LanguageType language,<br class="">+                  lldb::BasicType basic_type,<br class="">+                  size_t size = 0);<br class="">+<br class=""></blockquote></blockquote><div class=""><br class=""></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">I am not sure the latter API (Target::GetBasicType) even needs to be there - my bad for checking that in</div><div class="">The former one (Target::GetTypeSystemForLanguage) is what I truly meant to introduce</div></div></div><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">Again, I'm not sure why this needs to be here when all uses are clang specific.</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">Same argument, the API has nothing clang-specific about it. The existing implementation/users are, but that is to be expected since clang is currently the only compiler that<span class="Apple-converted-space"> </span><a href="http://llvm.org/" target="_blank" class="">llvm.org</a><span class="Apple-converted-space"> </span>LLDB is integrated with</div></div></div><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">If it needs to be here, can you add some documentation?</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">Sure thing. Do you have any suggestions as to how to phrase it?</div></div></div><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">When writing a new TypeSystem, does it need to be added to GetTypeSystemForLanguage?</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">Seems about right</div></div></div><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">How would it be used? Do types from this "scratch" type system need to interact with types from a real, symbol file backed type system?<span class="Apple-converted-space"> </span></div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">Define “interact"</div></div></div></blockquote><div class="">Well for example in VectorType you use a CompilerType from the "scratch" type system with a ValueObject that might be using another type system. That seems strange to me.</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><br class=""></div></div></blockquote></div></div></div></blockquote><div><br class=""></div><div>Truth be told, I am currently only classifying as “vector type” types coming from clang</div><div>If your new type system has a notion of vector type, then we can look at how to adjust the data formatter to work in both scenarios. I suspect that might be as simple as you returning proper types from your type system, and me using the ValueObject’s “minimum runtime language” as the one to ask for the scratch AST context instead of defaulting to C</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">What if the sizes of basic types aren't standardized and need to be lookup up in the debug info?</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap: break-word;" class=""><div class=""><div class="">I assume this remark is for Target::GetBasicType(), and thus a moot point since I didn’t mean to check that declaration at all, and will remove it soon</div></div></div></blockquote><div class=""><br class=""></div><div class="">It's not really moot because I need to know how to implement GetBasicType for the TypeSytem I return from Target::GetTypeSystemForLanguage(eLanguageTypeGo).</div><div class="">I guess I'm wondering what the contract is for the TypeSystem I return.</div><div class="">If only the GetXTypeFromBitSize methods are called things should work fine. But if someone calls GetBasicType(eBasicTypeInt), I can only guess what the compiler chose.</div></div></div></div></blockquote><div><br class=""></div><div>That depends on the semantics of your language. Apparently, for Go, “int” is a type alias for either 32 or 64 bit integers</div><div>I am not familiar with how the choice is made (pointer size, maybe?) so I can’t help you decide how to disambiguate</div><div>If some cases of GetBasicType() are undefined/non-existant in Go, returning an empty type is the right thing to do. For instance, if asked for an “id”, I would not expect Go to return anything sensible.</div><div>On the other hand, if Go has, say, an abstract base channel type, it would make sense for it to be a BasicType, where Go would respond correctly, but clang would just return an empty type.</div><div>If we need to adjust the vector formatter (or other formatters) such that they only ask for specific byte-sizes, we can work on that.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote"><div class=""><br class=""></div><div class="">It seems like everything currently using GetScratchClangASTContext is inside language specific data formatters or runtimes, and I'm having a hard time imaging a use case that isn't language specific.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""> </div><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">     ClangASTImporter *<br class="">     GetClangASTImporter();<br class=""><br class=""><br class="">Modified: lldb/trunk/source/DataFormatters/CoreMedia.cpp<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CoreMedia.cpp?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CoreMedia.cpp?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/DataFormatters/CoreMedia.cpp (original)<br class="">+++ lldb/trunk/source/DataFormatters/CoreMedia.cpp Tue Sep  8 17:09:19 2015<br class="">@@ -10,7 +10,7 @@<br class=""> #include "lldb/DataFormatters/CoreMedia.h"<br class=""><br class=""> #include "lldb/Core/Flags.h"<br class="">-#include "lldb/Symbol/ClangASTContext.h"<br class="">+#include "lldb/Symbol/TypeSystem.h"<br class=""> #include "lldb/Target/Target.h"<br class=""> #include <inttypes.h><br class=""><br class="">@@ -25,13 +25,13 @@ lldb_private::formatters::CMTimeSummaryP<br class="">     if (!type.IsValid())<br class="">         return false;<br class=""><br class="">-    ClangASTContext *ast_ctx = valobj.GetExecutionContextRef().GetTargetSP()->GetScratchClangASTContext();<br class="">-    if (!ast_ctx)<br class="">+    TypeSystem *type_system = valobj.GetExecutionContextRef().GetTargetSP()->GetTypeSystemForLanguage(lldb::eLanguageTypeC);<br class="">+    if (!type_system)<br class="">         return false;<br class=""><br class="">     // fetch children by offset to compensate for potential lack of debug info<br class="">-    auto int64_ty = ast_ctx->GetIntTypeFromBitSize(64, true);<br class="">-    auto int32_ty = ast_ctx->GetIntTypeFromBitSize(32, true);<br class="">+    auto int64_ty = type_system->GetIntTypeFromBitSize(64, true);<br class="">+    auto int32_ty = type_system->GetIntTypeFromBitSize(32, true);<br class=""><br class="">     auto value_sp(valobj.GetSyntheticChildAtOffset(0, int64_ty, true));<br class="">     auto timescale_sp(valobj.GetSyntheticChildAtOffset(8, int32_ty, true));<br class=""><br class="">Modified: lldb/trunk/source/DataFormatters/VectorType.cpp<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/DataFormatters/VectorType.cpp (original)<br class="">+++ lldb/trunk/source/DataFormatters/VectorType.cpp Tue Sep  8 17:09:19 2015<br class="">@@ -11,8 +11,8 @@<br class=""><br class=""> #include "lldb/Core/ValueObject.h"<br class=""> #include "lldb/DataFormatters/FormattersHelpers.h"<br class="">-#include "lldb/Symbol/ClangASTContext.h"<br class=""> #include "lldb/Symbol/CompilerType.h"<br class="">+#include "lldb/Symbol/TypeSystem.h"<br class=""><br class=""> #include "lldb/Utility/LLDBAssert.h"<br class=""><br class="">@@ -22,85 +22,85 @@ using namespace lldb_private::formatters<br class=""><br class=""> static CompilerType<br class=""> GetCompilerTypeForFormat (lldb::Format format,<br class="">-                       CompilerType element_type,<br class="">-                       ClangASTContext *ast_ctx)<br class="">+                          CompilerType element_type,<br class="">+                          TypeSystem *type_system)<br class=""> {<br class="">-    lldbassert(ast_ctx && "ast_ctx needs to be not NULL");<br class="">+    lldbassert(type_system && "type_system needs to be not NULL");<br class=""><br class="">     switch (format)<br class="">     {<br class="">         case lldb::eFormatAddressInfo:<br class="">         case lldb::eFormatPointer:<br class="">-            return ast_ctx->GetPointerSizedIntType(false);<br class="">+            return type_system->GetIntTypeFromBitSize(8*type_system->GetPointerByteSize(), false);<br class=""><br class="">         case lldb::eFormatBoolean:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeBool);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeBool);<br class=""><br class="">         case lldb::eFormatBytes:<br class="">         case lldb::eFormatBytesWithASCII:<br class="">         case lldb::eFormatChar:<br class="">         case lldb::eFormatCharArray:<br class="">         case lldb::eFormatCharPrintable:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeChar);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeChar);<br class=""><br class="">         case lldb::eFormatComplex /* lldb::eFormatComplexFloat */:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeFloatComplex);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeFloatComplex);<br class=""><br class="">         case lldb::eFormatCString:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeChar).GetPointerType();<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeChar).GetPointerType();<br class=""><br class="">         case lldb::eFormatFloat:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeFloat);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeFloat);<br class=""><br class="">         case lldb::eFormatHex:<br class="">         case lldb::eFormatHexUppercase:<br class="">         case lldb::eFormatOctal:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeInt);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeInt);<br class=""><br class="">         case lldb::eFormatHexFloat:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeFloat);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeFloat);<br class=""><br class="">         case lldb::eFormatUnicode16:<br class="">         case lldb::eFormatUnicode32:<br class=""><br class="">         case lldb::eFormatUnsigned:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeUnsignedInt);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeUnsignedInt);<br class=""><br class="">         case lldb::eFormatVectorOfChar:<br class="">-            return ast_ctx->GetBasicType(lldb::eBasicTypeChar);<br class="">+            return type_system->GetBasicTypeFromAST(lldb::eBasicTypeChar);<br class=""><br class="">         case lldb::eFormatVectorOfFloat32:<br class="">-            return ast_ctx->GetFloatTypeFromBitSize(32);<br class="">+            return type_system->GetFloatTypeFromBitSize(32);<br class=""><br class="">         case lldb::eFormatVectorOfFloat64:<br class="">-            return ast_ctx->GetFloatTypeFromBitSize(64);<br class="">+            return type_system->GetFloatTypeFromBitSize(64);<br class=""><br class="">         case lldb::eFormatVectorOfSInt16:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(16, true);<br class="">+            return type_system->GetIntTypeFromBitSize(16, true);<br class=""><br class="">         case lldb::eFormatVectorOfSInt32:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(32, true);<br class="">+            return type_system->GetIntTypeFromBitSize(32, true);<br class=""><br class="">         case lldb::eFormatVectorOfSInt64:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(64, true);<br class="">+            return type_system->GetIntTypeFromBitSize(64, true);<br class=""><br class="">         case lldb::eFormatVectorOfSInt8:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(8, true);<br class="">+            return type_system->GetIntTypeFromBitSize(8, true);<br class=""><br class="">         case lldb::eFormatVectorOfUInt128:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(128, false);<br class="">+            return type_system->GetIntTypeFromBitSize(128, false);<br class=""><br class="">         case lldb::eFormatVectorOfUInt16:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(16, false);<br class="">+            return type_system->GetIntTypeFromBitSize(16, false);<br class=""><br class="">         case lldb::eFormatVectorOfUInt32:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(32, false);<br class="">+            return type_system->GetIntTypeFromBitSize(32, false);<br class=""><br class="">         case lldb::eFormatVectorOfUInt64:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(64, false);<br class="">+            return type_system->GetIntTypeFromBitSize(64, false);<br class=""><br class="">         case lldb::eFormatVectorOfUInt8:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(8, false);<br class="">+            return type_system->GetIntTypeFromBitSize(8, false);<br class=""><br class="">         case lldb::eFormatDefault:<br class="">             return element_type;<br class="">@@ -113,7 +113,7 @@ GetCompilerTypeForFormat (lldb::Format f<br class="">         case lldb::eFormatOSType:<br class="">         case lldb::eFormatVoid:<br class="">         default:<br class="">-            return ast_ctx->GetIntTypeFromBitSize(8, false);<br class="">+            return type_system->GetIntTypeFromBitSize(8, false);<br class="">     }<br class=""> }<br class=""><br class="">@@ -232,7 +232,10 @@ namespace lldb_private {<br class="">                 CompilerType parent_type(m_backend.GetCompilerType());<br class="">                 CompilerType element_type;<br class="">                 parent_type.IsVectorType(&element_type, nullptr);<br class="">-                m_child_type = ::GetCompilerTypeForFormat(m_parent_format, element_type, llvm::dyn_cast_or_null<ClangASTContext>(parent_type.GetTypeSystem()));<br class="">+                TargetSP target_sp(m_backend.GetTargetSP());<br class="">+                m_child_type = ::GetCompilerTypeForFormat(m_parent_format,<br class="">+                                                          element_type,<br class="">+                                                          target_sp ? target_sp->GetTypeSystemForLanguage(lldb::eLanguageTypeC) : nullptr);<br class="">                 m_num_children = ::CalculateNumChildren(parent_type,<br class="">                                                         m_child_type);<br class="">                 m_item_format = GetItemFormatForFormat(m_parent_format,<br class=""><br class="">Modified: lldb/trunk/source/Target/Target.cpp<br class="">URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=247082&r1=247081&r2=247082&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=247082&r1=247081&r2=247082&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Target/Target.cpp (original)<br class="">+++ lldb/trunk/source/Target/Target.cpp Tue Sep  8 17:09:19 2015<br class="">@@ -1906,6 +1906,27 @@ Target::GetScratchClangASTContext(bool c<br class="">     return m_scratch_ast_context_ap.get();<br class=""> }<br class=""><br class="">+TypeSystem*<br class="">+Target::GetTypeSystemForLanguage (lldb::LanguageType language)<br class="">+{<br class="">+    switch (language)<br class="">+    {<br class="">+        case lldb::eLanguageTypeC:<br class="">+        case lldb::eLanguageTypeC11:<br class="">+        case lldb::eLanguageTypeC89:<br class="">+        case lldb::eLanguageTypeC99:<br class="">+        case lldb::eLanguageTypeC_plus_plus:<br class="">+        case lldb::eLanguageTypeC_plus_plus_03:<br class="">+        case lldb::eLanguageTypeC_plus_plus_11:<br class="">+        case lldb::eLanguageTypeC_plus_plus_14:<br class="">+        case lldb::eLanguageTypeObjC:<br class="">+        case lldb::eLanguageTypeObjC_plus_plus:<br class="">+            return GetScratchClangASTContext(true);<br class="">+        default:<br class="">+            return nullptr;<br class="">+    }<br class="">+}<br class="">+<br class=""> ClangASTImporter *<br class=""> Target::GetClangASTImporter()<br class=""> {<br class=""><br class=""><br class="">_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a></blockquote></div></blockquote></div></div><div style="word-wrap: break-word;" class=""><div class=""></div><br class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class="">Thanks,</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div></div></div></blockquote></div></div></div></blockquote></div><br class=""><div class="">
<div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></body></html>