diff options
author | Greg Clayton <gclayton@apple.com> | 2015-08-11 22:53:00 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-08-11 22:53:00 +0000 |
commit | a1e5dc86a6306b91caf1bd4c5ed7ca1113405111 (patch) | |
tree | 6104ff1effe325c412ba70449db68df49298a32a /lldb/source | |
parent | c49e4fe9ccff7587a271d5c17ecad130d2dea201 (diff) | |
download | llvm-a1e5dc86a6306b91caf1bd4c5ed7ca1113405111.zip llvm-a1e5dc86a6306b91caf1bd4c5ed7ca1113405111.tar.gz llvm-a1e5dc86a6306b91caf1bd4c5ed7ca1113405111.tar.bz2 |
ClangASTType is now CompilerType.
This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc).
llvm-svn: 244689
Diffstat (limited to 'lldb/source')
108 files changed, 973 insertions, 997 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index f80ed8c..9fdd4df 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -1346,7 +1346,7 @@ SBTarget::WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write, S // Target::CreateWatchpoint() is thread safe. Error cw_error; // This API doesn't take in a type, so we can't figure out what it is. - ClangASTType *type = NULL; + CompilerType *type = NULL; watchpoint_sp = target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error); error.SetError(cw_error); sb_watchpoint.SetSP (watchpoint_sp); @@ -1400,7 +1400,7 @@ SBTarget::CreateValueFromAddress (const char *name, SBAddress addr, SBType type) { lldb::addr_t load_addr(addr.GetLoadAddress(*this)); ExecutionContext exe_ctx (ExecutionContextRef(ExecutionContext(m_opaque_sp.get(),false))); - ClangASTType ast_type(type.GetSP()->GetClangASTType(true)); + CompilerType ast_type(type.GetSP()->GetCompilerType(true)); new_value_sp = ValueObject::CreateValueObjectFromAddress(name, load_addr, exe_ctx, ast_type); } sb_value.SetSP(new_value_sp); @@ -1427,7 +1427,7 @@ SBTarget::CreateValueFromData (const char *name, lldb::SBData data, lldb::SBType { DataExtractorSP extractor(*data); ExecutionContext exe_ctx (ExecutionContextRef(ExecutionContext(m_opaque_sp.get(),false))); - ClangASTType ast_type(type.GetSP()->GetClangASTType(true)); + CompilerType ast_type(type.GetSP()->GetCompilerType(true)); new_value_sp = ValueObject::CreateValueObjectFromData(name, *extractor, exe_ctx, ast_type); } sb_value.SetSP(new_value_sp); @@ -1808,7 +1808,7 @@ SBTarget::FindFirstType (const char* typename_cstr) if (objc_decl_vendor->FindDecls(const_typename, true, 1, decls) > 0) { - if (ClangASTType type = ClangASTContext::GetTypeForDecl(decls[0])) + if (CompilerType type = ClangASTContext::GetTypeForDecl(decls[0])) { return SBType(type); } @@ -1888,7 +1888,7 @@ SBTarget::FindTypes (const char* typename_cstr) { for (clang::NamedDecl *decl : decls) { - if (ClangASTType type = ClangASTContext::GetTypeForDecl(decl)) + if (CompilerType type = ClangASTContext::GetTypeForDecl(decl)) { sb_type_list.Append(SBType(type)); } diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 4977ee6..14cd6ff 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -15,7 +15,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Type.h" #include "clang/AST/Decl.h" @@ -29,8 +29,8 @@ SBType::SBType() : { } -SBType::SBType (const ClangASTType &type) : - m_opaque_sp(new TypeImpl(ClangASTType(type.GetTypeSystem(), +SBType::SBType (const CompilerType &type) : + m_opaque_sp(new TypeImpl(CompilerType(type.GetTypeSystem(), type.GetOpaqueQualType()))) { } @@ -143,7 +143,7 @@ SBType::GetByteSize() if (!IsValid()) return 0; - return m_opaque_sp->GetClangASTType(false).GetByteSize(nullptr); + return m_opaque_sp->GetCompilerType(false).GetByteSize(nullptr); } @@ -152,7 +152,7 @@ SBType::IsPointerType() { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsPointerType(); + return m_opaque_sp->GetCompilerType(true).IsPointerType(); } bool @@ -160,7 +160,7 @@ SBType::IsArrayType() { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsArrayType(nullptr, nullptr, nullptr); + return m_opaque_sp->GetCompilerType(true).IsArrayType(nullptr, nullptr, nullptr); } bool @@ -168,7 +168,7 @@ SBType::IsVectorType() { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsVectorType(nullptr, nullptr); + return m_opaque_sp->GetCompilerType(true).IsVectorType(nullptr, nullptr); } bool @@ -176,7 +176,7 @@ SBType::IsReferenceType() { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsReferenceType(); + return m_opaque_sp->GetCompilerType(true).IsReferenceType(); } SBType @@ -225,7 +225,7 @@ SBType::GetArrayElementType() { if (!IsValid()) return SBType(); - return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetClangASTType(true).GetArrayElementType()))); + return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayElementType()))); } SBType @@ -234,8 +234,8 @@ SBType::GetVectorElementType () SBType type_sb; if (IsValid()) { - ClangASTType vector_element_type; - if (m_opaque_sp->GetClangASTType(true).IsVectorType(&vector_element_type, nullptr)) + CompilerType vector_element_type; + if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type, nullptr)) type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type))); } return type_sb; @@ -246,7 +246,7 @@ SBType::IsFunctionType () { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsFunctionType(); + return m_opaque_sp->GetCompilerType(true).IsFunctionType(); } bool @@ -254,7 +254,7 @@ SBType::IsPolymorphicClass () { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsPolymorphicClass(); + return m_opaque_sp->GetCompilerType(true).IsPolymorphicClass(); } bool @@ -262,7 +262,7 @@ SBType::IsTypedefType () { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(true).IsTypedefType(); + return m_opaque_sp->GetCompilerType(true).IsTypedefType(); } lldb::SBType @@ -270,7 +270,7 @@ SBType::GetFunctionReturnType () { if (IsValid()) { - ClangASTType return_clang_type (m_opaque_sp->GetClangASTType(true).GetFunctionReturnType()); + CompilerType return_clang_type (m_opaque_sp->GetCompilerType(true).GetFunctionReturnType()); if (return_clang_type.IsValid()) return SBType(return_clang_type); } @@ -283,7 +283,7 @@ SBType::GetFunctionArgumentTypes () SBTypeList sb_type_list; if (IsValid()) { - ClangASTType func_type(m_opaque_sp->GetClangASTType(true)); + CompilerType func_type(m_opaque_sp->GetCompilerType(true)); size_t count = func_type.GetNumberOfFunctionArguments(); for (size_t i = 0; i < count; @@ -300,7 +300,7 @@ SBType::GetNumberOfMemberFunctions () { if (IsValid()) { - return m_opaque_sp->GetClangASTType(true).GetNumMemberFunctions(); + return m_opaque_sp->GetCompilerType(true).GetNumMemberFunctions(); } return 0; } @@ -310,7 +310,7 @@ SBType::GetMemberFunctionAtIndex (uint32_t idx) { SBTypeMemberFunction sb_func_type; if (IsValid()) - sb_func_type.reset(new TypeMemberFunctionImpl(m_opaque_sp->GetClangASTType(true).GetMemberFunctionAtIndex(idx))); + sb_func_type.reset(new TypeMemberFunctionImpl(m_opaque_sp->GetCompilerType(true).GetMemberFunctionAtIndex(idx))); return sb_func_type; } @@ -335,7 +335,7 @@ lldb::BasicType SBType::GetBasicType() { if (IsValid()) - return m_opaque_sp->GetClangASTType(false).GetBasicTypeEnumeration (); + return m_opaque_sp->GetCompilerType(false).GetBasicTypeEnumeration (); return eBasicTypeInvalid; } @@ -356,7 +356,7 @@ uint32_t SBType::GetNumberOfDirectBaseClasses () { if (IsValid()) - return ClangASTContext::GetNumDirectBaseClasses(m_opaque_sp->GetClangASTType(true)); + return ClangASTContext::GetNumDirectBaseClasses(m_opaque_sp->GetCompilerType(true)); return 0; } @@ -364,7 +364,7 @@ uint32_t SBType::GetNumberOfVirtualBaseClasses () { if (IsValid()) - return ClangASTContext::GetNumVirtualBaseClasses(m_opaque_sp->GetClangASTType(true)); + return ClangASTContext::GetNumVirtualBaseClasses(m_opaque_sp->GetCompilerType(true)); return 0; } @@ -372,7 +372,7 @@ uint32_t SBType::GetNumberOfFields () { if (IsValid()) - return m_opaque_sp->GetClangASTType(true).GetNumFields(); + return m_opaque_sp->GetCompilerType(true).GetNumFields(); return 0; } @@ -399,11 +399,11 @@ SBType::GetDirectBaseClassAtIndex (uint32_t idx) SBTypeMember sb_type_member; if (IsValid()) { - ClangASTType this_type (m_opaque_sp->GetClangASTType (true)); + CompilerType this_type (m_opaque_sp->GetCompilerType (true)); if (this_type.IsValid()) { uint32_t bit_offset = 0; - ClangASTType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(this_type, idx, &bit_offset)); + CompilerType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(this_type, idx, &bit_offset)); if (base_class_type.IsValid()) { sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset)); @@ -420,11 +420,11 @@ SBType::GetVirtualBaseClassAtIndex (uint32_t idx) SBTypeMember sb_type_member; if (IsValid()) { - ClangASTType this_type (m_opaque_sp->GetClangASTType (true)); + CompilerType this_type (m_opaque_sp->GetCompilerType (true)); if (this_type.IsValid()) { uint32_t bit_offset = 0; - ClangASTType base_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(this_type, idx, &bit_offset)); + CompilerType base_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(this_type, idx, &bit_offset)); if (base_class_type.IsValid()) { sb_type_member.reset (new TypeMemberImpl (TypeImplSP(new TypeImpl(base_class_type)), bit_offset)); @@ -440,14 +440,14 @@ SBType::GetEnumMembers () SBTypeEnumMemberList sb_enum_member_list; if (IsValid()) { - const clang::EnumDecl *enum_decl = ClangASTContext::GetAsEnumDecl(m_opaque_sp->GetClangASTType(true).GetFullyUnqualifiedType()); + const clang::EnumDecl *enum_decl = ClangASTContext::GetAsEnumDecl(m_opaque_sp->GetCompilerType(true).GetFullyUnqualifiedType()); if (enum_decl) { clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos; for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos) { SBTypeEnumMember enum_member; - enum_member.reset(new TypeEnumMemberImpl(*enum_pos, ClangASTType(m_opaque_sp->GetTypeSystem(true), enum_decl->getIntegerType().getAsOpaquePtr()))); + enum_member.reset(new TypeEnumMemberImpl(*enum_pos, CompilerType(m_opaque_sp->GetTypeSystem(true), enum_decl->getIntegerType().getAsOpaquePtr()))); sb_enum_member_list.Append(enum_member); } } @@ -461,14 +461,14 @@ SBType::GetFieldAtIndex (uint32_t idx) SBTypeMember sb_type_member; if (IsValid()) { - ClangASTType this_type (m_opaque_sp->GetClangASTType (false)); + CompilerType this_type (m_opaque_sp->GetCompilerType (false)); if (this_type.IsValid()) { uint64_t bit_offset = 0; uint32_t bitfield_bit_size = 0; bool is_bitfield = false; std::string name_sstr; - ClangASTType field_type (this_type.GetFieldAtIndex (idx, + CompilerType field_type (this_type.GetFieldAtIndex (idx, name_sstr, &bit_offset, &bitfield_bit_size, @@ -494,7 +494,7 @@ SBType::IsTypeComplete() { if (!IsValid()) return false; - return m_opaque_sp->GetClangASTType(false).IsCompleteType(); + return m_opaque_sp->GetCompilerType(false).IsCompleteType(); } uint32_t @@ -502,7 +502,7 @@ SBType::GetTypeFlags () { if (!IsValid()) return 0; - return m_opaque_sp->GetClangASTType(true).GetTypeInfo(); + return m_opaque_sp->GetCompilerType(true).GetTypeInfo(); } const char* @@ -525,7 +525,7 @@ lldb::TypeClass SBType::GetTypeClass () { if (IsValid()) - return m_opaque_sp->GetClangASTType(true).GetTypeClass(); + return m_opaque_sp->GetCompilerType(true).GetTypeClass(); return lldb::eTypeClassInvalid; } @@ -533,7 +533,7 @@ uint32_t SBType::GetNumberOfTemplateArguments () { if (IsValid()) - return ClangASTContext::GetNumTemplateArguments(m_opaque_sp->GetClangASTType(false)); + return ClangASTContext::GetNumTemplateArguments(m_opaque_sp->GetCompilerType(false)); return 0; } @@ -543,7 +543,7 @@ SBType::GetTemplateArgumentType (uint32_t idx) if (IsValid()) { TemplateArgumentKind kind = eTemplateArgumentKindNull; - ClangASTType template_arg_type = ClangASTContext::GetTemplateArgument(m_opaque_sp->GetClangASTType(false), idx, kind); + CompilerType template_arg_type = ClangASTContext::GetTemplateArgument(m_opaque_sp->GetCompilerType(false), idx, kind); if (template_arg_type.IsValid()) return SBType(template_arg_type); } @@ -556,7 +556,7 @@ SBType::GetTemplateArgumentKind (uint32_t idx) { TemplateArgumentKind kind = eTemplateArgumentKindNull; if (IsValid()) - ClangASTContext::GetTemplateArgument(m_opaque_sp->GetClangASTType(false), idx, kind); + ClangASTContext::GetTemplateArgument(m_opaque_sp->GetCompilerType(false), idx, kind); return kind; } diff --git a/lldb/source/API/SBTypeEnumMember.cpp b/lldb/source/API/SBTypeEnumMember.cpp index 47c57dd..d9598b7 100644 --- a/lldb/source/API/SBTypeEnumMember.cpp +++ b/lldb/source/API/SBTypeEnumMember.cpp @@ -12,7 +12,7 @@ #include "lldb/API/SBTypeEnumMember.h" #include "lldb/API/SBStream.h" #include "lldb/Core/Stream.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Type.h" using namespace lldb; diff --git a/lldb/source/API/SBTypeNameSpecifier.cpp b/lldb/source/API/SBTypeNameSpecifier.cpp index c587471..6f680109 100644 --- a/lldb/source/API/SBTypeNameSpecifier.cpp +++ b/lldb/source/API/SBTypeNameSpecifier.cpp @@ -34,7 +34,7 @@ SBTypeNameSpecifier::SBTypeNameSpecifier (SBType type) : m_opaque_sp() { if (type.IsValid()) - m_opaque_sp = TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(type.m_opaque_sp->GetClangASTType(true))); + m_opaque_sp = TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(type.m_opaque_sp->GetCompilerType(true))); } SBTypeNameSpecifier::SBTypeNameSpecifier (const lldb::SBTypeNameSpecifier &rhs) : @@ -65,7 +65,7 @@ SBTypeNameSpecifier::GetType () { if (!IsValid()) return SBType(); - lldb_private::ClangASTType c_type = m_opaque_sp->GetClangASTType(); + lldb_private::CompilerType c_type = m_opaque_sp->GetCompilerType(); if (c_type.IsValid()) return SBType(c_type); return SBType(); diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 9b720bd..cd5ba67 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -831,7 +831,7 @@ SBValue::CreateChildAtOffset (const char *name, uint32_t offset, SBType type) TypeImplSP type_sp (type.GetSP()); if (type.IsValid()) { - sb_value.SetSP(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetClangASTType(false), true),GetPreferDynamicValue(),GetPreferSyntheticValue(), name); + sb_value.SetSP(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetCompilerType(false), true),GetPreferDynamicValue(),GetPreferSyntheticValue(), name); } } Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); @@ -856,7 +856,7 @@ SBValue::Cast (SBType type) lldb::ValueObjectSP value_sp(GetSP(locker)); TypeImplSP type_sp (type.GetSP()); if (value_sp && type_sp) - sb_value.SetSP(value_sp->Cast(type_sp->GetClangASTType(false)),GetPreferDynamicValue(),GetPreferSyntheticValue()); + sb_value.SetSP(value_sp->Cast(type_sp->GetCompilerType(false)),GetPreferDynamicValue(),GetPreferSyntheticValue()); return sb_value; } @@ -907,7 +907,7 @@ SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, SBType s lldb::TypeImplSP type_impl_sp (sb_type.GetSP()); if (value_sp && type_impl_sp) { - ClangASTType ast_type(type_impl_sp->GetClangASTType(true)); + CompilerType ast_type(type_impl_sp->GetCompilerType(true)); ExecutionContext exe_ctx (value_sp->GetExecutionContextRef()); new_value_sp = ValueObject::CreateValueObjectFromAddress(name, address, exe_ctx, ast_type); } @@ -936,7 +936,7 @@ SBValue::CreateValueFromData (const char* name, SBData data, SBType type) if (value_sp) { ExecutionContext exe_ctx (value_sp->GetExecutionContextRef()); - new_value_sp = ValueObject::CreateValueObjectFromData(name, **data, exe_ctx, type.GetSP()->GetClangASTType(true)); + new_value_sp = ValueObject::CreateValueObjectFromData(name, **data, exe_ctx, type.GetSP()->GetCompilerType(true)); new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad); } sb_value.SetSP(new_value_sp); @@ -1812,7 +1812,7 @@ SBValue::Watch (bool resolve_location, bool read, bool write, SBError &error) watch_type |= LLDB_WATCH_TYPE_WRITE; Error rc; - ClangASTType type (value_sp->GetClangType()); + CompilerType type (value_sp->GetClangType()); WatchpointSP watchpoint_sp = target_sp->CreateWatchpoint(addr, byte_size, &type, watch_type, rc); error.SetError(rc); diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp index 45559b1..af9cfaf 100644 --- a/lldb/source/Breakpoint/Watchpoint.cpp +++ b/lldb/source/Breakpoint/Watchpoint.cpp @@ -27,7 +27,7 @@ using namespace lldb; using namespace lldb_private; -Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const ClangASTType *type, bool hardware) : +Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const CompilerType *type, bool hardware) : StoppointLocation (0, addr, size, hardware), m_target(target), m_enabled(false), diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index cf32d10..32afc48 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -158,7 +158,7 @@ CommandObjectArgs::DoExecute (Args& args, CommandReturnObject &result) const char *arg_type_cstr = args.GetArgumentAtIndex(arg_index); Value value; value.SetValueType(Value::eValueTypeScalar); - ClangASTType clang_type; + CompilerType clang_type; char *int_pos; if ((int_pos = strstr (const_cast<char*>(arg_type_cstr), "int"))) diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index d8b65e3..8e5145a 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -33,7 +33,7 @@ #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" #include "lldb/Interpreter/OptionGroupVariable.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 832b874..4b3ba11 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -400,7 +400,7 @@ protected: return false; } - ClangASTType clang_ast_type; + CompilerType clang_ast_type; Error error; const char *view_as_type_cstr = m_memory_options.m_view_as_type.GetCurrentValue(); @@ -556,7 +556,7 @@ protected: while (pointer_count > 0) { - ClangASTType pointer_type = clang_ast_type.GetPointerType(); + CompilerType pointer_type = clang_ast_type.GetPointerType(); if (pointer_type.IsValid()) clang_ast_type = pointer_type; else @@ -933,7 +933,7 @@ protected: OptionGroupReadMemory m_prev_memory_options; OptionGroupOutputFile m_prev_outfile_options; OptionGroupValueObjectDisplay m_prev_varobj_options; - ClangASTType m_prev_clang_ast_type; + CompilerType m_prev_clang_ast_type; }; OptionDefinition diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 414e784..c1c02de 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -1048,7 +1048,7 @@ protected: valobj_sp = valobj_list.GetValueObjectAtIndex(0); } - ClangASTType clang_type; + CompilerType clang_type; if (valobj_sp) { @@ -1295,7 +1295,7 @@ protected: // Fetch the type from the value object, the type of the watched object is the pointee type /// of the expression, so convert to that if we found a valid type. - ClangASTType clang_type(valobj_sp->GetClangType()); + CompilerType clang_type(valobj_sp->GetClangType()); Error error; Watchpoint *wp = target->CreateWatchpoint(addr, size, &clang_type, watch_type, error).get(); diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp index a416d07..0b2bb48 100644 --- a/lldb/source/Core/Value.cpp +++ b/lldb/source/Core/Value.cpp @@ -18,7 +18,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/State.h" #include "lldb/Core/Stream.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" @@ -275,7 +275,7 @@ Value::GetValueByteSize (Error *error_ptr) case eContextTypeLLDBType: // Type * case eContextTypeVariable: // Variable * { - const ClangASTType &ast_type = GetClangType(); + const CompilerType &ast_type = GetClangType(); if (ast_type.IsValid()) byte_size = ast_type.GetByteSize(nullptr); } @@ -297,7 +297,7 @@ Value::GetValueByteSize (Error *error_ptr) return byte_size; } -const ClangASTType & +const CompilerType & Value::GetClangType () { if (!m_clang_type.IsValid()) @@ -336,7 +336,7 @@ Value::GetClangType () } void -Value::SetClangType (const ClangASTType &clang_type) +Value::SetClangType (const CompilerType &clang_type) { m_clang_type = clang_type; } @@ -355,7 +355,7 @@ Value::GetValueDefaultFormat () case eContextTypeLLDBType: case eContextTypeVariable: { - const ClangASTType &ast_type = GetClangType(); + const CompilerType &ast_type = GetClangType(); if (ast_type.IsValid()) return ast_type.GetFormat(); } @@ -407,7 +407,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, lldb::addr_t address = LLDB_INVALID_ADDRESS; AddressType address_type = eAddressTypeFile; Address file_so_addr; - const ClangASTType &ast_type = GetClangType(); + const CompilerType &ast_type = GetClangType(); switch (m_value_type) { case eValueTypeVector: @@ -721,7 +721,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, Scalar & Value::ResolveValue(ExecutionContext *exe_ctx) { - const ClangASTType &clang_type = GetClangType(); + const CompilerType &clang_type = GetClangType(); if (clang_type.IsValid()) { switch (m_value_type) diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index ba738bf..3d757bd 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -42,7 +42,7 @@ #include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Type.h" @@ -316,16 +316,16 @@ ValueObject::ClearDynamicTypeInformation () m_children_count_valid = false; m_did_calculate_complete_objc_class_type = false; m_last_format_mgr_revision = 0; - m_override_type = ClangASTType(); + m_override_type = CompilerType(); SetValueFormat(lldb::TypeFormatImplSP()); SetSummaryFormat(lldb::TypeSummaryImplSP()); SetSyntheticChildren(lldb::SyntheticChildrenSP()); } -ClangASTType +CompilerType ValueObject::MaybeCalculateCompleteType () { - ClangASTType clang_type(GetClangTypeImpl()); + CompilerType clang_type(GetClangTypeImpl()); if (m_did_calculate_complete_objc_class_type) { @@ -335,7 +335,7 @@ ValueObject::MaybeCalculateCompleteType () return clang_type; } - ClangASTType class_type; + CompilerType class_type; bool is_pointer_type = false; if (ClangASTContext::IsObjCObjectPointerType(clang_type, &class_type)) @@ -371,7 +371,7 @@ ValueObject::MaybeCalculateCompleteType () if (complete_objc_class_type_sp) { - ClangASTType complete_class(complete_objc_class_type_sp->GetClangFullType()); + CompilerType complete_class(complete_objc_class_type_sp->GetClangFullType()); if (complete_class.GetCompleteType()) { @@ -395,7 +395,7 @@ ValueObject::MaybeCalculateCompleteType () return clang_type; } -ClangASTType +CompilerType ValueObject::GetClangType () { return MaybeCalculateCompleteType(); @@ -830,7 +830,7 @@ ValueObject::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_ bool child_is_deref_of_parent = false; const bool transparent_pointers = synthetic_array_member == false; - ClangASTType child_clang_type; + CompilerType child_clang_type; ExecutionContext exe_ctx (GetExecutionContextRef()); @@ -937,7 +937,7 @@ ValueObject::GetSummaryAsCString (std::string& destination, bool ValueObject::IsCStringContainer(bool check_pointer) { - ClangASTType pointee_or_element_clang_type; + CompilerType pointee_or_element_clang_type; const Flags type_flags (GetTypeInfo (&pointee_or_element_clang_type)); bool is_char_arr_ptr (type_flags.AnySet (eTypeIsArray | eTypeIsPointer) && pointee_or_element_clang_type.IsCharType ()); @@ -958,7 +958,7 @@ ValueObject::GetPointeeData (DataExtractor& data, uint32_t item_idx, uint32_t item_count) { - ClangASTType pointee_or_element_clang_type; + CompilerType pointee_or_element_clang_type; const uint32_t type_info = GetTypeInfo (&pointee_or_element_clang_type); const bool is_pointer_type = type_info & eTypeIsPointer; const bool is_array_type = type_info & eTypeIsArray; @@ -1226,8 +1226,8 @@ ValueObject::ReadPointedString (lldb::DataBufferSP& buffer_sp, size_t bytes_read = 0; size_t total_bytes_read = 0; - ClangASTType clang_type = GetClangType(); - ClangASTType elem_or_pointee_clang_type; + CompilerType clang_type = GetClangType(); + CompilerType elem_or_pointee_clang_type; const Flags type_flags (GetTypeInfo (&elem_or_pointee_clang_type)); if (type_flags.AnySet (eTypeIsArray | eTypeIsPointer) && elem_or_pointee_clang_type.IsCharType ()) @@ -1385,7 +1385,7 @@ ValueObject::GetObjectDescription () if (runtime == NULL) { // Aw, hell, if the things a pointer, or even just an integer, let's try ObjC anyway... - ClangASTType clang_type = GetClangType(); + CompilerType clang_type = GetClangType(); if (clang_type) { bool is_signed; @@ -2023,7 +2023,7 @@ ValueObject::GetSyntheticChild (const ConstString &key) const } uint32_t -ValueObject::GetTypeInfo (ClangASTType *pointee_or_element_clang_type) +ValueObject::GetTypeInfo (CompilerType *pointee_or_element_clang_type) { return GetClangType().GetTypeInfo (pointee_or_element_clang_type); } @@ -2180,7 +2180,7 @@ ValueObject::GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_cre } ValueObjectSP -ValueObject::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create) +ValueObject::GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool can_create) { ValueObjectSP synthetic_child_sp; @@ -2222,7 +2222,7 @@ ValueObject::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type } ValueObjectSP -ValueObject::GetSyntheticBase (uint32_t offset, const ClangASTType& type, bool can_create) +ValueObject::GetSyntheticBase (uint32_t offset, const CompilerType& type, bool can_create) { ValueObjectSP synthetic_child_sp; @@ -2417,7 +2417,7 @@ ValueObject::GetBaseClassPath (Stream &s) if (IsBaseClass()) { bool parent_had_base_class = GetParent() && GetParent()->GetBaseClassPath (s); - ClangASTType clang_type = GetClangType(); + CompilerType clang_type = GetClangType(); std::string cxx_class_name; bool this_had_base_class = ClangASTContext::GetCXXClassName (clang_type, cxx_class_name); if (this_had_base_class) @@ -2536,7 +2536,7 @@ ValueObject::GetExpressionPath (Stream &s, bool qualify_cxx_base_classes, GetExp ValueObject *non_base_class_parent = GetNonBaseClassParent(); if (non_base_class_parent) { - ClangASTType non_base_class_parent_clang_type = non_base_class_parent->GetClangType(); + CompilerType non_base_class_parent_clang_type = non_base_class_parent->GetClangType(); if (non_base_class_parent_clang_type) { if (parent && parent->IsDereferenceOfParent() && epformat == eGetExpressionPathFormatHonorPointers) @@ -2757,8 +2757,8 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr, const char* expression_cstr = *first_unparsed; // hide the top level expression_cstr - ClangASTType root_clang_type = root->GetClangType(); - ClangASTType pointee_clang_type; + CompilerType root_clang_type = root->GetClangType(); + CompilerType pointee_clang_type; Flags pointee_clang_type_info; Flags root_clang_type_info(root_clang_type.GetTypeInfo(&pointee_clang_type)); @@ -3281,8 +3281,8 @@ ValueObject::ExpandArraySliceExpression(const char* expression_cstr, const char* expression_cstr = *first_unparsed; // hide the top level expression_cstr - ClangASTType root_clang_type = root->GetClangType(); - ClangASTType pointee_clang_type; + CompilerType root_clang_type = root->GetClangType(); + CompilerType pointee_clang_type; Flags pointee_clang_type_info; Flags root_clang_type_info(root_clang_type.GetTypeInfo(&pointee_clang_type)); if (pointee_clang_type) @@ -3677,8 +3677,8 @@ ValueObject::GetQualifiedRepresentationIfAvailable (lldb::DynamicValueType dynVa lldb::addr_t ValueObject::GetCPPVTableAddress (AddressType &address_type) { - ClangASTType pointee_type; - ClangASTType this_type(GetClangType()); + CompilerType pointee_type; + CompilerType this_type(GetClangType()); uint32_t type_info = this_type.GetTypeInfo(&pointee_type); if (type_info) { @@ -3726,8 +3726,8 @@ ValueObject::Dereference (Error &error) bool child_is_base_class = false; bool child_is_deref_of_parent = false; const bool transparent_pointers = false; - ClangASTType clang_type = GetClangType(); - ClangASTType child_clang_type; + CompilerType clang_type = GetClangType(); + CompilerType child_clang_type; ExecutionContext exe_ctx (GetExecutionContextRef()); @@ -3806,7 +3806,7 @@ ValueObject::AddressOf (Error &error) case eAddressTypeFile: case eAddressTypeLoad: { - ClangASTType clang_type = GetClangType(); + CompilerType clang_type = GetClangType(); if (clang_type) { std::string name (1, '&'); @@ -3836,13 +3836,13 @@ ValueObject::AddressOf (Error &error) } ValueObjectSP -ValueObject::Cast (const ClangASTType &clang_ast_type) +ValueObject::Cast (const CompilerType &clang_ast_type) { return ValueObjectCast::Create (*this, GetName(), clang_ast_type); } ValueObjectSP -ValueObject::CastPointerType (const char *name, ClangASTType &clang_ast_type) +ValueObject::CastPointerType (const char *name, CompilerType &clang_ast_type) { ValueObjectSP valobj_sp; AddressType address_type; @@ -4104,11 +4104,11 @@ lldb::ValueObjectSP ValueObject::CreateValueObjectFromAddress (const char* name, uint64_t address, const ExecutionContext& exe_ctx, - ClangASTType type) + CompilerType type) { if (type) { - ClangASTType pointer_type(type.GetPointerType()); + CompilerType pointer_type(type.GetPointerType()); if (pointer_type) { lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&address,sizeof(lldb::addr_t))); @@ -4136,7 +4136,7 @@ lldb::ValueObjectSP ValueObject::CreateValueObjectFromData (const char* name, const DataExtractor& data, const ExecutionContext& exe_ctx, - ClangASTType type) + CompilerType type) { lldb::ValueObjectSP new_value_sp; new_value_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(), @@ -4258,7 +4258,7 @@ ValueObject::CanProvideValue () // we need to support invalid types as providers of values because some bare-board // debugging scenarios have no notion of types, but still manage to have raw numeric // values for things like registers. sigh. - const ClangASTType &type(GetClangType()); + const CompilerType &type(GetClangType()); return (false == type.IsValid()) || (0 != (type.GetTypeInfo() & eTypeHasValue)); } diff --git a/lldb/source/Core/ValueObjectCast.cpp b/lldb/source/Core/ValueObjectCast.cpp index b20371b..6b6f67e 100644 --- a/lldb/source/Core/ValueObjectCast.cpp +++ b/lldb/source/Core/ValueObjectCast.cpp @@ -20,7 +20,7 @@ #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" @@ -38,7 +38,7 @@ using namespace lldb_private; lldb::ValueObjectSP ValueObjectCast::Create (ValueObject &parent, const ConstString &name, - const ClangASTType &cast_type) + const CompilerType &cast_type) { ValueObjectCast *cast_valobj_ptr = new ValueObjectCast (parent, name, cast_type); return cast_valobj_ptr->GetSP(); @@ -48,7 +48,7 @@ ValueObjectCast::ValueObjectCast ( ValueObject &parent, const ConstString &name, - const ClangASTType &cast_type + const CompilerType &cast_type ) : ValueObject(parent), m_cast_type (cast_type) @@ -62,7 +62,7 @@ ValueObjectCast::~ValueObjectCast() { } -ClangASTType +CompilerType ValueObjectCast::GetClangTypeImpl () { return m_cast_type; @@ -98,7 +98,7 @@ ValueObjectCast::UpdateValue () Value old_value(m_value); m_update_point.SetUpdated(); m_value = m_parent->GetValue(); - ClangASTType clang_type (GetClangType()); + CompilerType clang_type (GetClangType()); //m_value.SetContext (Value::eContextTypeClangType, clang_type); m_value.SetClangType (clang_type); SetAddressTypeOfChildren(m_parent->GetAddressTypeOfChildren()); diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp index dd7e057..92b0ad4 100644 --- a/lldb/source/Core/ValueObjectChild.cpp +++ b/lldb/source/Core/ValueObjectChild.cpp @@ -12,7 +12,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ValueObjectList.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" @@ -27,7 +27,7 @@ using namespace lldb_private; ValueObjectChild::ValueObjectChild ( ValueObject &parent, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, uint64_t byte_size, int32_t byte_offset, diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp index 7aec5556..3fb1cfb 100644 --- a/lldb/source/Core/ValueObjectConstResult.cpp +++ b/lldb/source/Core/ValueObjectConstResult.cpp @@ -16,7 +16,7 @@ #include "lldb/Core/ValueObjectDynamicValue.h" #include "lldb/Core/ValueObjectList.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" @@ -61,7 +61,7 @@ ValueObjectSP ValueObjectConstResult::Create ( ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, const DataExtractor &data, lldb::addr_t address @@ -75,7 +75,7 @@ ValueObjectConstResult::Create } ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, const DataExtractor &data, lldb::addr_t address) : @@ -103,7 +103,7 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope ValueObjectSP ValueObjectConstResult::Create (ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, const lldb::DataBufferSP &data_sp, lldb::ByteOrder data_byte_order, @@ -129,7 +129,7 @@ ValueObjectConstResult::Create (ExecutionContextScope *exe_scope, } ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, const lldb::DataBufferSP &data_sp, lldb::ByteOrder data_byte_order, @@ -155,7 +155,7 @@ ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope ValueObjectSP ValueObjectConstResult::Create (ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, lldb::addr_t address, AddressType address_type, @@ -170,7 +170,7 @@ ValueObjectConstResult::Create (ExecutionContextScope *exe_scope, } ValueObjectConstResult::ValueObjectConstResult (ExecutionContextScope *exe_scope, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, lldb::addr_t address, AddressType address_type, @@ -241,7 +241,7 @@ ValueObjectConstResult::~ValueObjectConstResult() { } -ClangASTType +CompilerType ValueObjectConstResult::GetClangTypeImpl() { return m_value.GetClangType(); @@ -313,7 +313,7 @@ ValueObjectConstResult::Dereference (Error &error) } lldb::ValueObjectSP -ValueObjectConstResult::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create) +ValueObjectConstResult::GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool can_create) { return m_impl.GetSyntheticChildAtOffset(offset, type, can_create); } @@ -366,7 +366,7 @@ ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic) } lldb::ValueObjectSP -ValueObjectConstResult::Cast (const ClangASTType &clang_ast_type) +ValueObjectConstResult::Cast (const CompilerType &clang_ast_type) { return m_impl.Cast(clang_ast_type); } diff --git a/lldb/source/Core/ValueObjectConstResultCast.cpp b/lldb/source/Core/ValueObjectConstResultCast.cpp index 32123f9..0c61cd1 100644 --- a/lldb/source/Core/ValueObjectConstResultCast.cpp +++ b/lldb/source/Core/ValueObjectConstResultCast.cpp @@ -19,7 +19,7 @@ using namespace lldb_private; ValueObjectConstResultCast::ValueObjectConstResultCast( ValueObject &parent, const ConstString &name, - const ClangASTType &cast_type, + const CompilerType &cast_type, lldb::addr_t live_address) : ValueObjectCast (parent, name, cast_type), m_impl(this, live_address) @@ -39,7 +39,7 @@ ValueObjectConstResultCast::Dereference (Error &error) lldb::ValueObjectSP ValueObjectConstResultCast::GetSyntheticChildAtOffset(uint32_t offset, - const ClangASTType& type, + const CompilerType& type, bool can_create) { return m_impl.GetSyntheticChildAtOffset(offset, type, can_create); @@ -69,7 +69,7 @@ ValueObjectConstResultCast::GetPointeeData (DataExtractor& data, } lldb::ValueObjectSP -ValueObjectConstResultCast::Cast (const ClangASTType &clang_ast_type) +ValueObjectConstResultCast::Cast (const CompilerType &clang_ast_type) { return m_impl.Cast(clang_ast_type); } diff --git a/lldb/source/Core/ValueObjectConstResultChild.cpp b/lldb/source/Core/ValueObjectConstResultChild.cpp index 8bf49e8..ca06cc6 100644 --- a/lldb/source/Core/ValueObjectConstResultChild.cpp +++ b/lldb/source/Core/ValueObjectConstResultChild.cpp @@ -19,7 +19,7 @@ using namespace lldb_private; ValueObjectConstResultChild::ValueObjectConstResultChild ( ValueObject &parent, - const ClangASTType &clang_type, + const CompilerType &clang_type, const ConstString &name, uint32_t byte_size, int32_t byte_offset, @@ -55,7 +55,7 @@ ValueObjectConstResultChild::Dereference (Error &error) } lldb::ValueObjectSP -ValueObjectConstResultChild::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create) +ValueObjectConstResultChild::GetSyntheticChildAtOffset(uint32_t offset, const CompilerType& type, bool can_create) { return m_impl.GetSyntheticChildAtOffset(offset, type, can_create); } @@ -81,7 +81,7 @@ ValueObjectConstResultChild::GetPointeeData (DataExtractor& data, } lldb::ValueObjectSP -ValueObjectConstResultChild::Cast (const ClangASTType &clang_ast_type) +ValueObjectConstResultChild::Cast (const CompilerType &clang_ast_type) { return m_impl.Cast(clang_ast_type); } diff --git a/lldb/source/Core/ValueObjectConstResultImpl.cpp b/lldb/source/Core/ValueObjectConstResultImpl.cpp index 7355063..eb02fe4 100644 --- a/lldb/source/Core/ValueObjectConstResultImpl.cpp +++ b/lldb/source/Core/ValueObjectConstResultImpl.cpp @@ -18,7 +18,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ValueObjectList.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" @@ -71,8 +71,8 @@ ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array bool child_is_deref_of_parent = false; const bool transparent_pointers = synthetic_array_member == false; - ClangASTType clang_type = m_impl_backend->GetClangType(); - ClangASTType child_clang_type; + CompilerType clang_type = m_impl_backend->GetClangType(); + CompilerType child_clang_type; ExecutionContext exe_ctx (m_impl_backend->GetExecutionContextRef()); @@ -114,7 +114,7 @@ ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array } lldb::ValueObjectSP -ValueObjectConstResultImpl::GetSyntheticChildAtOffset (uint32_t offset, const ClangASTType& type, bool can_create) +ValueObjectConstResultImpl::GetSyntheticChildAtOffset (uint32_t offset, const CompilerType& type, bool can_create) { if (m_impl_backend == NULL) return lldb::ValueObjectSP(); @@ -132,7 +132,7 @@ ValueObjectConstResultImpl::AddressOf (Error &error) return lldb::ValueObjectSP(); if (m_live_address != LLDB_INVALID_ADDRESS) { - ClangASTType clang_type(m_impl_backend->GetClangType()); + CompilerType clang_type(m_impl_backend->GetClangType()); lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&m_live_address,sizeof(lldb::addr_t))); @@ -156,7 +156,7 @@ ValueObjectConstResultImpl::AddressOf (Error &error) } lldb::ValueObjectSP -ValueObjectConstResultImpl::Cast (const ClangASTType &clang_ast_type) +ValueObjectConstResultImpl::Cast (const CompilerType &clang_ast_type) { if (m_impl_backend == NULL) return lldb::ValueObjectSP(); diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index 9eaa6c3..80c16c8 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -20,7 +20,7 @@ #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" @@ -49,7 +49,7 @@ ValueObjectDynamicValue::~ValueObjectDynamicValue() m_owning_valobj_sp.reset(); } -ClangASTType +CompilerType ValueObjectDynamicValue::GetClangTypeImpl () { const bool success = UpdateValueIfNeeded(false); @@ -149,13 +149,13 @@ FixupTypeAndOrName (const TypeAndOrName& type_andor_name, // The type will always be the type of the dynamic object. If our parent's type was a pointer, // then our type should be a pointer to the type of the dynamic object. If a reference, then the original type // should be okay... - ClangASTType orig_type = type_andor_name.GetClangASTType(); - ClangASTType corrected_type = orig_type; + CompilerType orig_type = type_andor_name.GetCompilerType(); + CompilerType corrected_type = orig_type; if (parent.IsPointerType()) corrected_type = orig_type.GetPointerType (); else if (parent.IsPointerOrReferenceType()) corrected_type = ClangASTContext::GetLValueReferenceType(orig_type); - ret.SetClangASTType(corrected_type); + ret.SetCompilerType(corrected_type); } else /*if (m_dynamic_type_info.HasName())*/ { @@ -166,7 +166,7 @@ FixupTypeAndOrName (const TypeAndOrName& type_andor_name, else if (parent.IsPointerOrReferenceType()) corrected_name.append(" &"); // the parent type should be a correctly pointer'ed or referenc'ed type - ret.SetClangASTType(parent.GetClangType()); + ret.SetCompilerType(parent.GetClangType()); ret.SetName(corrected_name.c_str()); } return ret; @@ -241,7 +241,7 @@ ValueObjectDynamicValue::UpdateValue () { if (class_type_or_name.HasType()) { - m_type_impl = TypeImpl(m_parent->GetClangType(),FixupTypeAndOrName(class_type_or_name, *m_parent).GetClangASTType()); + m_type_impl = TypeImpl(m_parent->GetClangType(),FixupTypeAndOrName(class_type_or_name, *m_parent).GetCompilerType()); } else { @@ -303,7 +303,7 @@ ValueObjectDynamicValue::UpdateValue () m_dynamic_type_info = FixupTypeAndOrName(m_dynamic_type_info, *m_parent); //m_value.SetContext (Value::eContextTypeClangType, corrected_type); - m_value.SetClangType (m_dynamic_type_info.GetClangASTType()); + m_value.SetClangType (m_dynamic_type_info.GetCompilerType()); // Our address is the location of the dynamic type stored in memory. It isn't a load address, // because we aren't pointing to the LOCATION that stores the pointer to us, we're pointing to us... diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp index 31a8d5c..8ad0d34 100644 --- a/lldb/source/Core/ValueObjectMemory.cpp +++ b/lldb/source/Core/ValueObjectMemory.cpp @@ -46,7 +46,7 @@ ValueObjectSP ValueObjectMemory::Create (ExecutionContextScope *exe_scope, const char *name, const Address &address, - const ClangASTType &ast_type) + const CompilerType &ast_type) { return (new ValueObjectMemory (exe_scope, name, address, ast_type))->GetSP(); } @@ -90,7 +90,7 @@ ValueObjectMemory::ValueObjectMemory (ExecutionContextScope *exe_scope, ValueObjectMemory::ValueObjectMemory (ExecutionContextScope *exe_scope, const char *name, const Address &address, - const ClangASTType &ast_type) : + const CompilerType &ast_type) : ValueObject(exe_scope), m_address (address), m_type_sp(), @@ -131,7 +131,7 @@ ValueObjectMemory::~ValueObjectMemory() { } -ClangASTType +CompilerType ValueObjectMemory::GetClangTypeImpl () { if (m_type_sp) diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index 0db1f0c..4f9e0f0 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -15,7 +15,7 @@ // Other libraries and framework includes // Project includes #include "lldb/Core/Module.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/TypeList.h" #include "lldb/Target/ExecutionContext.h" @@ -42,10 +42,10 @@ ValueObjectRegisterContext::~ValueObjectRegisterContext() { } -ClangASTType +CompilerType ValueObjectRegisterContext::GetClangTypeImpl () { - return ClangASTType(); + return CompilerType(); } ConstString @@ -144,10 +144,10 @@ ValueObjectRegisterSet::~ValueObjectRegisterSet() { } -ClangASTType +CompilerType ValueObjectRegisterSet::GetClangTypeImpl () { - return ClangASTType(); + return CompilerType(); } ConstString @@ -307,7 +307,7 @@ ValueObjectRegister::~ValueObjectRegister() { } -ClangASTType +CompilerType ValueObjectRegister::GetClangTypeImpl () { if (!m_clang_type.IsValid()) diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp index 867b520..2a20ae3 100644 --- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp +++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp @@ -82,7 +82,7 @@ ValueObjectSynthetic::~ValueObjectSynthetic() { } -ClangASTType +CompilerType ValueObjectSynthetic::GetClangTypeImpl () { return m_parent->GetClangType(); diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp index c86bece..3cca6c0 100644 --- a/lldb/source/Core/ValueObjectVariable.cpp +++ b/lldb/source/Core/ValueObjectVariable.cpp @@ -54,13 +54,13 @@ ValueObjectVariable::~ValueObjectVariable() { } -ClangASTType +CompilerType ValueObjectVariable::GetClangTypeImpl () { Type *var_type = m_variable_sp->GetType(); if (var_type) return var_type->GetClangForwardType(); - return ClangASTType(); + return CompilerType(); } ConstString @@ -93,7 +93,7 @@ ValueObjectVariable::GetQualifiedTypeName() size_t ValueObjectVariable::CalculateNumChildren() { - ClangASTType type(GetClangType()); + CompilerType type(GetClangType()); if (!type.IsValid()) return 0; @@ -107,7 +107,7 @@ ValueObjectVariable::GetByteSize() { ExecutionContext exe_ctx(GetExecutionContextRef()); - ClangASTType type(GetClangType()); + CompilerType type(GetClangType()); if (!type.IsValid()) return 0; @@ -168,7 +168,7 @@ ValueObjectVariable::UpdateValue () m_resolved_value = m_value; m_value.SetContext(Value::eContextTypeVariable, variable); - ClangASTType clang_type = GetClangType(); + CompilerType clang_type = GetClangType(); if (clang_type.IsValid()) m_value.SetClangType(clang_type); diff --git a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp index 73da5ce..73ff5e9 100644 --- a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp +++ b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp @@ -318,7 +318,7 @@ lldb_private::formatters::WCharStringSummaryProvider (ValueObject& valobj, Strea if (!ast) return false; - ClangASTType wchar_clang_type = ClangASTContext::GetBasicType(ast, lldb::eBasicTypeWChar); + CompilerType wchar_clang_type = ClangASTContext::GetBasicType(ast, lldb::eBasicTypeWChar); const uint32_t wchar_size = wchar_clang_type.GetBitSize(nullptr); // Safe to pass NULL for exe_scope here ReadStringAndDumpToStreamOptions options(valobj); @@ -772,7 +772,7 @@ lldb_private::formatters::NSTaggedString_SummaryProvider (ObjCLanguageRuntime::C return true; } -static ClangASTType +static CompilerType GetNSPathStore2Type (Target &target) { static ConstString g_type_name("__lldb_autogen_nspathstore2"); @@ -780,10 +780,10 @@ GetNSPathStore2Type (Target &target) ClangASTContext *ast_ctx = target.GetScratchClangASTContext(); if (!ast_ctx) - return ClangASTType(); + return CompilerType(); - ClangASTType voidstar = ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType(); - ClangASTType uint32 = ast_ctx->GetIntTypeFromBitSize(32, false); + CompilerType voidstar = ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType(); + CompilerType uint32 = ast_ctx->GetIntTypeFromBitSize(32, false); return ast_ctx->GetOrCreateStructForIdentifier(g_type_name, { {"isa",voidstar}, @@ -1034,7 +1034,7 @@ lldb_private::formatters::NSAttributedStringSummaryProvider (ValueObject& valobj if (!pointer_value) return false; pointer_value += addr_size; - ClangASTType type(valobj.GetClangType()); + CompilerType type(valobj.GetClangType()); ExecutionContext exe_ctx(target_sp,false); ValueObjectSP child_ptr_sp(valobj.CreateValueObjectFromAddress("string_ptr", pointer_value, exe_ctx, type)); if (!child_ptr_sp) @@ -1100,7 +1100,7 @@ lldb_private::formatters::ObjCSELSummaryProvider (ValueObject& valobj, Stream& s { lldb::ValueObjectSP valobj_sp; - ClangASTType charstar (valobj.GetClangType().GetBasicTypeFromAST(eBasicTypeChar).GetPointerType()); + CompilerType charstar (valobj.GetClangType().GetBasicTypeFromAST(eBasicTypeChar).GetPointerType()); if (!charstar) return false; diff --git a/lldb/source/DataFormatters/Cocoa.cpp b/lldb/source/DataFormatters/Cocoa.cpp index 28f3d4f..11a9553 100644 --- a/lldb/source/DataFormatters/Cocoa.cpp +++ b/lldb/source/DataFormatters/Cocoa.cpp @@ -443,7 +443,7 @@ lldb_private::formatters::NSURLSummaryProvider (ValueObject& valobj, Stream& str { uint64_t offset_text = ptr_size + ptr_size + 8; // ISA + pointer + 8 bytes of data (even on 32bit) uint64_t offset_base = offset_text + ptr_size; - ClangASTType type(valobj.GetClangType()); + CompilerType type(valobj.GetClangType()); ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset_text, type, true)); ValueObjectSP base(valobj.GetSyntheticChildAtOffset(offset_base, type, true)); if (!text) diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 7e9f9b4..ffac7722 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -162,7 +162,7 @@ FormatManager::GetFormatAsCString (Format format) void FormatManager::GetPossibleMatches (ValueObject& valobj, - ClangASTType clang_type, + CompilerType clang_type, uint32_t reason, lldb::DynamicValueType use_dynamic, FormattersMatchVector& entries, @@ -189,7 +189,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, for (bool is_rvalue_ref = true, j = true; j && clang_type.IsReferenceType(nullptr, &is_rvalue_ref); j = false) { - ClangASTType non_ref_type = clang_type.GetNonReferenceType(); + CompilerType non_ref_type = clang_type.GetNonReferenceType(); GetPossibleMatches(valobj, non_ref_type, reason | lldb_private::eFormatterChoiceCriterionStrippedPointerReference, @@ -200,7 +200,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, did_strip_typedef); if (non_ref_type.IsTypedefType()) { - ClangASTType deffed_referenced_type = non_ref_type.GetTypedefedType(); + CompilerType deffed_referenced_type = non_ref_type.GetTypedefedType(); deffed_referenced_type = is_rvalue_ref ? ClangASTContext::GetRValueReferenceType(deffed_referenced_type) : ClangASTContext::GetLValueReferenceType(deffed_referenced_type); GetPossibleMatches(valobj, deffed_referenced_type, @@ -215,7 +215,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, if (clang_type.IsPointerType()) { - ClangASTType non_ptr_type = clang_type.GetPointeeType(); + CompilerType non_ptr_type = clang_type.GetPointeeType(); GetPossibleMatches(valobj, non_ptr_type, reason | lldb_private::eFormatterChoiceCriterionStrippedPointerReference, @@ -226,7 +226,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, did_strip_typedef); if (non_ptr_type.IsTypedefType()) { - ClangASTType deffed_pointed_type = non_ptr_type.GetTypedefedType().GetPointerType(); + CompilerType deffed_pointed_type = non_ptr_type.GetTypedefedType().GetPointerType(); GetPossibleMatches(valobj, deffed_pointed_type, reason | lldb_private::eFormatterChoiceCriterionNavigatedTypedefs, @@ -261,7 +261,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, } while (false); } - ClangASTType non_ptr_type = clang_type.GetPointeeType(); + CompilerType non_ptr_type = clang_type.GetPointeeType(); GetPossibleMatches(valobj, non_ptr_type, reason | lldb_private::eFormatterChoiceCriterionStrippedPointerReference, @@ -275,7 +275,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, // try to strip typedef chains if (clang_type.IsTypedefType()) { - ClangASTType deffed_type = clang_type.GetTypedefedType(); + CompilerType deffed_type = clang_type.GetTypedefedType(); GetPossibleMatches(valobj, deffed_type, reason | lldb_private::eFormatterChoiceCriterionNavigatedTypedefs, @@ -292,7 +292,7 @@ FormatManager::GetPossibleMatches (ValueObject& valobj, if (!clang_type.IsValid()) break; - ClangASTType unqual_clang_ast_type = clang_type.GetFullyUnqualifiedType(); + CompilerType unqual_clang_ast_type = clang_type.GetFullyUnqualifiedType(); if (!unqual_clang_ast_type.IsValid()) break; if (unqual_clang_ast_type.GetOpaqueQualType() != clang_type.GetOpaqueQualType()) diff --git a/lldb/source/DataFormatters/LibCxxInitializerList.cpp b/lldb/source/DataFormatters/LibCxxInitializerList.cpp index 1f79f00..9faa5865 100644 --- a/lldb/source/DataFormatters/LibCxxInitializerList.cpp +++ b/lldb/source/DataFormatters/LibCxxInitializerList.cpp @@ -42,7 +42,7 @@ namespace lldb_private { ~LibcxxInitializerListSyntheticFrontEnd (); private: ValueObject* m_start; - ClangASTType m_element_type; + CompilerType m_element_type; uint32_t m_element_size; size_t m_num_elements; std::map<size_t,lldb::ValueObjectSP> m_children; diff --git a/lldb/source/DataFormatters/LibCxxList.cpp b/lldb/source/DataFormatters/LibCxxList.cpp index 0430a8f..0771f6e 100644 --- a/lldb/source/DataFormatters/LibCxxList.cpp +++ b/lldb/source/DataFormatters/LibCxxList.cpp @@ -57,7 +57,7 @@ namespace lldb_private { lldb::addr_t m_node_address; ValueObject* m_head; ValueObject* m_tail; - ClangASTType m_element_type; + CompilerType m_element_type; size_t m_count; std::map<size_t,lldb::ValueObjectSP> m_children; }; @@ -332,7 +332,7 @@ lldb_private::formatters::LibcxxStdListSyntheticFrontEnd::Update() ValueObjectSP impl_sp(m_backend.GetChildMemberWithName(ConstString("__end_"),true)); if (!impl_sp) return false; - ClangASTType list_type = m_backend.GetClangType(); + CompilerType list_type = m_backend.GetClangType(); if (list_type.IsReferenceType()) list_type = list_type.GetNonReferenceType(); diff --git a/lldb/source/DataFormatters/LibCxxMap.cpp b/lldb/source/DataFormatters/LibCxxMap.cpp index 2782a3b0..8682e88 100644 --- a/lldb/source/DataFormatters/LibCxxMap.cpp +++ b/lldb/source/DataFormatters/LibCxxMap.cpp @@ -56,7 +56,7 @@ namespace lldb_private { ValueObject* m_tree; ValueObject* m_root_node; - ClangASTType m_element_type; + CompilerType m_element_type; uint32_t m_skip_size; size_t m_count; std::map<size_t,lldb::ValueObjectSP> m_children; @@ -301,7 +301,7 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset (const l return; if (!node) return; - ClangASTType node_type(node->GetClangType()); + CompilerType node_type(node->GetClangType()); uint64_t bit_offset; if (node_type.GetIndexOfFieldWithName("__value_", NULL, &bit_offset) == UINT32_MAX) return; diff --git a/lldb/source/DataFormatters/LibCxxVector.cpp b/lldb/source/DataFormatters/LibCxxVector.cpp index 6ccb732..2461bf6 100644 --- a/lldb/source/DataFormatters/LibCxxVector.cpp +++ b/lldb/source/DataFormatters/LibCxxVector.cpp @@ -43,7 +43,7 @@ namespace lldb_private { private: ValueObject* m_start; ValueObject* m_finish; - ClangASTType m_element_type; + CompilerType m_element_type; uint32_t m_element_size; std::map<size_t,lldb::ValueObjectSP> m_children; }; diff --git a/lldb/source/DataFormatters/LibStdcpp.cpp b/lldb/source/DataFormatters/LibStdcpp.cpp index 16ee2c1..6dfebd2 100644 --- a/lldb/source/DataFormatters/LibStdcpp.cpp +++ b/lldb/source/DataFormatters/LibStdcpp.cpp @@ -78,11 +78,11 @@ lldb_private::formatters::LibstdcppMapIteratorSyntheticFrontEnd::Update() m_pair_address += (is_64bit ? 32 : 16); - ClangASTType my_type(valobj_sp->GetClangType()); + CompilerType my_type(valobj_sp->GetClangType()); if (ClangASTContext::GetNumTemplateArguments(my_type) >= 1) { TemplateArgumentKind kind; - ClangASTType pair_type = ClangASTContext::GetTemplateArgument(my_type, 0, kind); + CompilerType pair_type = ClangASTContext::GetTemplateArgument(my_type, 0, kind); if (kind != eTemplateArgumentKindType && kind != eTemplateArgumentKindTemplate && kind != eTemplateArgumentKindTemplateExpansion) return false; m_pair_type = pair_type; diff --git a/lldb/source/DataFormatters/NSArray.cpp b/lldb/source/DataFormatters/NSArray.cpp index 0e665bd..a28a00c 100644 --- a/lldb/source/DataFormatters/NSArray.cpp +++ b/lldb/source/DataFormatters/NSArray.cpp @@ -66,7 +66,7 @@ namespace lldb_private { ExecutionContextRef m_exe_ctx_ref; uint8_t m_ptr_size; - ClangASTType m_id_type; + CompilerType m_id_type; std::vector<lldb::ValueObjectSP> m_children; }; @@ -195,7 +195,7 @@ namespace lldb_private { uint8_t m_ptr_size; uint64_t m_items; lldb::addr_t m_data_ptr; - ClangASTType m_id_type; + CompilerType m_id_type; std::vector<lldb::ValueObjectSP> m_children; }; @@ -300,7 +300,7 @@ m_children() { clang::ASTContext *ast = valobj_sp->GetExecutionContextRef().GetTargetSP()->GetScratchClangASTContext()->getASTContext(); if (ast) - m_id_type = ClangASTType(ast, ast->ObjCBuiltinIdTy); + m_id_type = CompilerType(ast, ast->ObjCBuiltinIdTy); if (valobj_sp->GetProcessSP()) m_ptr_size = valobj_sp->GetProcessSP()->GetAddressByteSize(); } @@ -532,7 +532,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::NSArrayISyntheticFrontEnd ( { ClangASTContext *ast = valobj_sp->GetClangType().GetTypeSystem()->AsClangASTContext(); if (ast) - m_id_type = ClangASTType(ast->getASTContext(), ast->getASTContext()->ObjCBuiltinIdTy); + m_id_type = CompilerType(ast->getASTContext(), ast->getASTContext()->ObjCBuiltinIdTy); } } @@ -622,7 +622,7 @@ SyntheticChildrenFrontEnd* lldb_private::formatters::NSArraySyntheticFrontEndCre if (!runtime) return NULL; - ClangASTType valobj_type(valobj_sp->GetClangType()); + CompilerType valobj_type(valobj_sp->GetClangType()); Flags flags(valobj_type.GetTypeInfo()); if (flags.IsClear(eTypeIsPointer)) diff --git a/lldb/source/DataFormatters/NSDictionary.cpp b/lldb/source/DataFormatters/NSDictionary.cpp index 30e9d34..15f05ab 100644 --- a/lldb/source/DataFormatters/NSDictionary.cpp +++ b/lldb/source/DataFormatters/NSDictionary.cpp @@ -25,10 +25,10 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; -static ClangASTType +static CompilerType GetLLDBNSPairType (TargetSP target_sp) { - ClangASTType clang_type; + CompilerType clang_type; ClangASTContext *target_ast_context = target_sp->GetScratchClangASTContext(); @@ -45,7 +45,7 @@ GetLLDBNSPairType (TargetSP target_sp) if (clang_type) { ClangASTContext::StartTagDeclarationDefinition(clang_type); - ClangASTType id_clang_type = target_ast_context->GetBasicType (eBasicTypeObjCID); + CompilerType id_clang_type = target_ast_context->GetBasicType (eBasicTypeObjCID); ClangASTContext::AddFieldToRecordType(clang_type, "key", id_clang_type, lldb::eAccessPublic, 0); ClangASTContext::AddFieldToRecordType(clang_type, "value", id_clang_type, lldb::eAccessPublic, 0); ClangASTContext::CompleteTagDeclarationDefinition(clang_type); @@ -105,7 +105,7 @@ namespace lldb_private { DataDescriptor_32 *m_data_32; DataDescriptor_64 *m_data_64; lldb::addr_t m_data_ptr; - ClangASTType m_pair_type; + CompilerType m_pair_type; std::vector<DictionaryItemDescriptor> m_children; }; @@ -162,7 +162,7 @@ namespace lldb_private { lldb::ByteOrder m_order; DataDescriptor_32 *m_data_32; DataDescriptor_64 *m_data_64; - ClangASTType m_pair_type; + CompilerType m_pair_type; std::vector<DictionaryItemDescriptor> m_children; }; diff --git a/lldb/source/DataFormatters/NSIndexPath.cpp b/lldb/source/DataFormatters/NSIndexPath.cpp index 4d6f2c5..60768b1 100644 --- a/lldb/source/DataFormatters/NSIndexPath.cpp +++ b/lldb/source/DataFormatters/NSIndexPath.cpp @@ -179,7 +179,7 @@ protected: } lldb::ValueObjectSP - GetIndexAtIndex (size_t idx, const ClangASTType& desired_type) + GetIndexAtIndex (size_t idx, const CompilerType& desired_type) { if (idx >= GetNumIndexes()) return nullptr; @@ -209,7 +209,7 @@ protected: } lldb::ValueObjectSP - GetIndexAtIndex (size_t idx, const ClangASTType& desired_type) + GetIndexAtIndex (size_t idx, const CompilerType& desired_type) { std::pair<uint64_t, bool> value(_indexAtPositionForInlinePayload(idx)); if (!value.second) @@ -325,7 +325,7 @@ protected: uint32_t m_ptr_size; ClangASTContext* m_ast_ctx; - ClangASTType m_uint_star_type; + CompilerType m_uint_star_type; }; namespace lldb_private { diff --git a/lldb/source/DataFormatters/TypeFormat.cpp b/lldb/source/DataFormatters/TypeFormat.cpp index c4a65fe..095559f 100644 --- a/lldb/source/DataFormatters/TypeFormat.cpp +++ b/lldb/source/DataFormatters/TypeFormat.cpp @@ -23,7 +23,7 @@ #include "lldb/DataFormatters/FormatManager.h" #include "lldb/DataFormatters/TypeFormat.h" #include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/TypeList.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" @@ -91,7 +91,7 @@ TypeFormatImpl_Format::FormatObject (ValueObject *valobj, } else { - ClangASTType clang_type = value.GetClangType (); + CompilerType clang_type = value.GetClangType (); if (clang_type) { // put custom bytes to display in the DataExtractor to override the default value logic @@ -134,7 +134,7 @@ TypeFormatImpl_Format::FormatObject (ValueObject *valobj, // for a formatting error (or else we wouldn't be able to reformat // until a next update), an empty string is treated as a "false" // return from here, but that's about as severe as we get - // ClangASTType::DumpTypeValue() should always return + // CompilerType::DumpTypeValue() should always return // something, even if that something is an error message if (sstr.GetString().empty()) dest.clear(); @@ -192,7 +192,7 @@ TypeFormatImpl_EnumType::FormatObject (ValueObject *valobj, return false; auto iter = m_types.find(valobj_key), end = m_types.end(); - ClangASTType valobj_enum_type; + CompilerType valobj_enum_type; if (iter == end) { // probably a redundant check diff --git a/lldb/source/DataFormatters/TypeSummary.cpp b/lldb/source/DataFormatters/TypeSummary.cpp index fa06f29..fefaa2d 100644 --- a/lldb/source/DataFormatters/TypeSummary.cpp +++ b/lldb/source/DataFormatters/TypeSummary.cpp @@ -23,7 +23,7 @@ #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/ValueObjectPrinter.h" #include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" diff --git a/lldb/source/DataFormatters/TypeSynthetic.cpp b/lldb/source/DataFormatters/TypeSynthetic.cpp index 5bd8d30..036f6f6 100644 --- a/lldb/source/DataFormatters/TypeSynthetic.cpp +++ b/lldb/source/DataFormatters/TypeSynthetic.cpp @@ -22,7 +22,7 @@ #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/ScriptInterpreter.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Target.h" @@ -136,7 +136,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromAddress (const char* name, uint64_t address, const ExecutionContext& exe_ctx, - ClangASTType type) + CompilerType type) { ValueObjectSP valobj_sp(ValueObject::CreateValueObjectFromAddress(name, address, exe_ctx, type)); if (valobj_sp) @@ -148,7 +148,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData (const char* name, const DataExtractor& data, const ExecutionContext& exe_ctx, - ClangASTType type) + CompilerType type) { ValueObjectSP valobj_sp(ValueObject::CreateValueObjectFromData(name, data, exe_ctx, type)); if (valobj_sp) diff --git a/lldb/source/DataFormatters/VectorType.cpp b/lldb/source/DataFormatters/VectorType.cpp index 666e68c..408d2ad 100644 --- a/lldb/source/DataFormatters/VectorType.cpp +++ b/lldb/source/DataFormatters/VectorType.cpp @@ -12,7 +12,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/CXXFormatterFunctions.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Utility/LLDBAssert.h" @@ -20,9 +20,9 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; -static ClangASTType +static CompilerType GetClangTypeForFormat (lldb::Format format, - ClangASTType element_type, + CompilerType element_type, ClangASTContext *ast_ctx) { lldbassert(ast_ctx && "ast_ctx needs to be not NULL"); @@ -119,7 +119,7 @@ GetClangTypeForFormat (lldb::Format format, static lldb::Format GetItemFormatForFormat (lldb::Format format, - ClangASTType element_type) + CompilerType element_type) { switch (format) { @@ -169,8 +169,8 @@ GetItemFormatForFormat (lldb::Format format, } static size_t -CalculateNumChildren (ClangASTType container_type, - ClangASTType element_type, +CalculateNumChildren (CompilerType container_type, + CompilerType element_type, lldb_private::ExecutionContextScope *exe_scope = nullptr // does not matter here because all we trade in are basic types ) { @@ -229,8 +229,8 @@ namespace lldb_private { Update() { m_parent_format = m_backend.GetFormat(); - ClangASTType parent_type(m_backend.GetClangType()); - ClangASTType element_type; + CompilerType parent_type(m_backend.GetClangType()); + CompilerType element_type; parent_type.IsVectorType(&element_type, nullptr); m_child_type = ::GetClangTypeForFormat(m_parent_format, element_type, parent_type.GetTypeSystem()->AsClangASTContext()); m_num_children = ::CalculateNumChildren(parent_type, @@ -262,7 +262,7 @@ namespace lldb_private { private: lldb::Format m_parent_format; lldb::Format m_item_format; - ClangASTType m_child_type; + CompilerType m_child_type; size_t m_num_children; }; } diff --git a/lldb/source/Expression/ASTDumper.cpp b/lldb/source/Expression/ASTDumper.cpp index 80faeb3..2034b4f 100644 --- a/lldb/source/Expression/ASTDumper.cpp +++ b/lldb/source/Expression/ASTDumper.cpp @@ -10,7 +10,7 @@ #include "lldb/Core/Log.h" #include "lldb/Expression/ASTDumper.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "llvm/Support/raw_ostream.h" @@ -80,7 +80,7 @@ ASTDumper::ASTDumper (lldb::clang_type_t type) m_dump = clang::QualType::getFromOpaquePtr(type).getAsString(); } -ASTDumper::ASTDumper (const ClangASTType &clang_type) +ASTDumper::ASTDumper (const CompilerType &clang_type) { m_dump = ClangASTContext::GetQualType(clang_type).getAsString(); } diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 4632d4f..fb1dcb1 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -272,7 +272,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!type) continue; - ClangASTType clang_type (type->GetClangFullType()); + CompilerType clang_type (type->GetClangFullType()); if (!clang_type) continue; @@ -311,7 +311,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!type) continue; - ClangASTType clang_type (type->GetClangFullType()); + CompilerType clang_type (type->GetClangFullType()); if (!clang_type) continue; @@ -761,9 +761,9 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context, (name_string ? name_string : "<anonymous>")); } - ClangASTType full_type = type_sp->GetClangFullType(); + CompilerType full_type = type_sp->GetClangFullType(); - ClangASTType copied_clang_type (GuardedCopyType(full_type)); + CompilerType copied_clang_type (GuardedCopyType(full_type)); if (!copied_clang_type) { @@ -1876,14 +1876,14 @@ ClangASTSource::AddNamespace (NameSearchContext &context, ClangASTImporter::Name return dyn_cast<NamespaceDecl>(copied_decl); } -ClangASTType -ClangASTSource::GuardedCopyType (const ClangASTType &src_type) +CompilerType +ClangASTSource::GuardedCopyType (const CompilerType &src_type) { ClangASTMetrics::RegisterLLDBImport(); ClangASTContext* src_ast = src_type.GetTypeSystem()->AsClangASTContext(); if (!src_ast) - return ClangASTType(); + return CompilerType(); SetImportInProgress(true); @@ -1894,13 +1894,13 @@ ClangASTSource::GuardedCopyType (const ClangASTType &src_type) if (copied_qual_type.getAsOpaquePtr() && copied_qual_type->getCanonicalTypeInternal().isNull()) // this shouldn't happen, but we're hardening because the AST importer seems to be generating bad types // on occasion. - return ClangASTType(); + return CompilerType(); - return ClangASTType(m_ast_context, copied_qual_type); + return CompilerType(m_ast_context, copied_qual_type); } clang::NamedDecl * -NameSearchContext::AddVarDecl(const ClangASTType &type) +NameSearchContext::AddVarDecl(const CompilerType &type) { assert (type && "Type for variable must be valid!"); @@ -1929,7 +1929,7 @@ NameSearchContext::AddVarDecl(const ClangASTType &type) } clang::NamedDecl * -NameSearchContext::AddFunDecl (const ClangASTType &type, bool extern_c) +NameSearchContext::AddFunDecl (const CompilerType &type, bool extern_c) { assert (type && "Type for variable must be valid!"); @@ -2030,11 +2030,11 @@ NameSearchContext::AddGenericFunDecl() ArrayRef<QualType>(), // argument types proto_info)); - return AddFunDecl(ClangASTType (m_ast_source.m_ast_context, generic_function_type), true); + return AddFunDecl(CompilerType (m_ast_source.m_ast_context, generic_function_type), true); } clang::NamedDecl * -NameSearchContext::AddTypeDecl(const ClangASTType &clang_type) +NameSearchContext::AddTypeDecl(const CompilerType &clang_type) { if (clang_type) { diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index b719e06..d2c4f02 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1103,7 +1103,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, if (!this_type) return; - ClangASTType pointee_type = this_type->GetClangForwardType().GetPointeeType(); + CompilerType pointee_type = this_type->GetClangForwardType().GetPointeeType(); if (pointee_type.IsValid()) { @@ -1220,7 +1220,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, if (!self_type) return; - ClangASTType self_clang_type = self_type->GetClangFullType(); + CompilerType self_clang_type = self_type->GetClangFullType(); if (ClangASTContext::IsObjCClassType(self_clang_type)) { @@ -1632,7 +1632,7 @@ ClangExpressionDeclMap::GetVariableValue (VariableSP &var, return false; } - ClangASTType var_clang_type = var_type->GetClangFullType(); + CompilerType var_clang_type = var_type->GetClangFullType(); if (!var_clang_type) { @@ -1673,7 +1673,7 @@ ClangExpressionDeclMap::GetVariableValue (VariableSP &var, } } - ClangASTType type_to_use = GuardedCopyType(var_clang_type); + CompilerType type_to_use = GuardedCopyType(var_clang_type); if (!type_to_use) { @@ -1930,7 +1930,7 @@ ClangExpressionDeclMap::AddOneRegister (NameSearchContext &context, { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - ClangASTType clang_type = ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (m_ast_context, + CompilerType clang_type = ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (m_ast_context, reg_info->encoding, reg_info->byte_size * 8); @@ -1980,7 +1980,7 @@ ClangExpressionDeclMap::AddOneFunction (NameSearchContext &context, NamedDecl *function_decl = NULL; Address fun_address; - ClangASTType function_clang_type; + CompilerType function_clang_type; bool is_indirect_function = false; @@ -2006,7 +2006,7 @@ ClangExpressionDeclMap::AddOneFunction (NameSearchContext &context, fun_address = function->GetAddressRange().GetBaseAddress(); - ClangASTType copied_function_type = GuardedCopyType(function_clang_type); + CompilerType copied_function_type = GuardedCopyType(function_clang_type); if (copied_function_type) { function_decl = context.AddFunDecl(copied_function_type); @@ -2105,7 +2105,7 @@ TypeFromParser ClangExpressionDeclMap::CopyClassType(TypeFromUser &ut, unsigned int current_id) { - ClangASTType copied_clang_type = GuardedCopyType(ut); + CompilerType copied_clang_type = GuardedCopyType(ut); if (!copied_clang_type) { @@ -2119,10 +2119,10 @@ ClangExpressionDeclMap::CopyClassType(TypeFromUser &ut, if (copied_clang_type.IsAggregateType() && copied_clang_type.GetCompleteType ()) { - ClangASTType void_clang_type = ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid); - ClangASTType void_ptr_clang_type = void_clang_type.GetPointerType(); + CompilerType void_clang_type = ClangASTContext::GetBasicType(m_ast_context, eBasicTypeVoid); + CompilerType void_ptr_clang_type = void_clang_type.GetPointerType(); - ClangASTType method_type = ClangASTContext::CreateFunctionType (m_ast_context, + CompilerType method_type = ClangASTContext::CreateFunctionType (m_ast_context, void_clang_type, &void_ptr_clang_type, 1, @@ -2157,7 +2157,7 @@ ClangExpressionDeclMap::AddOneType(NameSearchContext &context, TypeFromUser &ut, unsigned int current_id) { - ClangASTType copied_clang_type = GuardedCopyType(ut); + CompilerType copied_clang_type = GuardedCopyType(ut); if (!copied_clang_type) { diff --git a/lldb/source/Expression/ClangExpressionVariable.cpp b/lldb/source/Expression/ClangExpressionVariable.cpp index e86016e..00da5b8 100644 --- a/lldb/source/Expression/ClangExpressionVariable.cpp +++ b/lldb/source/Expression/ClangExpressionVariable.cpp @@ -80,14 +80,14 @@ ClangExpressionVariable::SetRegisterInfo (const RegisterInfo *reg_info) return m_frozen_sp->GetValue().SetContext (Value::eContextTypeRegisterInfo, const_cast<RegisterInfo *>(reg_info)); } -ClangASTType +CompilerType ClangExpressionVariable::GetClangType() { return m_frozen_sp->GetClangType(); } void -ClangExpressionVariable::SetClangType(const ClangASTType &clang_type) +ClangExpressionVariable::SetClangType(const CompilerType &clang_type) { m_frozen_sp->GetValue().SetClangType(clang_type); } diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index b438dac..572aec5 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -52,7 +52,7 @@ using namespace lldb_private; ClangFunction::ClangFunction ( ExecutionContextScope &exe_scope, - const ClangASTType &return_type, + const CompilerType &return_type, const Address& functionAddress, const ValueList &arg_value_list, const char *name @@ -151,7 +151,7 @@ ClangFunction::CompileFunction (Stream &errors) uint32_t num_args = UINT32_MAX; bool trust_function = false; // GetArgumentCount returns -1 for an unprototyped function. - ClangASTType function_clang_type; + CompilerType function_clang_type; if (m_function_ptr) { function_clang_type = m_function_ptr->GetClangType(); @@ -181,7 +181,7 @@ ClangFunction::CompileFunction (Stream &errors) } else { - ClangASTType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType (); + CompilerType clang_qual_type = m_arg_values.GetValueAtIndex(i)->GetClangType (); if (clang_qual_type) { type_name = clang_qual_type.GetTypeName().AsCString(""); @@ -449,7 +449,7 @@ ClangFunction::GetThreadPlanToCallFunction (ExecutionContext &exe_ctx, lldb::ThreadPlanSP new_plan_sp (new ThreadPlanCallFunction (*thread, wrapper_address, - ClangASTType(), + CompilerType(), args, options)); new_plan_sp->SetIsMasterPlan(true); @@ -462,7 +462,7 @@ ClangFunction::FetchFunctionResults (ExecutionContext &exe_ctx, lldb::addr_t arg { // Read the return value - it is the last field in the struct: // FIXME: How does clang tell us there's no return value? We need to handle that case. - // FIXME: Create our ThreadPlanCallFunction with the return ClangASTType, and then use GetReturnValueObject + // FIXME: Create our ThreadPlanCallFunction with the return CompilerType, and then use GetReturnValueObject // to fetch the value. That way we can fetch any values we need. Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP)); diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 290b093..0db194c 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -305,7 +305,7 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) return; } - ClangASTType self_clang_type = self_type->GetClangForwardType(); + CompilerType self_clang_type = self_type->GetClangForwardType(); if (!self_clang_type) { diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 9db8278..39870b8 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -34,7 +34,7 @@ #include "lldb/Expression/IRInterpreter.h" #include "lldb/Host/Endian.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Target/CPPLanguageRuntime.h" #include <map> @@ -1509,7 +1509,7 @@ IRForTarget::MaybeHandleVariable (Value *llvm_value_ptr) if (value_decl == NULL) return false; - lldb_private::ClangASTType clang_type(&value_decl->getASTContext(), value_decl->getType()); + lldb_private::CompilerType clang_type(&value_decl->getASTContext(), value_decl->getType()); const Type *value_type = NULL; diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index ef01fee..3fb9036 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -48,7 +48,7 @@ Materializer::AddStructMember (Entity &entity) } void -Materializer::Entity::SetSizeAndAlignmentFromType (ClangASTType &type) +Materializer::Entity::SetSizeAndAlignmentFromType (CompilerType &type) { m_size = type.GetByteSize(nullptr); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp index 3e0861b..7402be6 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -333,7 +333,7 @@ ABIMacOSX_arm::GetArgumentValues (Thread &thread, if (!value) return false; - ClangASTType clang_type = value->GetClangType(); + CompilerType clang_type = value->GetClangType(); if (clang_type) { bool is_signed = false; @@ -416,7 +416,7 @@ ABIMacOSX_arm::GetArgumentValues (Thread &thread, ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread, - lldb_private::ClangASTType &clang_type) const + lldb_private::CompilerType &clang_type) const { Value value; ValueObjectSP return_valobj_sp; @@ -511,7 +511,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h index eee4394..3431c78 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h @@ -42,7 +42,7 @@ public: protected: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual bool diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp index 04b9618..9b61522 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -322,7 +322,7 @@ ABIMacOSX_arm64::GetArgumentValues (Thread &thread, ValueList &values) const if (!value) return false; - ClangASTType value_type = value->GetClangType(); + CompilerType value_type = value->GetClangType(); if (value_type) { bool is_signed = false; @@ -424,7 +424,7 @@ ABIMacOSX_arm64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueO return error; } - ClangASTType return_value_type = new_value_sp->GetClangType(); + CompilerType return_value_type = new_value_sp->GetClangType(); if (!return_value_type) { error.SetErrorString ("Null clang type for return value."); @@ -709,7 +709,7 @@ ABIMacOSX_arm64::RegisterIsVolatile (const RegisterInfo *reg_info) static bool LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, RegisterContext *reg_ctx, - const ClangASTType &value_type, + const CompilerType &value_type, bool is_return_value, // false => parameter, true => return value uint32_t &NGRN, // NGRN (see ABI documentation) uint32_t &NSRN, // NSRN (see ABI documentation) @@ -724,7 +724,7 @@ LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder(); Error error; - ClangASTType base_type; + CompilerType base_type; const uint32_t homogeneous_count = value_type.IsHomogeneousAggregate (&base_type); if (homogeneous_count > 0 && homogeneous_count <= 8) { @@ -861,7 +861,7 @@ LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, } ValueObjectSP -ABIMacOSX_arm64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABIMacOSX_arm64::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h index 6cce6a6..936c96c 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -118,7 +118,7 @@ public: protected: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; private: ABIMacOSX_arm64() : diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp index 4204d18..cbdea20 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -418,7 +418,7 @@ ABIMacOSX_i386::PrepareNormalCall (Thread &thread, break; case Value::eValueTypeHostAddress: { - ClangASTType clang_type (val->GetClangType()); + CompilerType clang_type (val->GetClangType()); if (clang_type) { uint32_t cstr_length = 0; @@ -545,7 +545,7 @@ ABIMacOSX_i386::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - ClangASTType clang_type (value->GetClangType()); + CompilerType clang_type (value->GetClangType()); if (clang_type) { bool is_signed; @@ -582,7 +582,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -654,7 +654,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb ValueObjectSP ABIMacOSX_i386::GetReturnValueObjectImpl (Thread &thread, - ClangASTType &clang_type) const + CompilerType &clang_type) const { Value value; ValueObjectSP return_valobj_sp; diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h index d81b7a7..a77ee19d 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h @@ -52,7 +52,7 @@ public: protected: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp index 08c0481..27f17a2 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -333,7 +333,7 @@ ABISysV_arm::GetArgumentValues (Thread &thread, if (!value) return false; - ClangASTType clang_type = value->GetClangType(); + CompilerType clang_type = value->GetClangType(); if (clang_type) { bool is_signed = false; @@ -417,7 +417,7 @@ GetReturnValuePassedInMemory(Thread &thread, RegisterContext* reg_ctx, size_t by ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl (Thread &thread, - lldb_private::ClangASTType &clang_type) const + lldb_private::CompilerType &clang_type) const { Value value; ValueObjectSP return_valobj_sp; @@ -579,7 +579,7 @@ ABISysV_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjec return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h index 69becd6..385540a 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h @@ -42,7 +42,7 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const override; + lldb_private::CompilerType &ast_type) const override; public: bool diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp index ed058ff..b419a90 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -313,7 +313,7 @@ ABISysV_arm64::GetArgumentValues (Thread &thread, ValueList &values) const if (!value) return false; - ClangASTType value_type = value->GetClangType(); + CompilerType value_type = value->GetClangType(); if (value_type) { bool is_signed = false; @@ -397,7 +397,7 @@ ABISysV_arm64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj return error; } - ClangASTType return_value_type = new_value_sp->GetClangType(); + CompilerType return_value_type = new_value_sp->GetClangType(); if (!return_value_type) { error.SetErrorString ("Null clang type for return value."); @@ -686,7 +686,7 @@ ABISysV_arm64::RegisterIsVolatile (const RegisterInfo *reg_info) static bool LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, RegisterContext *reg_ctx, - const ClangASTType &value_type, + const CompilerType &value_type, bool is_return_value, // false => parameter, true => return value uint32_t &NGRN, // NGRN (see ABI documentation) uint32_t &NSRN, // NSRN (see ABI documentation) @@ -701,7 +701,7 @@ LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder(); Error error; - ClangASTType base_type; + CompilerType base_type; const uint32_t homogeneous_count = value_type.IsHomogeneousAggregate (&base_type); if (homogeneous_count > 0 && homogeneous_count <= 8) { @@ -831,7 +831,7 @@ LoadValueFromConsecutiveGPRRegisters (ExecutionContext &exe_ctx, } ValueObjectSP -ABISysV_arm64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_arm64::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h index 08c8682..cda61e6 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h @@ -42,7 +42,7 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const override; + lldb_private::CompilerType &ast_type) const override; public: bool diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index 69129df..8196a99 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -359,14 +359,14 @@ ABISysV_hexagon::SetReturnValueObject ( lldb::StackFrameSP &frame_sp, lldb::Valu } ValueObjectSP -ABISysV_hexagon::GetReturnValueObjectSimple ( Thread &thread, ClangASTType &return_clang_type ) const +ABISysV_hexagon::GetReturnValueObjectSimple ( Thread &thread, CompilerType &return_clang_type ) const { ValueObjectSP return_valobj_sp; return return_valobj_sp; } ValueObjectSP -ABISysV_hexagon::GetReturnValueObjectImpl ( Thread &thread, ClangASTType &return_clang_type ) const +ABISysV_hexagon::GetReturnValueObjectImpl ( Thread &thread, CompilerType &return_clang_type ) const { ValueObjectSP return_valobj_sp; return return_valobj_sp; diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h index 1550a38..561e1d1 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h @@ -56,12 +56,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple ( lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type ) const; + lldb_private::CompilerType &ast_type ) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl ( lldb_private::Thread &thread, - lldb_private::ClangASTType &type ) const; + lldb_private::CompilerType &type ) const; // specialized to work with llvm IR types virtual lldb::ValueObjectSP diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp index e8348a8..ad0cf3b 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp @@ -387,7 +387,7 @@ ABISysV_i386::GetArgumentValues (Thread &thread, return false; // Currently: Support for extracting values with Clang QualTypes only. - ClangASTType clang_type (value->GetClangType()); + CompilerType clang_type (value->GetClangType()); if (clang_type) { bool is_signed; @@ -426,7 +426,7 @@ ABISysV_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObje ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple (Thread &thread, - ClangASTType &return_clang_type) const + CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; @@ -686,7 +686,7 @@ ABISysV_i386::GetReturnValueObjectSimple (Thread &thread, ValueObjectSP -ABISysV_i386::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_i386::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h index 9612f90..f254c2a0 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h @@ -49,7 +49,7 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; bool RegisterIsCalleeSaved (const lldb_private::RegisterInfo *reg_info); @@ -57,7 +57,7 @@ protected: public: lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const override; + lldb_private::CompilerType &type) const override; bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan) override; diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp index e1fc13a..7ee1d57 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp @@ -325,7 +325,7 @@ ABISysV_mips::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObje return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -398,14 +398,14 @@ ABISysV_mips::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObje ValueObjectSP -ABISysV_mips::GetReturnValueObjectSimple (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_mips::GetReturnValueObjectSimple (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; return return_valobj_sp; } ValueObjectSP -ABISysV_mips::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_mips::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h index ad47ac22..f38b8e7 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h @@ -46,12 +46,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const; + lldb_private::CompilerType &type) const; virtual bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan); diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp index c790fa7..2304c35 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp @@ -290,7 +290,7 @@ ABISysV_mips64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -368,14 +368,14 @@ ABISysV_mips64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb ValueObjectSP -ABISysV_mips64::GetReturnValueObjectSimple (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_mips64::GetReturnValueObjectSimple (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; return return_valobj_sp; } ValueObjectSP -ABISysV_mips64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_mips64::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h index c37e717..30f5984 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h @@ -46,12 +46,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const; + lldb_private::CompilerType &type) const; virtual bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan); diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp index 08416dc..f6f4464 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp @@ -436,7 +436,7 @@ ABISysV_ppc::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - ClangASTType clang_type = value->GetClangType(); + CompilerType clang_type = value->GetClangType(); if (!clang_type) return false; bool is_signed; @@ -476,7 +476,7 @@ ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjec return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -563,7 +563,7 @@ ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjec ValueObjectSP ABISysV_ppc::GetReturnValueObjectSimple (Thread &thread, - ClangASTType &return_clang_type) const + CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; @@ -724,7 +724,7 @@ ABISysV_ppc::GetReturnValueObjectSimple (Thread &thread, } ValueObjectSP -ABISysV_ppc::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_ppc::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; @@ -781,7 +781,7 @@ ABISysV_ppc::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clan bool is_complex; uint32_t count; - ClangASTType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); + CompilerType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); const size_t field_bit_width = field_clang_type.GetBitSize(&thread); // If there are any unaligned fields, this is stored in memory. @@ -858,7 +858,7 @@ ABISysV_ppc::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clan else { uint64_t next_field_bit_offset = 0; - ClangASTType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, + CompilerType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, name, &next_field_bit_offset, NULL, @@ -882,7 +882,7 @@ ABISysV_ppc::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clan else { uint64_t prev_field_bit_offset = 0; - ClangASTType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, + CompilerType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, name, &prev_field_bit_offset, NULL, diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h index a7aad30..e680dec 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h @@ -46,12 +46,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const; + lldb_private::CompilerType &type) const; virtual bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan); diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp index eb0d7c0..f540226 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp @@ -436,7 +436,7 @@ ABISysV_ppc64::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - ClangASTType clang_type = value->GetClangType(); + CompilerType clang_type = value->GetClangType(); if (!clang_type) return false; bool is_signed; @@ -476,7 +476,7 @@ ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -563,7 +563,7 @@ ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj ValueObjectSP ABISysV_ppc64::GetReturnValueObjectSimple (Thread &thread, - ClangASTType &return_clang_type) const + CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; @@ -724,7 +724,7 @@ ABISysV_ppc64::GetReturnValueObjectSimple (Thread &thread, } ValueObjectSP -ABISysV_ppc64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_ppc64::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; @@ -781,7 +781,7 @@ ABISysV_ppc64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_cl bool is_complex; uint32_t count; - ClangASTType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); + CompilerType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); const size_t field_bit_width = field_clang_type.GetBitSize(&thread); // If there are any unaligned fields, this is stored in memory. @@ -858,7 +858,7 @@ ABISysV_ppc64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_cl else { uint64_t next_field_bit_offset = 0; - ClangASTType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, + CompilerType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, name, &next_field_bit_offset, NULL, @@ -882,7 +882,7 @@ ABISysV_ppc64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_cl else { uint64_t prev_field_bit_offset = 0; - ClangASTType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, + CompilerType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, name, &prev_field_bit_offset, NULL, diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h index d77cb9f..ad4c2b7 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h @@ -46,12 +46,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const; + lldb_private::CompilerType &type) const; virtual bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan); diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index 687a08d6..0df5096 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -502,7 +502,7 @@ ABISysV_x86_64::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - ClangASTType clang_type = value->GetClangType(); + CompilerType clang_type = value->GetClangType(); if (!clang_type) return false; bool is_signed; @@ -542,7 +542,7 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb return error; } - ClangASTType clang_type = new_value_sp->GetClangType(); + CompilerType clang_type = new_value_sp->GetClangType(); if (!clang_type) { error.SetErrorString ("Null clang type for return value."); @@ -633,7 +633,7 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb ValueObjectSP ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, - ClangASTType &return_clang_type) const + CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; @@ -839,7 +839,7 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, } ValueObjectSP -ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const +ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, CompilerType &return_clang_type) const { ValueObjectSP return_valobj_sp; @@ -902,7 +902,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_c bool is_complex; uint32_t count; - ClangASTType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); + CompilerType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); const size_t field_bit_width = field_clang_type.GetBitSize(&thread); // if we don't know the size of the field (e.g. invalid type), just bail out @@ -989,7 +989,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_c else { uint64_t next_field_bit_offset = 0; - ClangASTType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, + CompilerType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, name, &next_field_bit_offset, NULL, @@ -1013,7 +1013,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_c else { uint64_t prev_field_bit_offset = 0; - ClangASTType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, + CompilerType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, name, &prev_field_bit_offset, NULL, diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h index 6fefcc2..6c97e37 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h @@ -46,12 +46,12 @@ public: protected: lldb::ValueObjectSP GetReturnValueObjectSimple (lldb_private::Thread &thread, - lldb_private::ClangASTType &ast_type) const; + lldb_private::CompilerType &ast_type) const; public: virtual lldb::ValueObjectSP GetReturnValueObjectImpl (lldb_private::Thread &thread, - lldb_private::ClangASTType &type) const; + lldb_private::CompilerType &type) const; virtual bool CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan); diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 7a82d18..31e1af5 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -627,8 +627,8 @@ DynamicLoaderMacOSXDYLD::NotifyBreakpointHit (void *baton, ValueList argument_values; Value input_value; - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); - ClangASTType clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32); input_value.SetValueType (Value::eValueTypeScalar); input_value.SetClangType (clang_uint32_type); // input_value.SetContext (Value::eContextTypeClangType, clang_uint32_type); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp index 9bf272c..7cfb022 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp @@ -529,7 +529,7 @@ ClassDescriptorV2::iVarsStorage::fill (AppleObjCRuntimeV2& runtime, ClassDescrip [this,process,encoding_to_type_sp](const char * name, const char * type, lldb::addr_t offset_ptr, uint64_t size) -> bool { const bool for_expression = false; const bool stop_loop = false; - ClangASTType ivar_type = encoding_to_type_sp->RealizeType(type, for_expression); + CompilerType ivar_type = encoding_to_type_sp->RealizeType(type, for_expression); if (ivar_type) { Scalar offset_scalar; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp index 6ceb148..23ac29e 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp @@ -496,7 +496,7 @@ AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) if (log) log->Printf("[ AOTV::FD] Instance variable [%s] [%s], offset at %" PRIx64, name, type, offset_ptr); - ClangASTType ivar_type = m_runtime.GetEncodingToType()->RealizeType(m_ast_ctx, type, for_expression); + CompilerType ivar_type = m_runtime.GetEncodingToType()->RealizeType(m_ast_ctx, type, for_expression); if (ivar_type.IsValid()) { diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 4434404..f05f885 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -51,7 +51,7 @@ AppleObjCRuntime::AppleObjCRuntime(Process *process) : bool AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj) { - ClangASTType clang_type(valobj.GetClangType()); + CompilerType clang_type(valobj.GetClangType()); bool is_signed; // ObjC objects can only be pointers (or numbers that actually represents pointers // but haven't been typecast, because reasons..) @@ -89,7 +89,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon return false; Target *target = exe_ctx.GetTargetPtr(); - ClangASTType clang_type = value.GetClangType(); + CompilerType clang_type = value.GetClangType(); if (clang_type) { if (!ClangASTContext::IsObjCObjectPointerType(clang_type)) @@ -102,7 +102,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon { // If it is not a pointer, see if we can make it into a pointer. ClangASTContext *ast_context = target->GetScratchClangASTContext(); - ClangASTType opaque_type = ast_context->GetBasicType(eBasicTypeObjCID); + CompilerType opaque_type = ast_context->GetBasicType(eBasicTypeObjCID); if (!opaque_type) opaque_type = ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); //value.SetContext(Value::eContextTypeClangType, opaque_type_ptr); @@ -115,7 +115,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon // This is the return value: ClangASTContext *ast_context = target->GetScratchClangASTContext(); - ClangASTType return_clang_type = ast_context->GetCStringType(true); + CompilerType return_clang_type = ast_context->GetCStringType(true); Value ret; // ret.SetContext(Value::eContextTypeClangType, return_clang_type); ret.SetClangType (return_clang_type); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index fa76be4..5d4ba3a 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -13,7 +13,7 @@ #include "lldb/lldb-enumerations.h" #include "lldb/Core/ClangForward.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Core/ClangForward.h" #include "lldb/Core/ConstString.h" @@ -411,13 +411,13 @@ AppleObjCRuntimeV2::GetDynamicTypeAndAddress (ValueObject &in_value, } else { - // try to go for a ClangASTType at least + // try to go for a CompilerType at least DeclVendor* vendor = GetDeclVendor(); if (vendor) { std::vector<clang::NamedDecl*> decls; if (vendor->FindDecls(class_name, false, 1, decls) && decls.size()) - class_type_or_name.SetClangASTType(ClangASTContext::GetTypeForDecl(decls[0])); + class_type_or_name.SetCompilerType(ClangASTContext::GetTypeForDecl(decls[0])); } } } @@ -784,7 +784,7 @@ AppleObjCRuntimeV2::CreateObjectChecker(const char *name) } size_t -AppleObjCRuntimeV2::GetByteOffsetForIvar (ClangASTType &parent_ast_type, const char *ivar_name) +AppleObjCRuntimeV2::GetByteOffsetForIvar (CompilerType &parent_ast_type, const char *ivar_name) { uint32_t ivar_offset = LLDB_INVALID_IVAR_OFFSET; @@ -1245,8 +1245,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table } // Make some types for our arguments - ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + CompilerType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_class_info_code.get()) { @@ -1499,8 +1499,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() } // Make some types for our arguments - ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + CompilerType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_shared_cache_class_info_code.get()) { diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h index 18b9aca..6d981f7 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -74,7 +74,7 @@ public: } virtual size_t - GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name); + GetByteOffsetForIvar (CompilerType &parent_qual_type, const char *ivar_name); virtual void UpdateISAToDescriptorMapIfNeeded(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 5d82f16..40f8e89 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -522,7 +522,7 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); ValueList argument_values; Value input_value; - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); input_value.SetValueType (Value::eValueTypeScalar); //input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); @@ -795,7 +795,7 @@ AppleObjCTrampolineHandler::SetupDispatchFunction (Thread &thread, ValueList &di if (!m_impl_function.get()) { ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); m_impl_function.reset(new ClangFunction (thread, clang_void_ptr_type, impl_code_address, @@ -898,7 +898,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto ClangASTContext *clang_ast_context = target_sp->GetScratchClangASTContext(); ValueList argument_values; Value void_ptr_value; - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); void_ptr_value.SetValueType (Value::eValueTypeScalar); //void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); void_ptr_value.SetClangType (clang_void_ptr_type); @@ -1080,7 +1080,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto dispatch_values.PushValue (*(argument_values.GetValueAtIndex(sel_index))); Value flag_value; - ClangASTType clang_int_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); + CompilerType clang_int_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); flag_value.SetValueType (Value::eValueTypeScalar); //flag_value.SetContext (Value::eContextTypeClangType, clang_int_type); flag_value.SetClangType (clang_int_type); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp index 03a1f2b..40879e1 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp @@ -10,7 +10,7 @@ #include "AppleObjCTypeEncodingParser.h" #include "lldb/Symbol/ClangASTContext.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/StringLexer.h" @@ -136,7 +136,7 @@ AppleObjCTypeEncodingParser::BuildAggregate (clang::ASTContext &ast_ctx, lldb_ut ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx); if (!lldb_ctx) return clang::QualType(); - ClangASTType union_type(lldb_ctx->CreateRecordType(nullptr, lldb::eAccessPublic, name.c_str(), kind, lldb::eLanguageTypeC)); + CompilerType union_type(lldb_ctx->CreateRecordType(nullptr, lldb::eAccessPublic, name.c_str(), kind, lldb::eLanguageTypeC)); if (union_type) { ClangASTContext::StartTagDeclarationDefinition(union_type); @@ -150,7 +150,7 @@ AppleObjCTypeEncodingParser::BuildAggregate (clang::ASTContext &ast_ctx, lldb_ut elem_name.Printf("__unnamed_%u",count); element.name = std::string(elem_name.GetData()); } - ClangASTContext::AddFieldToRecordType(union_type, element.name.c_str(), ClangASTType(&ast_ctx, element.type), lldb::eAccessPublic, element.bitfield); + ClangASTContext::AddFieldToRecordType(union_type, element.name.c_str(), CompilerType(&ast_ctx, element.type), lldb::eAccessPublic, element.bitfield); ++count; } ClangASTContext::CompleteTagDeclarationDefinition(union_type); @@ -170,7 +170,7 @@ AppleObjCTypeEncodingParser::BuildArray (clang::ASTContext &ast_ctx, lldb_utilit ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx); if (!lldb_ctx) return clang::QualType(); - ClangASTType array_type(lldb_ctx->CreateArrayType(ClangASTType(&ast_ctx, element_type), size, false)); + CompilerType array_type(lldb_ctx->CreateArrayType(CompilerType(&ast_ctx, element_type), size, false)); return ClangASTContext::GetQualType(array_type); } @@ -384,15 +384,15 @@ AppleObjCTypeEncodingParser::BuildType (clang::ASTContext &ast_ctx, StringLexer& } } -ClangASTType +CompilerType AppleObjCTypeEncodingParser::RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression) { if (name && name[0]) { StringLexer lexer(name); clang::QualType qual_type = BuildType(ast_ctx, lexer, for_expression); - return ClangASTType(&ast_ctx, qual_type); + return CompilerType(&ast_ctx, qual_type); } - return ClangASTType(); + return CompilerType(); } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h index 1cc506e..1ff3a46 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h @@ -31,7 +31,7 @@ namespace lldb_private { { public: AppleObjCTypeEncodingParser (ObjCLanguageRuntime& runtime); - virtual ClangASTType RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression); + virtual CompilerType RealizeType (clang::ASTContext &ast_ctx, const char* name, bool for_expression); virtual ~AppleObjCTypeEncodingParser() {} private: diff --git a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp index 3923c54..52452f9 100644 --- a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp +++ b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp @@ -93,7 +93,7 @@ lldb_private::InferiorCallMmap (Process *process, if (sc.GetAddressRange(range_scope, 0, use_inline_block_range, mmap_range)) { ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); lldb::addr_t args[] = { addr, length, prot_arg, flags_arg, fd, offset }; lldb::ThreadPlanSP call_plan_sp (new ThreadPlanCallFunction (*thread, mmap_range.GetBaseAddress(), @@ -182,7 +182,7 @@ lldb_private::InferiorCallMunmap (Process *process, lldb::addr_t args[] = { addr, length }; lldb::ThreadPlanSP call_plan_sp (new ThreadPlanCallFunction (*thread, munmap_range.GetBaseAddress(), - ClangASTType(), + CompilerType(), args, options)); if (call_plan_sp) @@ -235,7 +235,7 @@ lldb_private::InferiorCall (Process *process, options.SetTimeoutUsec(500000); ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); lldb::ThreadPlanSP call_plan_sp (new ThreadPlanCallFunction (*thread, *address, clang_void_ptr_type, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index c8a598d..c3351d4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -553,11 +553,11 @@ SymbolFileDWARF::GetTypes (SymbolContextScope *sc_scope, // }); // } - std::set<ClangASTType> clang_type_set; + std::set<CompilerType> clang_type_set; size_t num_types_added = 0; for (Type *type : type_set) { - ClangASTType clang_type = type->GetClangForwardType(); + CompilerType clang_type = type->GetClangForwardType(); if (clang_type_set.find(clang_type) == clang_type_set.end()) { clang_type_set.insert(clang_type); @@ -1221,7 +1221,7 @@ SymbolFileDWARF::ParseCompileUnitFunction (const SymbolContext& sc, DWARFCompile bool is_static = false; bool is_variadic = false; unsigned type_quals = 0; - std::vector<ClangASTType> param_types; + std::vector<CompilerType> param_types; std::vector<clang::ParmVarDecl*> param_decls; const DWARFDebugInfoEntry *decl_ctx_die = NULL; DWARFDeclContext decl_ctx; @@ -1648,7 +1648,7 @@ SymbolFileDWARF::ParseTemplateDIE (DWARFCompileUnit* dwarf_cu, attributes); const char *name = NULL; Type *lldb_type = NULL; - ClangASTType clang_type; + CompilerType clang_type; uint64_t uval64 = 0; bool uval64_valid = false; if (num_attributes > 0) @@ -1788,9 +1788,9 @@ class SymbolFileDWARF::DelayedAddObjCClassProperty public: DelayedAddObjCClassProperty ( - const ClangASTType &class_opaque_type, + const CompilerType &class_opaque_type, const char *property_name, - const ClangASTType &property_opaque_type, // The property type is only required if you don't have an ivar decl + const CompilerType &property_opaque_type, // The property type is only required if you don't have an ivar decl clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, @@ -1850,9 +1850,9 @@ public: m_metadata_ap.get()); } private: - ClangASTType m_class_opaque_type; + CompilerType m_class_opaque_type; const char *m_property_name; - ClangASTType m_property_opaque_type; + CompilerType m_property_opaque_type; clang::ObjCIvarDecl *m_ivar_decl; const char *m_property_setter_name; const char *m_property_getter_name; @@ -1921,7 +1921,7 @@ SymbolFileDWARF::ParseChildMembers const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *parent_die, - ClangASTType &class_clang_type, + CompilerType &class_clang_type, const LanguageType class_language, std::vector<clang::CXXBaseSpecifier *>& base_classes, std::vector<int>& member_accessibilities, @@ -2268,14 +2268,14 @@ SymbolFileDWARF::ParseChildMembers last_field_info.Clear(); } - ClangASTType member_clang_type = member_type->GetClangLayoutType(); + CompilerType member_clang_type = member_type->GetClangLayoutType(); { // Older versions of clang emit array[0] and array[1] in the same way (<rdar://problem/12566646>). // If the current field is at the end of the structure, then there is definitely no room for extra // elements and we override the type to array[0]. - ClangASTType member_array_element_type; + CompilerType member_array_element_type; uint64_t member_array_size; bool member_array_is_incomplete; @@ -2454,7 +2454,7 @@ SymbolFileDWARF::ParseChildMembers break; } - ClangASTType base_class_clang_type = base_class_type->GetClangFullType(); + CompilerType base_class_clang_type = base_class_type->GetClangFullType(); assert (base_class_clang_type); if (class_language == eLanguageTypeObjC) { @@ -2599,19 +2599,19 @@ SymbolFileDWARF::ResolveTypeUID (DWARFCompileUnit* cu, const DWARFDebugInfoEntry // SymbolFileDWARF objects to detect if this DWARF file is the one that // can resolve a clang_type. bool -SymbolFileDWARF::HasForwardDeclForClangType (const ClangASTType &clang_type) +SymbolFileDWARF::HasForwardDeclForClangType (const CompilerType &clang_type) { - ClangASTType clang_type_no_qualifiers = ClangASTContext::RemoveFastQualifiers(clang_type); + CompilerType clang_type_no_qualifiers = ClangASTContext::RemoveFastQualifiers(clang_type); const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType()); return die != NULL; } bool -SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) +SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (CompilerType &clang_type) { // We have a struct/union/class/enum that needs to be fully resolved. - ClangASTType clang_type_no_qualifiers = ClangASTContext::RemoveFastQualifiers(clang_type); + CompilerType clang_type_no_qualifiers = ClangASTContext::RemoveFastQualifiers(clang_type); const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType()); if (die == NULL) { @@ -2810,7 +2810,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) clang::TypeSourceInfo *type_source_info = base_class->getTypeSourceInfo(); if (type_source_info) { - ClangASTType base_class_type (GetClangASTContext().getASTContext(), type_source_info->getType()); + CompilerType base_class_type (GetClangASTContext().getASTContext(), type_source_info->getType()); if (base_class_type.GetCompleteType() == false) { if (!base_class_error) @@ -4566,7 +4566,7 @@ SymbolFileDWARF::ParseChildParameters (const SymbolContext& sc, bool skip_artificial, bool &is_static, bool &is_variadic, - std::vector<ClangASTType>& function_param_types, + std::vector<CompilerType>& function_param_types, std::vector<clang::ParmVarDecl*>& function_param_decls, unsigned &type_quals) // , // ClangASTContext::TemplateParameterInfos &template_param_infos)) @@ -4740,7 +4740,7 @@ size_t SymbolFileDWARF::ParseChildEnumerators ( const SymbolContext& sc, - lldb_private::ClangASTType &clang_type, + lldb_private::CompilerType &clang_type, bool is_signed, uint32_t enumerator_byte_size, DWARFCompileUnit* dwarf_cu, @@ -5941,7 +5941,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, Declaration decl; Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID; - ClangASTType clang_type; + CompilerType clang_type; DWARFFormValue form_value; dw_attr_t attr; @@ -6590,7 +6590,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); - ClangASTType enumerator_clang_type; + CompilerType enumerator_clang_type; clang_type.SetClangType (&ast, m_forward_decl_die_to_clang_type.lookup (die)); if (!clang_type) { @@ -6759,7 +6759,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); - ClangASTType return_clang_type; + CompilerType return_clang_type; Type *func_type = NULL; if (type_die_offset != DW_INVALID_OFFSET) @@ -6771,7 +6771,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, return_clang_type = ast.GetBasicType(eBasicTypeVoid); - std::vector<ClangASTType> function_param_types; + std::vector<CompilerType> function_param_types; std::vector<clang::ParmVarDecl*> function_param_decls; // Parse the function children for the parameters @@ -6818,7 +6818,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, ObjCLanguageRuntime::MethodName objc_method (type_name_cstr, true); if (objc_method.IsValid(true)) { - ClangASTType class_opaque_type; + CompilerType class_opaque_type; ConstString class_name(objc_method.GetClassName()); if (class_name) { @@ -6826,7 +6826,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (complete_objc_class_type_sp) { - ClangASTType type_clang_forward_type = complete_objc_class_type_sp->GetClangForwardType(); + CompilerType type_clang_forward_type = complete_objc_class_type_sp->GetClangForwardType(); if (ClangASTContext::IsObjCObjectOrInterfaceType(type_clang_forward_type)) class_opaque_type = type_clang_forward_type; } @@ -6962,7 +6962,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else { - ClangASTType class_opaque_type = class_type->GetClangForwardType(); + CompilerType class_opaque_type = class_type->GetClangForwardType(); if (ClangASTContext::IsCXXClassType(class_opaque_type)) { if (class_opaque_type.IsBeingDefined ()) @@ -7183,7 +7183,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, ParseChildArrayInfo(sc, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride); if (byte_stride == 0 && bit_stride == 0) byte_stride = element_type->GetByteSize(); - ClangASTType array_element_type = element_type->GetClangForwardType(); + CompilerType array_element_type = element_type->GetClangForwardType(); uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride; if (element_orders.size() > 0) { @@ -7250,8 +7250,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, Type *pointee_type = ResolveTypeUID(type_die_offset); Type *class_type = ResolveTypeUID(containing_type_die_offset); - ClangASTType pointee_clang_type = pointee_type->GetClangForwardType(); - ClangASTType class_clang_type = class_type->GetClangLayoutType(); + CompilerType pointee_clang_type = pointee_type->GetClangForwardType(); + CompilerType class_clang_type = class_type->GetClangLayoutType(); clang_type = ClangASTContext::CreateMemberPointerType(pointee_clang_type, class_clang_type); @@ -8087,7 +8087,7 @@ void SymbolFileDWARF::CompleteTagDecl (void *baton, clang::TagDecl *decl) { SymbolFileDWARF *symbol_file_dwarf = (SymbolFileDWARF *)baton; - ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + CompilerType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) symbol_file_dwarf->ResolveClangOpaqueTypeDefinition (clang_type); } @@ -8096,7 +8096,7 @@ void SymbolFileDWARF::CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *decl) { SymbolFileDWARF *symbol_file_dwarf = (SymbolFileDWARF *)baton; - ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + CompilerType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) symbol_file_dwarf->ResolveClangOpaqueTypeDefinition (clang_type); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 1c84022..506df1c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -112,7 +112,7 @@ public: virtual size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc); virtual lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid); - virtual bool ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); + virtual bool ResolveClangOpaqueTypeDefinition (lldb_private::CompilerType& clang_type); virtual lldb_private::Type* ResolveType (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* type_die, bool assert_not_being_parsed = true); virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid); @@ -273,7 +273,7 @@ public: } bool - HasForwardDeclForClangType (const lldb_private::ClangASTType &clang_type); + HasForwardDeclForClangType (const lldb_private::CompilerType &clang_type); protected: @@ -345,7 +345,7 @@ protected: const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, - lldb_private::ClangASTType &class_clang_type, + lldb_private::CompilerType &class_clang_type, const lldb::LanguageType class_language, std::vector<clang::CXXBaseSpecifier *>& base_classes, std::vector<int>& member_accessibilities, @@ -363,7 +363,7 @@ protected: bool skip_artificial, bool &is_static, bool &is_variadic, - std::vector<lldb_private::ClangASTType>& function_args, + std::vector<lldb_private::CompilerType>& function_args, std::vector<clang::ParmVarDecl*>& function_param_decls, unsigned &type_quals); // lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos); // not currently needed @@ -371,7 +371,7 @@ protected: size_t ParseChildEnumerators( const lldb_private::SymbolContext& sc, - lldb_private::ClangASTType &clang_type, + lldb_private::CompilerType &clang_type, bool is_signed, uint32_t enumerator_byte_size, DWARFCompileUnit* dwarf_cu, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 1e973b0..dec3bf8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -788,7 +788,7 @@ SymbolFileDWARFDebugMap::ResolveTypeUID(lldb::user_id_t type_uid) } bool -SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (ClangASTType& clang_type) +SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (CompilerType& clang_type) { // We have a struct/union/class/enum that needs to be fully resolved. return false; @@ -1433,7 +1433,7 @@ void SymbolFileDWARFDebugMap::CompleteTagDecl (void *baton, clang::TagDecl *decl) { SymbolFileDWARFDebugMap *symbol_file_dwarf = (SymbolFileDWARFDebugMap *)baton; - ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + CompilerType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) { symbol_file_dwarf->ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { @@ -1451,7 +1451,7 @@ void SymbolFileDWARFDebugMap::CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *decl) { SymbolFileDWARFDebugMap *symbol_file_dwarf = (SymbolFileDWARFDebugMap *)baton; - ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + CompilerType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) { symbol_file_dwarf->ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index ce0cfd7..6843a40 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -78,7 +78,7 @@ public: lldb_private::Type* ResolveTypeUID (lldb::user_id_t type_uid) override; clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) override; clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) override; - bool ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type) override; + bool ResolveClangOpaqueTypeDefinition (lldb_private::CompilerType& clang_type) override; uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc) override; uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list) override; uint32_t FindGlobalVariables (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables) override; diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index c861d62..4f0764a 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -300,7 +300,7 @@ SymbolFileSymtab::ResolveTypeUID(lldb::user_id_t type_uid) } bool -SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_opaque_type) +SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb_private::CompilerType& clang_opaque_type) { return false; } diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index d606419..8a12bf6 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -82,7 +82,7 @@ public: ResolveTypeUID(lldb::user_id_t type_uid); virtual bool - ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); + ResolveClangOpaqueTypeDefinition (lldb_private::CompilerType& clang_type); virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp index 64b2e22..bd5cf2b 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -212,7 +212,7 @@ AppleGetItemInfoHandler::SetupGetItemInfoFunction (Thread &thread, ValueList &ge if (!m_get_item_info_function.get()) { ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - ClangASTType get_item_info_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType get_item_info_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); m_get_item_info_function.reset(new ClangFunction (thread, get_item_info_return_type, impl_code_address, @@ -295,17 +295,17 @@ AppleGetItemInfoHandler::GetItemInfo (Thread &thread, uint64_t item, addr_t page // Where the return_buffer argument points to a 24 byte region of memory already allocated by lldb in // the inferior process. - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Value return_buffer_ptr_value; return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar); return_buffer_ptr_value.SetClangType (clang_void_ptr_type); - ClangASTType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); + CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); Value debug_value; debug_value.SetValueType (Value::eValueTypeScalar); debug_value.SetClangType (clang_int_type); - ClangASTType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); + CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); Value item_value; item_value.SetValueType (Value::eValueTypeScalar); item_value.SetClangType (clang_uint64_type); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h index 96bcc6e..5c086c6 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h @@ -20,7 +20,7 @@ #include "lldb/Core/Error.h" #include "lldb/Expression/ClangFunction.h" #include "lldb/Host/Mutex.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" // This class will insert a ClangUtilityFunction into the inferior process for // calling libBacktraceRecording's __introspection_dispatch_queue_item_get_info() diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp index 16af24b..98cf4ca 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -216,7 +216,7 @@ AppleGetPendingItemsHandler::SetupGetPendingItemsFunction (Thread &thread, Value if (!m_get_pending_items_function.get()) { ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - ClangASTType get_pending_items_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType get_pending_items_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); m_get_pending_items_function.reset(new ClangFunction (thread, get_pending_items_return_type, impl_code_address, @@ -301,17 +301,17 @@ AppleGetPendingItemsHandler::GetPendingItems (Thread &thread, addr_t queue, addr // Where the return_buffer argument points to a 24 byte region of memory already allocated by lldb in // the inferior process. - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Value return_buffer_ptr_value; return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar); return_buffer_ptr_value.SetClangType (clang_void_ptr_type); - ClangASTType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); + CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); Value debug_value; debug_value.SetValueType (Value::eValueTypeScalar); debug_value.SetClangType (clang_int_type); - ClangASTType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); + CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); Value queue_value; queue_value.SetValueType (Value::eValueTypeScalar); queue_value.SetClangType (clang_uint64_type); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h index b818828..22ab1f6 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h @@ -20,7 +20,7 @@ #include "lldb/Core/Error.h" #include "lldb/Expression/ClangFunction.h" #include "lldb/Host/Mutex.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" // This class will insert a ClangUtilityFunction into the inferior process for // calling libBacktraceRecording's __introspection_dispatch_queue_get_pending_items() diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp index 80f61a5..0c76f4f 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -125,7 +125,7 @@ AppleGetQueuesHandler::Detach () } } -// Construct a ClangASTType for the structure that g_get_current_queues_function_code will return by value +// Construct a CompilerType for the structure that g_get_current_queues_function_code will return by value // so we can extract the fields after performing the function call. // i.e. we are getting this struct returned to us: // @@ -224,7 +224,7 @@ AppleGetQueuesHandler::SetupGetQueuesFunction (Thread &thread, ValueList &get_qu if (!m_get_queues_function.get()) { ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - ClangASTType get_queues_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType get_queues_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); m_get_queues_function.reset(new ClangFunction (thread, get_queues_return_type, impl_code_address, @@ -308,12 +308,12 @@ AppleGetQueuesHandler::GetCurrentQueues (Thread &thread, addr_t page_to_free, ui // Where the return_buffer argument points to a 24 byte region of memory already allocated by lldb in // the inferior process. - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Value return_buffer_ptr_value; return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar); return_buffer_ptr_value.SetClangType (clang_void_ptr_type); - ClangASTType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); + CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); Value debug_value; debug_value.SetValueType (Value::eValueTypeScalar); debug_value.SetClangType (clang_int_type); @@ -322,7 +322,7 @@ AppleGetQueuesHandler::GetCurrentQueues (Thread &thread, addr_t page_to_free, ui page_to_free_value.SetValueType (Value::eValueTypeScalar); page_to_free_value.SetClangType (clang_void_ptr_type); - ClangASTType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); + CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); Value page_to_free_size_value; page_to_free_size_value.SetValueType (Value::eValueTypeScalar); page_to_free_size_value.SetClangType (clang_uint64_type); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h index 75b43df..83730b5 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h @@ -20,7 +20,7 @@ #include "lldb/Core/Error.h" #include "lldb/Expression/ClangFunction.h" #include "lldb/Host/Mutex.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" // This class will insert a ClangUtilityFunction into the inferior process for // calling libBacktraceRecording's introspection_get_dispatch_queues() diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp index 46e7666..78511e0 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -216,7 +216,7 @@ AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction (Thread &thread, V if (!m_get_thread_item_info_function.get()) { ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - ClangASTType get_thread_item_info_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType get_thread_item_info_return_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); m_get_thread_item_info_function.reset(new ClangFunction (thread, get_thread_item_info_return_type, impl_code_address, @@ -298,17 +298,17 @@ AppleGetThreadItemInfoHandler::GetThreadItemInfo (Thread &thread, tid_t thread_i // Where the return_buffer argument points to a 24 byte region of memory already allocated by lldb in // the inferior process. - ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Value return_buffer_ptr_value; return_buffer_ptr_value.SetValueType (Value::eValueTypeScalar); return_buffer_ptr_value.SetClangType (clang_void_ptr_type); - ClangASTType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); + CompilerType clang_int_type = clang_ast_context->GetBasicType(eBasicTypeInt); Value debug_value; debug_value.SetValueType (Value::eValueTypeScalar); debug_value.SetClangType (clang_int_type); - ClangASTType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); + CompilerType clang_uint64_type = clang_ast_context->GetBasicType(eBasicTypeUnsignedLongLong); Value thread_id_value; thread_id_value.SetValueType (Value::eValueTypeScalar); thread_id_value.SetClangType (clang_uint64_type); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h index 1733f21..6ced39ae 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h @@ -20,7 +20,7 @@ #include "lldb/Core/Error.h" #include "lldb/Expression/ClangFunction.h" #include "lldb/Host/Mutex.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" // This class will insert a ClangUtilityFunction into the inferior process for // calling libBacktraceRecording's __introspection_dispatch_thread_get_item_info() diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp index 4e75bab..90271f2 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -446,8 +446,8 @@ SystemRuntimeMacOSX::ReadLibdispatchTSDIndexes () ClangASTContext *ast_ctx = m_process->GetTarget().GetScratchClangASTContext(); if (ast_ctx->getASTContext() && m_dispatch_tsd_indexes_addr != LLDB_INVALID_ADDRESS) { - ClangASTType uint16 = ast_ctx->GetIntTypeFromBitSize(16, false); - ClangASTType dispatch_tsd_indexes_s = ast_ctx->CreateRecordType(nullptr, lldb::eAccessPublic, "__lldb_dispatch_tsd_indexes_s", clang::TTK_Struct, lldb::eLanguageTypeC); + CompilerType uint16 = ast_ctx->GetIntTypeFromBitSize(16, false); + CompilerType dispatch_tsd_indexes_s = ast_ctx->CreateRecordType(nullptr, lldb::eAccessPublic, "__lldb_dispatch_tsd_indexes_s", clang::TTK_Struct, lldb::eLanguageTypeC); ClangASTContext::StartTagDeclarationDefinition(dispatch_tsd_indexes_s); ClangASTContext::AddFieldToRecordType (dispatch_tsd_indexes_s, "dti_version", uint16, lldb::eAccessPublic, 0); diff --git a/lldb/source/Symbol/CMakeLists.txt b/lldb/source/Symbol/CMakeLists.txt index 0d936b7..e145370 100644 --- a/lldb/source/Symbol/CMakeLists.txt +++ b/lldb/source/Symbol/CMakeLists.txt @@ -4,10 +4,10 @@ add_lldb_library(lldbSymbol Block.cpp ClangASTContext.cpp ClangASTImporter.cpp - ClangASTType.cpp ClangExternalASTSourceCallbacks.cpp ClangExternalASTSourceCommon.cpp ClangNamespaceDecl.cpp + CompilerType.cpp CompileUnit.cpp CompactUnwindInfo.cpp Declaration.cpp diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 06bde8e..06ccb5e 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -579,71 +579,71 @@ QualTypeMatchesBitSize(const uint64_t bit_size, ASTContext *ast, QualType qual_t return true; return false; } -ClangASTType +CompilerType ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (Encoding encoding, uint32_t bit_size) { return ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (getASTContext(), encoding, bit_size); } -ClangASTType +CompilerType ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (ASTContext *ast, Encoding encoding, uint32_t bit_size) { if (!ast) - return ClangASTType(); + return CompilerType(); switch (encoding) { case eEncodingInvalid: if (QualTypeMatchesBitSize (bit_size, ast, ast->VoidPtrTy)) - return ClangASTType (ast, ast->VoidPtrTy); + return CompilerType (ast, ast->VoidPtrTy); break; case eEncodingUint: if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy)) - return ClangASTType (ast, ast->UnsignedCharTy); + return CompilerType (ast, ast->UnsignedCharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy)) - return ClangASTType (ast, ast->UnsignedShortTy); + return CompilerType (ast, ast->UnsignedShortTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedIntTy)) - return ClangASTType (ast, ast->UnsignedIntTy); + return CompilerType (ast, ast->UnsignedIntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongTy)) - return ClangASTType (ast, ast->UnsignedLongTy); + return CompilerType (ast, ast->UnsignedLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) - return ClangASTType (ast, ast->UnsignedLongLongTy); + return CompilerType (ast, ast->UnsignedLongLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedInt128Ty)) - return ClangASTType (ast, ast->UnsignedInt128Ty); + return CompilerType (ast, ast->UnsignedInt128Ty); break; case eEncodingSint: if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy)) - return ClangASTType (ast, ast->CharTy); + return CompilerType (ast, ast->CharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->ShortTy)) - return ClangASTType (ast, ast->ShortTy); + return CompilerType (ast, ast->ShortTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->IntTy)) - return ClangASTType (ast, ast->IntTy); + return CompilerType (ast, ast->IntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongTy)) - return ClangASTType (ast, ast->LongTy); + return CompilerType (ast, ast->LongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongLongTy)) - return ClangASTType (ast, ast->LongLongTy); + return CompilerType (ast, ast->LongLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->Int128Ty)) - return ClangASTType (ast, ast->Int128Ty); + return CompilerType (ast, ast->Int128Ty); break; case eEncodingIEEE754: if (QualTypeMatchesBitSize (bit_size, ast, ast->FloatTy)) - return ClangASTType (ast, ast->FloatTy); + return CompilerType (ast, ast->FloatTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->DoubleTy)) - return ClangASTType (ast, ast->DoubleTy); + return CompilerType (ast, ast->DoubleTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy)) - return ClangASTType (ast, ast->LongDoubleTy); + return CompilerType (ast, ast->LongDoubleTy); break; case eEncodingVector: // Sanity check that bit_size is a multiple of 8's. if (bit_size && !(bit_size & 0x7u)) - return ClangASTType (ast, ast->getExtVectorType (ast->UnsignedCharTy, bit_size/8)); + return CompilerType (ast, ast->getExtVectorType (ast->UnsignedCharTy, bit_size/8)); break; } - return ClangASTType(); + return CompilerType(); } @@ -711,7 +711,7 @@ ClangASTContext::GetBasicTypeEnumeration (const ConstString &name) return eBasicTypeInvalid; } -ClangASTType +CompilerType ClangASTContext::GetBasicType (ASTContext *ast, const ConstString &name) { if (ast) @@ -719,7 +719,7 @@ ClangASTContext::GetBasicType (ASTContext *ast, const ConstString &name) lldb::BasicType basic_type = ClangASTContext::GetBasicTypeEnumeration (name); return ClangASTContext::GetBasicType (ast, basic_type); } - return ClangASTType(); + return CompilerType(); } uint32_t @@ -730,13 +730,13 @@ ClangASTContext::GetPointerByteSize () return m_pointer_byte_size; } -ClangASTType +CompilerType ClangASTContext::GetBasicType (lldb::BasicType basic_type) { return GetBasicType (getASTContext(), basic_type); } -ClangASTType +CompilerType ClangASTContext::GetBasicType (ASTContext *ast, lldb::BasicType basic_type) { if (ast) @@ -844,13 +844,13 @@ ClangASTContext::GetBasicType (ASTContext *ast, lldb::BasicType basic_type) } if (clang_type) - return ClangASTType (GetASTContext(ast), clang_type); + return CompilerType (GetASTContext(ast), clang_type); } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name, uint32_t dw_ate, uint32_t bit_size) { ASTContext *ast = getASTContext(); @@ -866,18 +866,18 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name case DW_ATE_address: if (QualTypeMatchesBitSize (bit_size, ast, ast->VoidPtrTy)) - return ClangASTType (ast, ast->VoidPtrTy); + return CompilerType (ast, ast->VoidPtrTy); break; case DW_ATE_boolean: if (QualTypeMatchesBitSize (bit_size, ast, ast->BoolTy)) - return ClangASTType (ast, ast->BoolTy); + return CompilerType (ast, ast->BoolTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy)) - return ClangASTType (ast, ast->UnsignedCharTy); + return CompilerType (ast, ast->UnsignedCharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy)) - return ClangASTType (ast, ast->UnsignedShortTy); + return CompilerType (ast, ast->UnsignedShortTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedIntTy)) - return ClangASTType (ast, ast->UnsignedIntTy); + return CompilerType (ast, ast->UnsignedIntTy); break; case DW_ATE_lo_user: @@ -886,40 +886,40 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name { if (::strstr(type_name, "complex")) { - ClangASTType complex_int_clang_type = GetBuiltinTypeForDWARFEncodingAndBitSize ("int", DW_ATE_signed, bit_size/2); - return ClangASTType (ast, ast->getComplexType (GetQualType(complex_int_clang_type))); + CompilerType complex_int_clang_type = GetBuiltinTypeForDWARFEncodingAndBitSize ("int", DW_ATE_signed, bit_size/2); + return CompilerType (ast, ast->getComplexType (GetQualType(complex_int_clang_type))); } } break; case DW_ATE_complex_float: if (QualTypeMatchesBitSize (bit_size, ast, ast->FloatComplexTy)) - return ClangASTType (ast, ast->FloatComplexTy); + return CompilerType (ast, ast->FloatComplexTy); else if (QualTypeMatchesBitSize (bit_size, ast, ast->DoubleComplexTy)) - return ClangASTType (ast, ast->DoubleComplexTy); + return CompilerType (ast, ast->DoubleComplexTy); else if (QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleComplexTy)) - return ClangASTType (ast, ast->LongDoubleComplexTy); + return CompilerType (ast, ast->LongDoubleComplexTy); else { - ClangASTType complex_float_clang_type = GetBuiltinTypeForDWARFEncodingAndBitSize ("float", DW_ATE_float, bit_size/2); - return ClangASTType (ast, ast->getComplexType (GetQualType(complex_float_clang_type))); + CompilerType complex_float_clang_type = GetBuiltinTypeForDWARFEncodingAndBitSize ("float", DW_ATE_float, bit_size/2); + return CompilerType (ast, ast->getComplexType (GetQualType(complex_float_clang_type))); } break; case DW_ATE_float: if (streq(type_name, "float") && QualTypeMatchesBitSize (bit_size, ast, ast->FloatTy)) - return ClangASTType (ast, ast->FloatTy); + return CompilerType (ast, ast->FloatTy); if (streq(type_name, "double") && QualTypeMatchesBitSize (bit_size, ast, ast->DoubleTy)) - return ClangASTType (ast, ast->DoubleTy); + return CompilerType (ast, ast->DoubleTy); if (streq(type_name, "long double") && QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy)) - return ClangASTType (ast, ast->LongDoubleTy); + return CompilerType (ast, ast->LongDoubleTy); // Fall back to not requiring a name match if (QualTypeMatchesBitSize (bit_size, ast, ast->FloatTy)) - return ClangASTType (ast, ast->FloatTy); + return CompilerType (ast, ast->FloatTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->DoubleTy)) - return ClangASTType (ast, ast->DoubleTy); + return CompilerType (ast, ast->DoubleTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongDoubleTy)) - return ClangASTType (ast, ast->LongDoubleTy); + return CompilerType (ast, ast->LongDoubleTy); break; case DW_ATE_signed: @@ -928,57 +928,57 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name if (streq(type_name, "wchar_t") && QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy) && (getTargetInfo() && TargetInfo::isTypeSigned (getTargetInfo()->getWCharType()))) - return ClangASTType (ast, ast->WCharTy); + return CompilerType (ast, ast->WCharTy); if (streq(type_name, "void") && QualTypeMatchesBitSize (bit_size, ast, ast->VoidTy)) - return ClangASTType (ast, ast->VoidTy); + return CompilerType (ast, ast->VoidTy); if (strstr(type_name, "long long") && QualTypeMatchesBitSize (bit_size, ast, ast->LongLongTy)) - return ClangASTType (ast, ast->LongLongTy); + return CompilerType (ast, ast->LongLongTy); if (strstr(type_name, "long") && QualTypeMatchesBitSize (bit_size, ast, ast->LongTy)) - return ClangASTType (ast, ast->LongTy); + return CompilerType (ast, ast->LongTy); if (strstr(type_name, "short") && QualTypeMatchesBitSize (bit_size, ast, ast->ShortTy)) - return ClangASTType (ast, ast->ShortTy); + return CompilerType (ast, ast->ShortTy); if (strstr(type_name, "char")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy)) - return ClangASTType (ast, ast->CharTy); + return CompilerType (ast, ast->CharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->SignedCharTy)) - return ClangASTType (ast, ast->SignedCharTy); + return CompilerType (ast, ast->SignedCharTy); } if (strstr(type_name, "int")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->IntTy)) - return ClangASTType (ast, ast->IntTy); + return CompilerType (ast, ast->IntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->Int128Ty)) - return ClangASTType (ast, ast->Int128Ty); + return CompilerType (ast, ast->Int128Ty); } } // We weren't able to match up a type name, just search by size if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy)) - return ClangASTType (ast, ast->CharTy); + return CompilerType (ast, ast->CharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->ShortTy)) - return ClangASTType (ast, ast->ShortTy); + return CompilerType (ast, ast->ShortTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->IntTy)) - return ClangASTType (ast, ast->IntTy); + return CompilerType (ast, ast->IntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongTy)) - return ClangASTType (ast, ast->LongTy); + return CompilerType (ast, ast->LongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->LongLongTy)) - return ClangASTType (ast, ast->LongLongTy); + return CompilerType (ast, ast->LongLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->Int128Ty)) - return ClangASTType (ast, ast->Int128Ty); + return CompilerType (ast, ast->Int128Ty); break; case DW_ATE_signed_char: if (ast->getLangOpts().CharIsSigned && type_name && streq(type_name, "char")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy)) - return ClangASTType (ast, ast->CharTy); + return CompilerType (ast, ast->CharTy); } if (QualTypeMatchesBitSize (bit_size, ast, ast->SignedCharTy)) - return ClangASTType (ast, ast->SignedCharTy); + return CompilerType (ast, ast->SignedCharTy); break; case DW_ATE_unsigned: @@ -989,62 +989,62 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name if (QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy)) { if (!(getTargetInfo() && TargetInfo::isTypeSigned (getTargetInfo()->getWCharType()))) - return ClangASTType (ast, ast->WCharTy); + return CompilerType (ast, ast->WCharTy); } } if (strstr(type_name, "long long")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) - return ClangASTType (ast, ast->UnsignedLongLongTy); + return CompilerType (ast, ast->UnsignedLongLongTy); } else if (strstr(type_name, "long")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongTy)) - return ClangASTType (ast, ast->UnsignedLongTy); + return CompilerType (ast, ast->UnsignedLongTy); } else if (strstr(type_name, "short")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy)) - return ClangASTType (ast, ast->UnsignedShortTy); + return CompilerType (ast, ast->UnsignedShortTy); } else if (strstr(type_name, "char")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy)) - return ClangASTType (ast, ast->UnsignedCharTy); + return CompilerType (ast, ast->UnsignedCharTy); } else if (strstr(type_name, "int")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedIntTy)) - return ClangASTType (ast, ast->UnsignedIntTy); + return CompilerType (ast, ast->UnsignedIntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedInt128Ty)) - return ClangASTType (ast, ast->UnsignedInt128Ty); + return CompilerType (ast, ast->UnsignedInt128Ty); } } // We weren't able to match up a type name, just search by size if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy)) - return ClangASTType (ast, ast->UnsignedCharTy); + return CompilerType (ast, ast->UnsignedCharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy)) - return ClangASTType (ast, ast->UnsignedShortTy); + return CompilerType (ast, ast->UnsignedShortTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedIntTy)) - return ClangASTType (ast, ast->UnsignedIntTy); + return CompilerType (ast, ast->UnsignedIntTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongTy)) - return ClangASTType (ast, ast->UnsignedLongTy); + return CompilerType (ast, ast->UnsignedLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedLongLongTy)) - return ClangASTType (ast, ast->UnsignedLongLongTy); + return CompilerType (ast, ast->UnsignedLongLongTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedInt128Ty)) - return ClangASTType (ast, ast->UnsignedInt128Ty); + return CompilerType (ast, ast->UnsignedInt128Ty); break; case DW_ATE_unsigned_char: if (!ast->getLangOpts().CharIsSigned && type_name && streq(type_name, "char")) { if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy)) - return ClangASTType (ast, ast->CharTy); + return CompilerType (ast, ast->CharTy); } if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy)) - return ClangASTType (ast, ast->UnsignedCharTy); + return CompilerType (ast, ast->UnsignedCharTy); if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy)) - return ClangASTType (ast, ast->UnsignedShortTy); + return CompilerType (ast, ast->UnsignedShortTy); break; case DW_ATE_imaginary_float: @@ -1055,11 +1055,11 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name { if (streq(type_name, "char16_t")) { - return ClangASTType (ast, ast->Char16Ty); + return CompilerType (ast, ast->Char16Ty); } else if (streq(type_name, "char32_t")) { - return ClangASTType (ast, ast->Char32Ty); + return CompilerType (ast, ast->Char32Ty); } } break; @@ -1075,18 +1075,18 @@ ClangASTContext::GetBuiltinTypeForDWARFEncodingAndBitSize (const char *type_name { Host::SystemLog (Host::eSystemLogError, "error: need to add support for DW_TAG_base_type encoded with DW_ATE = 0x%x, bit_size = %u\n", dw_ate, bit_size); } - return ClangASTType (); + return CompilerType (); } -ClangASTType +CompilerType ClangASTContext::GetUnknownAnyType(clang::ASTContext *ast) { if (ast) - return ClangASTType (ast, ast->UnknownAnyTy); - return ClangASTType(); + return CompilerType (ast, ast->UnknownAnyTy); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetCStringType (bool is_const) { ASTContext *ast = getASTContext(); @@ -1095,7 +1095,7 @@ ClangASTContext::GetCStringType (bool is_const) if (is_const) char_type.addConst(); - return ClangASTType (ast, ast->getPointerType(char_type)); + return CompilerType (ast, ast->getPointerType(char_type)); } clang::DeclContext * @@ -1104,14 +1104,14 @@ ClangASTContext::GetTranslationUnitDecl (clang::ASTContext *ast) return ast->getTranslationUnitDecl(); } -ClangASTType +CompilerType ClangASTContext::CopyType (ASTContext *dst_ast, - ClangASTType src) + CompilerType src) { FileSystemOptions file_system_options; ClangASTContext *src_ast = src.GetTypeSystem()->AsClangASTContext(); if (src_ast == nullptr) - return ClangASTType(); + return CompilerType(); FileManager file_manager (file_system_options); ASTImporter importer(*dst_ast, file_manager, *src_ast->getASTContext(), file_manager, @@ -1119,7 +1119,7 @@ ClangASTContext::CopyType (ASTContext *dst_ast, QualType dst (importer.Import(GetQualType(src))); - return ClangASTType (dst_ast, dst); + return CompilerType (dst_ast, dst); } @@ -1138,8 +1138,8 @@ ClangASTContext::CopyDecl (ASTContext *dst_ast, } bool -ClangASTContext::AreTypesSame (ClangASTType type1, - ClangASTType type2, +ClangASTContext::AreTypesSame (CompilerType type1, + CompilerType type2, bool ignore_qualifiers) { TypeSystem *ast = type1.GetTypeSystem(); @@ -1161,18 +1161,18 @@ ClangASTContext::AreTypesSame (ClangASTType type1, return ast->AsClangASTContext()->getASTContext()->hasSameType (type1_qual, type2_qual); } -ClangASTType +CompilerType ClangASTContext::GetTypeForDecl (clang::NamedDecl *decl) { if (clang::ObjCInterfaceDecl *interface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(decl)) return GetTypeForDecl(interface_decl); if (clang::TagDecl *tag_decl = llvm::dyn_cast<clang::TagDecl>(decl)) return GetTypeForDecl(tag_decl); - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetTypeForDecl (TagDecl *decl) { // No need to call the getASTContext() accessor (which can create the AST @@ -1180,11 +1180,11 @@ ClangASTContext::GetTypeForDecl (TagDecl *decl) // AST if our AST didn't already exist... ASTContext *ast = &decl->getASTContext(); if (ast) - return ClangASTType (ast, ast->getTagDeclType(decl)); - return ClangASTType(); + return CompilerType (ast, ast->getTagDeclType(decl)); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetTypeForDecl (ObjCInterfaceDecl *decl) { // No need to call the getASTContext() accessor (which can create the AST @@ -1192,13 +1192,13 @@ ClangASTContext::GetTypeForDecl (ObjCInterfaceDecl *decl) // AST if our AST didn't already exist... ASTContext *ast = &decl->getASTContext(); if (ast) - return ClangASTType (ast, ast->getObjCInterfaceType(decl)); - return ClangASTType(); + return CompilerType (ast, ast->getObjCInterfaceType(decl)); + return CompilerType(); } #pragma mark Structure, Unions, Classes -ClangASTType +CompilerType ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type, const char *name, @@ -1249,9 +1249,9 @@ ClangASTContext::CreateRecordType (DeclContext *decl_ctx, if (decl_ctx) decl_ctx->addDecl (decl); - return ClangASTType(ast, ast->getTagDeclType(decl)); + return CompilerType(ast, ast->getTagDeclType(decl)); } - return ClangASTType(); + return CompilerType(); } static TemplateParameterList * @@ -1453,16 +1453,16 @@ ClangASTContext::CreateClassTemplateSpecializationDecl (DeclContext *decl_ctx, return class_template_specialization_decl; } -ClangASTType +CompilerType ClangASTContext::CreateClassTemplateSpecializationType (ClassTemplateSpecializationDecl *class_template_specialization_decl) { if (class_template_specialization_decl) { ASTContext *ast = getASTContext(); if (ast) - return ClangASTType(ast, ast->getTagDeclType(class_template_specialization_decl)); + return CompilerType(ast, ast->getTagDeclType(class_template_specialization_decl)); } - return ClangASTType(); + return CompilerType(); } static inline bool @@ -1590,7 +1590,7 @@ ClangASTContext::RecordHasFields (const RecordDecl *record_decl) #pragma mark Objective C Classes -ClangASTType +CompilerType ClangASTContext::CreateObjCClass ( const char *name, @@ -1619,7 +1619,7 @@ ClangASTContext::CreateObjCClass if (decl && metadata) SetMetadata(ast, decl, *metadata); - return ClangASTType (ast, ast->getObjCInterfaceType(decl)); + return CompilerType (ast, ast->getObjCInterfaceType(decl)); } static inline bool @@ -1764,7 +1764,7 @@ ClangASTContext::GetUniqueNamespaceDeclaration (const char *name, DeclContext *d FunctionDecl * ClangASTContext::CreateFunctionDeclaration (DeclContext *decl_ctx, const char *name, - const ClangASTType &function_clang_type, + const CompilerType &function_clang_type, int storage, bool is_inline) { @@ -1815,10 +1815,10 @@ ClangASTContext::CreateFunctionDeclaration (DeclContext *decl_ctx, return func_decl; } -ClangASTType +CompilerType ClangASTContext::CreateFunctionType (ASTContext *ast, - const ClangASTType& result_type, - const ClangASTType *args, + const CompilerType& result_type, + const CompilerType *args, unsigned num_args, bool is_variadic, unsigned type_quals) @@ -1835,13 +1835,13 @@ ClangASTContext::CreateFunctionType (ASTContext *ast, proto_info.TypeQuals = type_quals; proto_info.RefQualifier = RQ_None; - return ClangASTType (ast, ast->getFunctionType (GetQualType(result_type), + return CompilerType (ast, ast->getFunctionType (GetQualType(result_type), qual_type_args, proto_info)); } ParmVarDecl * -ClangASTContext::CreateParameterDeclaration (const char *name, const ClangASTType ¶m_type, int storage) +ClangASTContext::CreateParameterDeclaration (const char *name, const CompilerType ¶m_type, int storage) { ASTContext *ast = getASTContext(); assert (ast != nullptr); @@ -1866,8 +1866,8 @@ ClangASTContext::SetFunctionParameters (FunctionDecl *function_decl, ParmVarDecl #pragma mark Array Types -ClangASTType -ClangASTContext::CreateArrayType (const ClangASTType &element_type, +CompilerType +ClangASTContext::CreateArrayType (const CompilerType &element_type, size_t element_count, bool is_vector) { @@ -1878,7 +1878,7 @@ ClangASTContext::CreateArrayType (const ClangASTType &element_type, if (is_vector) { - return ClangASTType (ast, ast->getExtVectorType(GetQualType(element_type), element_count)); + return CompilerType (ast, ast->getExtVectorType(GetQualType(element_type), element_count)); } else { @@ -1886,28 +1886,28 @@ ClangASTContext::CreateArrayType (const ClangASTType &element_type, llvm::APInt ap_element_count (64, element_count); if (element_count == 0) { - return ClangASTType (ast, ast->getIncompleteArrayType (GetQualType(element_type), + return CompilerType (ast, ast->getIncompleteArrayType (GetQualType(element_type), ArrayType::Normal, 0)); } else { - return ClangASTType (ast, ast->getConstantArrayType (GetQualType(element_type), + return CompilerType (ast, ast->getConstantArrayType (GetQualType(element_type), ap_element_count, ArrayType::Normal, 0)); } } } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetOrCreateStructForIdentifier (const ConstString &type_name, - const std::initializer_list< std::pair < const char *, ClangASTType > >& type_fields, + const std::initializer_list< std::pair < const char *, CompilerType > >& type_fields, bool packed) { - ClangASTType type; + CompilerType type; if ((type = GetTypeForIdentifier<clang::CXXRecordDecl>(type_name)).IsValid()) return type; type = CreateRecordType(nullptr, lldb::eAccessPublic, type_name.GetCString(), clang::TTK_Struct, lldb::eLanguageTypeC); @@ -1922,13 +1922,13 @@ ClangASTContext::GetOrCreateStructForIdentifier (const ConstString &type_name, #pragma mark Enumeration Types -ClangASTType +CompilerType ClangASTContext::CreateEnumerationType ( const char *name, DeclContext *decl_ctx, const Declaration &decl, - const ClangASTType &integer_clang_type + const CompilerType &integer_clang_type ) { // TODO: Do something intelligent with the Declaration object passed in @@ -1957,9 +1957,9 @@ ClangASTContext::CreateEnumerationType enum_decl->setAccess(AS_public); // TODO respect what's in the debug info - return ClangASTType (ast, ast->getTagDeclType(enum_decl)); + return CompilerType (ast, ast->getTagDeclType(enum_decl)); } - return ClangASTType(); + return CompilerType(); } // Disable this for now since I can't seem to get a nicely formatted float @@ -2003,7 +2003,7 @@ ClangASTContext::CreateEnumerationType // return false; //} -ClangASTType +CompilerType ClangASTContext::GetIntTypeFromBitSize (clang::ASTContext *ast, size_t bit_size, bool is_signed) { @@ -2012,71 +2012,71 @@ ClangASTContext::GetIntTypeFromBitSize (clang::ASTContext *ast, if (is_signed) { if (bit_size == ast->getTypeSize(ast->SignedCharTy)) - return ClangASTType(ast, ast->SignedCharTy); + return CompilerType(ast, ast->SignedCharTy); if (bit_size == ast->getTypeSize(ast->ShortTy)) - return ClangASTType(ast, ast->ShortTy); + return CompilerType(ast, ast->ShortTy); if (bit_size == ast->getTypeSize(ast->IntTy)) - return ClangASTType(ast, ast->IntTy); + return CompilerType(ast, ast->IntTy); if (bit_size == ast->getTypeSize(ast->LongTy)) - return ClangASTType(ast, ast->LongTy); + return CompilerType(ast, ast->LongTy); if (bit_size == ast->getTypeSize(ast->LongLongTy)) - return ClangASTType(ast, ast->LongLongTy); + return CompilerType(ast, ast->LongLongTy); if (bit_size == ast->getTypeSize(ast->Int128Ty)) - return ClangASTType(ast, ast->Int128Ty); + return CompilerType(ast, ast->Int128Ty); } else { if (bit_size == ast->getTypeSize(ast->UnsignedCharTy)) - return ClangASTType(ast, ast->UnsignedCharTy); + return CompilerType(ast, ast->UnsignedCharTy); if (bit_size == ast->getTypeSize(ast->UnsignedShortTy)) - return ClangASTType(ast, ast->UnsignedShortTy); + return CompilerType(ast, ast->UnsignedShortTy); if (bit_size == ast->getTypeSize(ast->UnsignedIntTy)) - return ClangASTType(ast, ast->UnsignedIntTy); + return CompilerType(ast, ast->UnsignedIntTy); if (bit_size == ast->getTypeSize(ast->UnsignedLongTy)) - return ClangASTType(ast, ast->UnsignedLongTy); + return CompilerType(ast, ast->UnsignedLongTy); if (bit_size == ast->getTypeSize(ast->UnsignedLongLongTy)) - return ClangASTType(ast, ast->UnsignedLongLongTy); + return CompilerType(ast, ast->UnsignedLongLongTy); if (bit_size == ast->getTypeSize(ast->UnsignedInt128Ty)) - return ClangASTType(ast, ast->UnsignedInt128Ty); + return CompilerType(ast, ast->UnsignedInt128Ty); } } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetPointerSizedIntType (clang::ASTContext *ast, bool is_signed) { if (ast) return GetIntTypeFromBitSize(ast, ast->getTypeSize(ast->VoidPtrTy), is_signed); - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetFloatTypeFromBitSize (clang::ASTContext *ast, size_t bit_size) { if (ast) { if (bit_size == ast->getTypeSize(ast->FloatTy)) - return ClangASTType(ast, ast->FloatTy); + return CompilerType(ast, ast->FloatTy); else if (bit_size == ast->getTypeSize(ast->DoubleTy)) - return ClangASTType(ast, ast->DoubleTy); + return CompilerType(ast, ast->DoubleTy); else if (bit_size == ast->getTypeSize(ast->LongDoubleTy)) - return ClangASTType(ast, ast->LongDoubleTy); + return CompilerType(ast, ast->LongDoubleTy); else if (bit_size == ast->getTypeSize(ast->HalfTy)) - return ClangASTType(ast, ast->HalfTy); + return CompilerType(ast, ast->HalfTy); } - return ClangASTType(); + return CompilerType(); } bool @@ -2482,7 +2482,7 @@ ClangASTContext::IsAggregateType (void* type) bool ClangASTContext::IsArrayType (void* type, - ClangASTType *element_type_ptr, + CompilerType *element_type_ptr, uint64_t *size, bool *is_incomplete) { @@ -2551,7 +2551,7 @@ ClangASTContext::IsArrayType (void* type, bool ClangASTContext::IsVectorType (void* type, - ClangASTType *element_type, + CompilerType *element_type, uint64_t *size) { clang::QualType qual_type (GetCanonicalQualType(type)); @@ -2567,7 +2567,7 @@ ClangASTContext::IsVectorType (void* type, if (size) *size = vector_type->getNumElements(); if (element_type) - *element_type = ClangASTType(getASTContext(), vector_type->getElementType()); + *element_type = CompilerType(getASTContext(), vector_type->getElementType()); } return true; } @@ -2580,7 +2580,7 @@ ClangASTContext::IsVectorType (void* type, if (size) *size = ext_vector_type->getNumElements(); if (element_type) - *element_type = ClangASTType(getASTContext(), ext_vector_type->getElementType()); + *element_type = CompilerType(getASTContext(), ext_vector_type->getElementType()); } return true; } @@ -2631,7 +2631,7 @@ ClangASTContext::IsConst(void* type) bool ClangASTContext::IsCStringType (void* type, uint32_t &length) { - ClangASTType pointee_or_element_clang_type; + CompilerType pointee_or_element_clang_type; length = 0; Flags type_flags (GetTypeInfo (type, &pointee_or_element_clang_type)); @@ -2701,7 +2701,7 @@ ClangASTContext::IsFunctionType (void* type, bool *is_variadic_ptr) // Used to detect "Homogeneous Floating-point Aggregates" uint32_t -ClangASTContext::IsHomogeneousAggregate (void* type, ClangASTType* base_type_ptr) +ClangASTContext::IsHomogeneousAggregate (void* type, CompilerType* base_type_ptr) { if (!type) return 0; @@ -2777,7 +2777,7 @@ ClangASTContext::IsHomogeneousAggregate (void* type, ClangASTType* base_type_ptr ++num_fields; } if (base_type_ptr) - *base_type_ptr = ClangASTType (getASTContext(), base_qual_type); + *base_type_ptr = CompilerType (getASTContext(), base_qual_type); return num_fields; } } @@ -2808,7 +2808,7 @@ ClangASTContext::GetNumberOfFunctionArguments (void* type) return 0; } -ClangASTType +CompilerType ClangASTContext::GetFunctionArgumentAtIndex (void* type, const size_t index) { if (type) @@ -2818,10 +2818,10 @@ ClangASTContext::GetFunctionArgumentAtIndex (void* type, const size_t index) if (func) { if (index < func->getNumParams()) - return ClangASTType(getASTContext(), func->getParamType(index)); + return CompilerType(getASTContext(), func->getParamType(index)); } } - return ClangASTType(); + return CompilerType(); } bool @@ -2882,7 +2882,7 @@ ClangASTContext::IsIntegerType (void* type, bool &is_signed) } bool -ClangASTContext::IsPointerType (void* type, ClangASTType *pointee_type) +ClangASTContext::IsPointerType (void* type, CompilerType *pointee_type) { if (type) { @@ -2933,7 +2933,7 @@ ClangASTContext::IsPointerType (void* type, ClangASTType *pointee_type) bool -ClangASTContext::IsPointerOrReferenceType (void* type, ClangASTType *pointee_type) +ClangASTContext::IsPointerOrReferenceType (void* type, CompilerType *pointee_type) { if (type) { @@ -2992,7 +2992,7 @@ ClangASTContext::IsPointerOrReferenceType (void* type, ClangASTType *pointee_typ bool -ClangASTContext::IsReferenceType (void* type, ClangASTType *pointee_type, bool* is_rvalue) +ClangASTContext::IsReferenceType (void* type, CompilerType *pointee_type, bool* is_rvalue) { if (type) { @@ -3101,7 +3101,7 @@ ClangASTContext::IsDefined(void* type) } bool -ClangASTContext::IsObjCClassType (const ClangASTType& type) +ClangASTContext::IsObjCClassType (const CompilerType& type) { if (type) { @@ -3116,7 +3116,7 @@ ClangASTContext::IsObjCClassType (const ClangASTType& type) } bool -ClangASTContext::IsObjCObjectOrInterfaceType (const ClangASTType& type) +ClangASTContext::IsObjCObjectOrInterfaceType (const CompilerType& type) { if (type) return GetCanonicalQualType(type)->isObjCObjectOrInterfaceType(); @@ -3154,7 +3154,7 @@ ClangASTContext::IsPolymorphicClass (void* type) } bool -ClangASTContext::IsPossibleDynamicType (void* type, ClangASTType *dynamic_pointee_type, +ClangASTContext::IsPossibleDynamicType (void* type, CompilerType *dynamic_pointee_type, bool check_cplusplus, bool check_objc) { @@ -3295,7 +3295,7 @@ ClangASTContext::IsPossibleDynamicType (void* type, ClangASTType *dynamic_pointe success = metadata->GetIsDynamicCXXType(); else { - is_complete = ClangASTType(getASTContext(), pointee_qual_type).GetCompleteType(); + is_complete = CompilerType(getASTContext(), pointee_qual_type).GetCompleteType(); if (is_complete) success = cxx_record_decl->isDynamicClass(); else @@ -3360,7 +3360,7 @@ ClangASTContext::IsVoidType (void* type) } bool -ClangASTContext::GetCXXClassName (const ClangASTType& type, std::string &class_name) +ClangASTContext::GetCXXClassName (const CompilerType& type, std::string &class_name) { if (type) { @@ -3379,7 +3379,7 @@ ClangASTContext::GetCXXClassName (const ClangASTType& type, std::string &class_n bool -ClangASTContext::IsCXXClassType (const ClangASTType& type) +ClangASTContext::IsCXXClassType (const CompilerType& type) { if (!type) return false; @@ -3403,7 +3403,7 @@ ClangASTContext::IsBeingDefined (void* type) } bool -ClangASTContext::IsObjCObjectPointerType (const ClangASTType& type, ClangASTType *class_type_ptr) +ClangASTContext::IsObjCObjectPointerType (const CompilerType& type, CompilerType *class_type_ptr) { if (!type) return false; @@ -3432,7 +3432,7 @@ ClangASTContext::IsObjCObjectPointerType (const ClangASTType& type, ClangASTType } bool -ClangASTContext::GetObjCClassName (const ClangASTType& type, std::string &class_name) +ClangASTContext::GetObjCClassName (const CompilerType& type, std::string &class_name) { if (!type) return false; @@ -3491,7 +3491,7 @@ ClangASTContext::GetTypeName (void* type) } uint32_t -ClangASTContext::GetTypeInfo (void* type, ClangASTType *pointee_or_element_clang_type) +ClangASTContext::GetTypeInfo (void* type, CompilerType *pointee_or_element_clang_type) { if (!type) return 0; @@ -3602,9 +3602,9 @@ ClangASTContext::GetTypeInfo (void* type, ClangASTType *pointee_or_element_clang return eTypeIsEnumeration | eTypeHasValue; case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeInfo (pointee_or_element_clang_type); + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeInfo (pointee_or_element_clang_type); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeInfo (pointee_or_element_clang_type); + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeInfo (pointee_or_element_clang_type); case clang::Type::FunctionProto: return eTypeIsFuncPrototype | eTypeHasValue; case clang::Type::FunctionNoProto: return eTypeIsFuncPrototype | eTypeHasValue; @@ -3642,7 +3642,7 @@ ClangASTContext::GetTypeInfo (void* type, ClangASTType *pointee_or_element_clang case clang::Type::TemplateSpecialization: return eTypeIsTemplate; case clang::Type::Typedef: - return eTypeIsTypedef | ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTypeInfo (pointee_or_element_clang_type); + return eTypeIsTypedef | CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTypeInfo (pointee_or_element_clang_type); case clang::Type::TypeOfExpr: return 0; case clang::Type::TypeOf: return 0; case clang::Type::UnresolvedUsing: return 0; @@ -3746,7 +3746,7 @@ ClangASTContext::GetMinimumLanguage (void* type) } break; case clang::Type::Typedef: - return ClangASTType(getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetMinimumLanguage(); + return CompilerType(getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetMinimumLanguage(); } } return lldb::eLanguageTypeC; @@ -3802,9 +3802,9 @@ ClangASTContext::GetTypeClass (void* type) case clang::Type::Typedef: return lldb::eTypeClassTypedef; case clang::Type::UnresolvedUsing: break; case clang::Type::Paren: - return ClangASTType(getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeClass(); + return CompilerType(getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeClass(); case clang::Type::Elaborated: - return ClangASTType(getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeClass(); + return CompilerType(getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeClass(); case clang::Type::Attributed: break; case clang::Type::TemplateTypeParm: break; @@ -3843,43 +3843,43 @@ ClangASTContext::GetTypeQualifiers(void* type) // Creating related types //---------------------------------------------------------------------- -ClangASTType -ClangASTContext::AddConstModifier (const ClangASTType& type) +CompilerType +ClangASTContext::AddConstModifier (const CompilerType& type) { if (type && type.GetTypeSystem()->AsClangASTContext()) { clang::QualType result(GetQualType(type)); result.addConst(); - return ClangASTType (type.GetTypeSystem(), result.getAsOpaquePtr()); + return CompilerType (type.GetTypeSystem(), result.getAsOpaquePtr()); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::AddRestrictModifier (const ClangASTType& type) +CompilerType +ClangASTContext::AddRestrictModifier (const CompilerType& type) { if (type && type.GetTypeSystem()->AsClangASTContext()) { clang::QualType result(GetQualType(type)); result.getQualifiers().setRestrict (true); - return ClangASTType (type.GetTypeSystem(), result.getAsOpaquePtr()); + return CompilerType (type.GetTypeSystem(), result.getAsOpaquePtr()); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::AddVolatileModifier (const ClangASTType& type) +CompilerType +ClangASTContext::AddVolatileModifier (const CompilerType& type) { if (type && type.GetTypeSystem()->AsClangASTContext()) { clang::QualType result(GetQualType(type)); result.getQualifiers().setVolatile (true); - return ClangASTType (type.GetTypeSystem(), result.getAsOpaquePtr()); + return CompilerType (type.GetTypeSystem(), result.getAsOpaquePtr()); } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetArrayElementType (void* type, uint64_t *stride) { if (type) @@ -3889,9 +3889,9 @@ ClangASTContext::GetArrayElementType (void* type, uint64_t *stride) const clang::Type *array_eletype = qual_type.getTypePtr()->getArrayElementTypeNoTypeQual(); if (!array_eletype) - return ClangASTType(); + return CompilerType(); - ClangASTType element_type (getASTContext(), array_eletype->getCanonicalTypeUnqualified()); + CompilerType element_type (getASTContext(), array_eletype->getCanonicalTypeUnqualified()); // TODO: the real stride will be >= this value.. find the real one! if (stride) @@ -3900,15 +3900,15 @@ ClangASTContext::GetArrayElementType (void* type, uint64_t *stride) return element_type; } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetCanonicalType (void* type) { if (type) - return ClangASTType (getASTContext(), GetCanonicalQualType(type)); - return ClangASTType(); + return CompilerType (getASTContext(), GetCanonicalQualType(type)); + return CompilerType(); } static clang::QualType @@ -3924,12 +3924,12 @@ GetFullyUnqualifiedType_Impl (clang::ASTContext *ast, clang::QualType qual_type) return qual_type; } -ClangASTType +CompilerType ClangASTContext::GetFullyUnqualifiedType (void* type) { if (type) - return ClangASTType(getASTContext(), GetFullyUnqualifiedType_Impl(getASTContext(), GetQualType(type))); - return ClangASTType(); + return CompilerType(getASTContext(), GetFullyUnqualifiedType_Impl(getASTContext(), GetQualType(type))); + return CompilerType(); } @@ -3945,7 +3945,7 @@ ClangASTContext::GetFunctionArgumentCount (void* type) return -1; } -ClangASTType +CompilerType ClangASTContext::GetFunctionArgumentTypeAtIndex (void* type, size_t idx) { if (type) @@ -3955,13 +3955,13 @@ ClangASTContext::GetFunctionArgumentTypeAtIndex (void* type, size_t idx) { const uint32_t num_args = func->getNumParams(); if (idx < num_args) - return ClangASTType(getASTContext(), func->getParamType(idx)); + return CompilerType(getASTContext(), func->getParamType(idx)); } } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetFunctionReturnType (void* type) { if (type) @@ -3969,9 +3969,9 @@ ClangASTContext::GetFunctionReturnType (void* type) clang::QualType qual_type(GetCanonicalQualType(type)); const clang::FunctionProtoType* func = llvm::dyn_cast<clang::FunctionProtoType>(qual_type.getTypePtr()); if (func) - return ClangASTType(getASTContext(), func->getReturnType()); + return CompilerType(getASTContext(), func->getReturnType()); } - return ClangASTType(); + return CompilerType(); } size_t @@ -4023,13 +4023,13 @@ ClangASTContext::GetNumMemberFunctions (void* type) case clang::Type::Typedef: - return ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumMemberFunctions(); + return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumMemberFunctions(); case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumMemberFunctions(); + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumMemberFunctions(); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumMemberFunctions(); + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumMemberFunctions(); default: break; @@ -4043,7 +4043,7 @@ ClangASTContext::GetMemberFunctionAtIndex (void* type, size_t idx) { std::string name(""); MemberFunctionKind kind(MemberFunctionKind::eMemberFunctionKindUnknown); - ClangASTType clang_type{}; + CompilerType clang_type{}; clang::ObjCMethodDecl *method_decl(nullptr); if (type) { @@ -4078,7 +4078,7 @@ ClangASTContext::GetMemberFunctionAtIndex (void* type, size_t idx) kind = lldb::eMemberFunctionKindDestructor; else kind = lldb::eMemberFunctionKindInstanceMethod; - clang_type = ClangASTType(getASTContext(),method_decl->getType()); + clang_type = CompilerType(getASTContext(),method_decl->getType()); } } } @@ -4168,40 +4168,40 @@ ClangASTContext::GetMemberFunctionAtIndex (void* type, size_t idx) return TypeMemberFunctionImpl(); } -ClangASTType -ClangASTContext::GetLValueReferenceType (const ClangASTType& type) +CompilerType +ClangASTContext::GetLValueReferenceType (const CompilerType& type) { if (type) { ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (ast) - return ClangASTType(ast->getASTContext(), ast->getASTContext()->getLValueReferenceType(GetQualType(type))); + return CompilerType(ast->getASTContext(), ast->getASTContext()->getLValueReferenceType(GetQualType(type))); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::GetRValueReferenceType (const ClangASTType& type) +CompilerType +ClangASTContext::GetRValueReferenceType (const CompilerType& type) { if (type) { ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (ast) - return ClangASTType(ast->getASTContext(), ast->getASTContext()->getRValueReferenceType(GetQualType(type))); + return CompilerType(ast->getASTContext(), ast->getASTContext()->getRValueReferenceType(GetQualType(type))); } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetNonReferenceType (void* type) { if (type) - return ClangASTType(getASTContext(), GetQualType(type).getNonReferenceType()); - return ClangASTType(); + return CompilerType(getASTContext(), GetQualType(type).getNonReferenceType()); + return CompilerType(); } -ClangASTType -ClangASTContext::CreateTypedefType (const ClangASTType& type, +CompilerType +ClangASTContext::CreateTypedefType (const CompilerType& type, const char *typedef_name, clang::DeclContext *decl_ctx) { @@ -4209,7 +4209,7 @@ ClangASTContext::CreateTypedefType (const ClangASTType& type, { ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (!ast) - return ClangASTType(); + return CompilerType(); clang::ASTContext* clang_ast = ast->getASTContext(); clang::QualType qual_type (GetQualType(type)); if (decl_ctx == nullptr) @@ -4224,24 +4224,24 @@ ClangASTContext::CreateTypedefType (const ClangASTType& type, decl->setAccess(clang::AS_public); // TODO respect proper access specifier // Get a uniqued clang::QualType for the typedef decl type - return ClangASTType (clang_ast, clang_ast->getTypedefType (decl)); + return CompilerType (clang_ast, clang_ast->getTypedefType (decl)); } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetPointeeType (void* type) { if (type) { clang::QualType qual_type(GetQualType(type)); - return ClangASTType (getASTContext(), qual_type.getTypePtr()->getPointeeType()); + return CompilerType (getASTContext(), qual_type.getTypePtr()->getPointeeType()); } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetPointerType (void* type) { if (type) @@ -4253,35 +4253,35 @@ ClangASTContext::GetPointerType (void* type) { case clang::Type::ObjCObject: case clang::Type::ObjCInterface: - return ClangASTType(getASTContext(), getASTContext()->getObjCObjectPointerType(qual_type)); + return CompilerType(getASTContext(), getASTContext()->getObjCObjectPointerType(qual_type)); default: - return ClangASTType(getASTContext(), getASTContext()->getPointerType(qual_type)); + return CompilerType(getASTContext(), getASTContext()->getPointerType(qual_type)); } } - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ClangASTContext::GetTypedefedType (void* type) { if (type) { const clang::TypedefType *typedef_type = llvm::dyn_cast<clang::TypedefType>(GetQualType(type)); if (typedef_type) - return ClangASTType (getASTContext(), typedef_type->getDecl()->getUnderlyingType()); + return CompilerType (getASTContext(), typedef_type->getDecl()->getUnderlyingType()); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::RemoveFastQualifiers (const ClangASTType& type) +CompilerType +ClangASTContext::RemoveFastQualifiers (const CompilerType& type) { if (type && type.GetTypeSystem()->AsClangASTContext()) { clang::QualType qual_type(GetQualType(type)); qual_type.getQualifiers().removeFastQualifiers(); - return ClangASTType (type.GetTypeSystem(), qual_type.getAsOpaquePtr()); + return CompilerType (type.GetTypeSystem(), qual_type.getAsOpaquePtr()); } return type; } @@ -4291,12 +4291,12 @@ ClangASTContext::RemoveFastQualifiers (const ClangASTType& type) // Create related types using the current type's AST //---------------------------------------------------------------------- -ClangASTType +CompilerType ClangASTContext::GetBasicTypeFromAST (void* type, lldb::BasicType basic_type) { if (type) return ClangASTContext::GetBasicType(getASTContext(), basic_type); - return ClangASTType(); + return CompilerType(); } //---------------------------------------------------------------------- // Exploring the type @@ -4321,7 +4321,7 @@ ClangASTContext::GetBitSize (void* type, ExecutionContextScope *exe_scope) if (objc_runtime) { uint64_t bit_size = 0; - if (objc_runtime->GetTypeBitSize(ClangASTType(getASTContext(), qual_type), bit_size)) + if (objc_runtime->GetTypeBitSize(CompilerType(getASTContext(), qual_type), bit_size)) return bit_size; } } @@ -4473,7 +4473,7 @@ ClangASTContext::GetEncoding (void* type, uint64_t &count) { const clang::ComplexType *complex_type = qual_type->getAsComplexIntegerType(); if (complex_type) - encoding = ClangASTType(getASTContext(), complex_type->getElementType()).GetEncoding(count); + encoding = CompilerType(getASTContext(), complex_type->getElementType()).GetEncoding(count); else encoding = lldb::eEncodingSint; } @@ -4485,13 +4485,13 @@ ClangASTContext::GetEncoding (void* type, uint64_t &count) case clang::Type::Record: break; case clang::Type::Enum: return lldb::eEncodingSint; case clang::Type::Typedef: - return ClangASTType(getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetEncoding(count); + return CompilerType(getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetEncoding(count); case clang::Type::Elaborated: - return ClangASTType(getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetEncoding(count); + return CompilerType(getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetEncoding(count); case clang::Type::Paren: - return ClangASTType(getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetEncoding(count); + return CompilerType(getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetEncoding(count); case clang::Type::DependentSizedArray: case clang::Type::DependentSizedExtVector: @@ -4620,13 +4620,13 @@ ClangASTContext::GetFormat (void* type) case clang::Type::Record: break; case clang::Type::Enum: return lldb::eFormatEnum; case clang::Type::Typedef: - return ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetFormat(); + return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetFormat(); case clang::Type::Auto: - return ClangASTType (getASTContext(), llvm::cast<clang::AutoType>(qual_type)->desugar()).GetFormat(); + return CompilerType (getASTContext(), llvm::cast<clang::AutoType>(qual_type)->desugar()).GetFormat(); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetFormat(); + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetFormat(); case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetFormat(); + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetFormat(); case clang::Type::DependentSizedArray: case clang::Type::DependentSizedExtVector: case clang::Type::UnresolvedUsing: @@ -4775,7 +4775,7 @@ ClangASTContext::GetNumChildren (void* type, bool omit_empty_base_classes) { const clang::ObjCObjectPointerType *pointer_type = llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr()); clang::QualType pointee_type = pointer_type->getPointeeType(); - uint32_t num_pointee_children = ClangASTType (getASTContext(),pointee_type).GetNumChildren (omit_empty_base_classes); + uint32_t num_pointee_children = CompilerType (getASTContext(),pointee_type).GetNumChildren (omit_empty_base_classes); // If this type points to a simple type, then it has 1 child if (num_pointee_children == 0) num_children = 1; @@ -4797,7 +4797,7 @@ ClangASTContext::GetNumChildren (void* type, bool omit_empty_base_classes) { const clang::PointerType *pointer_type = llvm::cast<clang::PointerType>(qual_type.getTypePtr()); clang::QualType pointee_type (pointer_type->getPointeeType()); - uint32_t num_pointee_children = ClangASTType (getASTContext(),pointee_type).GetNumChildren (omit_empty_base_classes); + uint32_t num_pointee_children = CompilerType (getASTContext(),pointee_type).GetNumChildren (omit_empty_base_classes); if (num_pointee_children == 0) { // We have a pointer to a pointee type that claims it has no children. @@ -4814,7 +4814,7 @@ ClangASTContext::GetNumChildren (void* type, bool omit_empty_base_classes) { const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr()); clang::QualType pointee_type = reference_type->getPointeeType(); - uint32_t num_pointee_children = ClangASTType (getASTContext(), pointee_type).GetNumChildren (omit_empty_base_classes); + uint32_t num_pointee_children = CompilerType (getASTContext(), pointee_type).GetNumChildren (omit_empty_base_classes); // If this type points to a simple type, then it has 1 child if (num_pointee_children == 0) num_children = 1; @@ -4825,15 +4825,15 @@ ClangASTContext::GetNumChildren (void* type, bool omit_empty_base_classes) case clang::Type::Typedef: - num_children = ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumChildren (omit_empty_base_classes); + num_children = CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumChildren (omit_empty_base_classes); break; case clang::Type::Elaborated: - num_children = ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumChildren (omit_empty_base_classes); + num_children = CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumChildren (omit_empty_base_classes); break; case clang::Type::Paren: - num_children = ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumChildren (omit_empty_base_classes); + num_children = CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumChildren (omit_empty_base_classes); break; default: break; @@ -4908,7 +4908,7 @@ ClangASTContext::GetBasicTypeEnumeration (void* type) #pragma mark Aggregate Types uint32_t -ClangASTContext::GetNumDirectBaseClasses (const ClangASTType& type) +ClangASTContext::GetNumDirectBaseClasses (const CompilerType& type) { if (!type) return 0; @@ -4963,15 +4963,15 @@ ClangASTContext::GetNumDirectBaseClasses (const ClangASTType& type) case clang::Type::Typedef: - count = GetNumDirectBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType())); + count = GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType())); break; case clang::Type::Elaborated: - count = GetNumDirectBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())); + count = GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())); break; case clang::Type::Paren: - return GetNumDirectBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar())); + return GetNumDirectBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar())); default: break; @@ -4980,7 +4980,7 @@ ClangASTContext::GetNumDirectBaseClasses (const ClangASTType& type) } uint32_t -ClangASTContext::GetNumVirtualBaseClasses (const ClangASTType& type) +ClangASTContext::GetNumVirtualBaseClasses (const CompilerType& type) { if (!type) return 0; @@ -5003,15 +5003,15 @@ ClangASTContext::GetNumVirtualBaseClasses (const ClangASTType& type) break; case clang::Type::Typedef: - count = GetNumVirtualBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType())); + count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType())); break; case clang::Type::Elaborated: - count = GetNumVirtualBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())); + count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())); break; case clang::Type::Paren: - count = GetNumVirtualBaseClasses(ClangASTType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar())); + count = GetNumVirtualBaseClasses(CompilerType (ast->getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar())); break; default: @@ -5051,15 +5051,15 @@ ClangASTContext::GetNumFields (void* type) break; case clang::Type::Typedef: - count = ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumFields(); + count = CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumFields(); break; case clang::Type::Elaborated: - count = ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumFields(); + count = CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumFields(); break; case clang::Type::Paren: - count = ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumFields(); + count = CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumFields(); break; case clang::Type::ObjCObjectPointer: @@ -5097,14 +5097,14 @@ ClangASTContext::GetNumFields (void* type) return count; } -ClangASTType -ClangASTContext::GetDirectBaseClassAtIndex (const ClangASTType& type, size_t idx, uint32_t *bit_offset_ptr) +CompilerType +ClangASTContext::GetDirectBaseClassAtIndex (const CompilerType& type, size_t idx, uint32_t *bit_offset_ptr) { if (!type) - return ClangASTType(); + return CompilerType(); ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext(); if (!ast) - return ClangASTType(); + return CompilerType(); clang::QualType qual_type(GetCanonicalQualType(type)); const clang::Type::TypeClass type_class = qual_type->getTypeClass(); @@ -5133,7 +5133,7 @@ ClangASTContext::GetDirectBaseClassAtIndex (const ClangASTType& type, size_t idx else *bit_offset_ptr = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8; } - return ClangASTType (ast, base_class->getType().getAsOpaquePtr()); + return CompilerType (ast, base_class->getType().getAsOpaquePtr()); } } } @@ -5158,7 +5158,7 @@ ClangASTContext::GetDirectBaseClassAtIndex (const ClangASTType& type, size_t idx { if (bit_offset_ptr) *bit_offset_ptr = 0; - return ClangASTType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl)); + return CompilerType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl)); } } } @@ -5179,7 +5179,7 @@ ClangASTContext::GetDirectBaseClassAtIndex (const ClangASTType& type, size_t idx { if (bit_offset_ptr) *bit_offset_ptr = 0; - return ClangASTType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl)); + return CompilerType (ast->getASTContext(), ast->getASTContext()->getObjCInterfaceType(superclass_interface_decl)); } } } @@ -5188,28 +5188,28 @@ ClangASTContext::GetDirectBaseClassAtIndex (const ClangASTType& type, size_t idx case clang::Type::Typedef: - return GetDirectBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr); case clang::Type::Elaborated: - return GetDirectBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr); case clang::Type::Paren: - return GetDirectBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetDirectBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr); default: break; } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::GetVirtualBaseClassAtIndex (const ClangASTType& type, size_t idx, uint32_t *bit_offset_ptr) +CompilerType +ClangASTContext::GetVirtualBaseClassAtIndex (const CompilerType& type, size_t idx, uint32_t *bit_offset_ptr) { if (!type) - return ClangASTType(); + return CompilerType(); ClangASTContext *ast = type.GetTypeSystem()->AsClangASTContext(); if (!ast) - return ClangASTType(); + return CompilerType(); clang::QualType qual_type(GetCanonicalQualType(type)); const clang::Type::TypeClass type_class = qual_type->getTypeClass(); @@ -5236,7 +5236,7 @@ ClangASTContext::GetVirtualBaseClassAtIndex (const ClangASTType& type, size_t id *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8; } - return ClangASTType (ast, base_class->getType().getAsOpaquePtr()); + return CompilerType (ast, base_class->getType().getAsOpaquePtr()); } } } @@ -5244,18 +5244,18 @@ ClangASTContext::GetVirtualBaseClassAtIndex (const ClangASTType& type, size_t id break; case clang::Type::Typedef: - return GetVirtualBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), idx, bit_offset_ptr); case clang::Type::Elaborated: - return GetVirtualBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), idx, bit_offset_ptr); case clang::Type::Paren: - return GetVirtualBaseClassAtIndex (ClangASTType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr); + return GetVirtualBaseClassAtIndex (CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), idx, bit_offset_ptr); default: break; } - return ClangASTType(); + return CompilerType(); } static clang_type_t @@ -5317,7 +5317,7 @@ GetObjCFieldAtIndex (clang::ASTContext *ast, return nullptr; } -ClangASTType +CompilerType ClangASTContext::GetFieldAtIndex (void* type, size_t idx, std::string& name, uint64_t *bit_offset_ptr, @@ -5325,7 +5325,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, bool *is_bitfield_ptr) { if (!type) - return ClangASTType(); + return CompilerType(); clang::QualType qual_type(GetCanonicalQualType(type)); const clang::Type::TypeClass type_class = qual_type->getTypeClass(); @@ -5373,7 +5373,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, if (is_bitfield_ptr) *is_bitfield_ptr = is_bitfield; - return ClangASTType (getASTContext(), field->getType()); + return CompilerType (getASTContext(), field->getType()); } } } @@ -5386,7 +5386,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, if (objc_class_type) { clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl(); - return ClangASTType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); + return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); } } break; @@ -5400,14 +5400,14 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, if (objc_class_type) { clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - return ClangASTType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); + return CompilerType (this, GetObjCFieldAtIndex(getASTContext(), class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); } } break; case clang::Type::Typedef: - return ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()). + return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()). GetFieldAtIndex (idx, name, bit_offset_ptr, @@ -5415,7 +5415,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, is_bitfield_ptr); case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()). + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()). GetFieldAtIndex (idx, name, bit_offset_ptr, @@ -5423,7 +5423,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, is_bitfield_ptr); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()). + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()). GetFieldAtIndex (idx, name, bit_offset_ptr, @@ -5433,7 +5433,7 @@ ClangASTContext::GetFieldAtIndex (void* type, size_t idx, default: break; } - return ClangASTType(); + return CompilerType(); } // If a pointer to a pointee type (the clang_type arg) says that it has no @@ -5542,7 +5542,7 @@ ClangASTContext::GetNumPointeeChildren (clang::QualType type) } -ClangASTType +CompilerType ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, @@ -5558,7 +5558,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx ValueObject *valobj) { if (!type) - return ClangASTType(); + return CompilerType(); clang::QualType parent_qual_type(GetCanonicalQualType(type)); const clang::Type::TypeClass parent_type_class = parent_qual_type->getTypeClass(); @@ -5579,7 +5579,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::BuiltinType::ObjCClass: child_name = "isa"; child_byte_size = getASTContext()->getTypeSize(getASTContext()->ObjCBuiltinClassTy) / CHAR_BIT; - return ClangASTType (getASTContext(), getASTContext()->ObjCBuiltinClassTy); + return CompilerType (getASTContext(), getASTContext()->ObjCBuiltinClassTy); default: break; @@ -5695,7 +5695,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx // Base classes should be a multiple of 8 bits in size child_byte_offset = bit_offset/8; - ClangASTType base_class_clang_type(getASTContext(), base_class->getType()); + CompilerType base_class_clang_type(getASTContext(), base_class->getType()); child_name = base_class_clang_type.GetTypeName().AsCString(""); uint64_t base_class_clang_type_bit_size = base_class_clang_type.GetBitSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL); @@ -5723,7 +5723,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx // Figure out the type byte size (field_type_info.first) and // alignment (field_type_info.second) from the AST context. - ClangASTType field_clang_type (getASTContext(), field->getType()); + CompilerType field_clang_type (getASTContext(), field->getType()); assert(field_idx < record_layout.getFieldCount()); child_byte_size = field_clang_type.GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL); @@ -5759,7 +5759,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx { if (omit_empty_base_classes) { - ClangASTType base_class_clang_type (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl)); + CompilerType base_class_clang_type (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl)); if (base_class_clang_type.GetNumChildren(omit_empty_base_classes) > 0) { if (idx == 0) @@ -5775,7 +5775,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx child_byte_offset = 0; child_is_base_class = true; - return ClangASTType (getASTContext(), ivar_qual_type); + return CompilerType (getASTContext(), ivar_qual_type); } ++child_idx; @@ -5819,7 +5819,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime(); if (objc_runtime != nullptr) { - ClangASTType parent_ast_type (getASTContext(), parent_qual_type); + CompilerType parent_ast_type (getASTContext(), parent_qual_type); child_byte_offset = objc_runtime->GetByteOffsetForIvar (parent_ast_type, ivar_decl->getNameAsString().c_str()); } } @@ -5844,7 +5844,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx child_bitfield_bit_offset = bit_offset % 8; } - return ClangASTType (getASTContext(), ivar_qual_type); + return CompilerType (getASTContext(), ivar_qual_type); } ++child_idx; } @@ -5857,7 +5857,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::Type::ObjCObjectPointer: if (idx_is_valid) { - ClangASTType pointee_clang_type (GetPointeeType(type)); + CompilerType pointee_clang_type (GetPointeeType(type)); if (transparent_pointers && pointee_clang_type.IsAggregateType()) { @@ -5905,7 +5905,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx const clang::VectorType *array = llvm::cast<clang::VectorType>(parent_qual_type.getTypePtr()); if (array) { - ClangASTType element_type (getASTContext(), array->getElementType()); + CompilerType element_type (getASTContext(), array->getElementType()); if (element_type.GetCompleteType()) { char element_name[64]; @@ -5926,7 +5926,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx const clang::ArrayType *array = GetQualType(type)->getAsArrayTypeUnsafe(); if (array) { - ClangASTType element_type (getASTContext(), array->getElementType()); + CompilerType element_type (getASTContext(), array->getElementType()); if (element_type.GetCompleteType()) { char element_name[64]; @@ -5944,11 +5944,11 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::Type::Pointer: if (idx_is_valid) { - ClangASTType pointee_clang_type (GetPointeeType(type)); + CompilerType pointee_clang_type (GetPointeeType(type)); // Don't dereference "void *" pointers if (pointee_clang_type.IsVoidType()) - return ClangASTType(); + return CompilerType(); if (transparent_pointers && pointee_clang_type.IsAggregateType ()) { @@ -5995,7 +5995,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx if (idx_is_valid) { const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(parent_qual_type.getTypePtr()); - ClangASTType pointee_clang_type (getASTContext(), reference_type->getPointeeType()); + CompilerType pointee_clang_type (getASTContext(), reference_type->getPointeeType()); if (transparent_pointers && pointee_clang_type.IsAggregateType ()) { child_is_deref_of_parent = false; @@ -6036,7 +6036,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::Type::Typedef: { - ClangASTType typedefed_clang_type (getASTContext(), llvm::cast<clang::TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType()); + CompilerType typedefed_clang_type (getASTContext(), llvm::cast<clang::TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType()); return typedefed_clang_type.GetChildClangTypeAtIndex (exe_ctx, idx, transparent_pointers, @@ -6055,7 +6055,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::Type::Elaborated: { - ClangASTType elaborated_clang_type (getASTContext(), llvm::cast<clang::ElaboratedType>(parent_qual_type)->getNamedType()); + CompilerType elaborated_clang_type (getASTContext(), llvm::cast<clang::ElaboratedType>(parent_qual_type)->getNamedType()); return elaborated_clang_type.GetChildClangTypeAtIndex (exe_ctx, idx, transparent_pointers, @@ -6073,7 +6073,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx case clang::Type::Paren: { - ClangASTType paren_clang_type (getASTContext(), llvm::cast<clang::ParenType>(parent_qual_type)->desugar()); + CompilerType paren_clang_type (getASTContext(), llvm::cast<clang::ParenType>(parent_qual_type)->desugar()); return paren_clang_type.GetChildClangTypeAtIndex (exe_ctx, idx, transparent_pointers, @@ -6093,7 +6093,7 @@ ClangASTContext::GetChildClangTypeAtIndex (void* type, ExecutionContext *exe_ctx default: break; } - return ClangASTType(); + return CompilerType(); } static uint32_t @@ -6226,7 +6226,7 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, llvm::StringRef field_name = field->getName(); if (field_name.empty()) { - ClangASTType field_type(getASTContext(),field->getType()); + CompilerType field_type(getASTContext(),field->getType()); child_indexes.push_back(child_idx); if (field_type.GetIndexOfChildMemberWithName(name, omit_empty_base_classes, child_indexes)) return child_indexes.size(); @@ -6338,7 +6338,7 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, // an ivar in our superclass... child_indexes.push_back (0); - ClangASTType superclass_clang_type (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl)); + CompilerType superclass_clang_type (getASTContext(), getASTContext()->getObjCInterfaceType(superclass_interface_decl)); if (superclass_clang_type.GetIndexOfChildMemberWithName (name, omit_empty_base_classes, child_indexes)) @@ -6360,7 +6360,7 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, case clang::Type::ObjCObjectPointer: { - ClangASTType objc_object_clang_type (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()); + CompilerType objc_object_clang_type (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()); return objc_object_clang_type.GetIndexOfChildMemberWithName (name, omit_empty_base_classes, child_indexes); @@ -6408,7 +6408,7 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, { const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr()); clang::QualType pointee_type(reference_type->getPointeeType()); - ClangASTType pointee_clang_type (getASTContext(), pointee_type); + CompilerType pointee_clang_type (getASTContext(), pointee_type); if (pointee_clang_type.IsAggregateType ()) { @@ -6421,7 +6421,7 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, case clang::Type::Pointer: { - ClangASTType pointee_clang_type (GetPointeeType(type)); + CompilerType pointee_clang_type (GetPointeeType(type)); if (pointee_clang_type.IsAggregateType ()) { @@ -6433,17 +6433,17 @@ ClangASTContext::GetIndexOfChildMemberWithName (void* type, const char *name, break; case clang::Type::Typedef: - return ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildMemberWithName (name, + return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildMemberWithName (name, omit_empty_base_classes, child_indexes); case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildMemberWithName (name, + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildMemberWithName (name, omit_empty_base_classes, child_indexes); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildMemberWithName (name, + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildMemberWithName (name, omit_empty_base_classes, child_indexes); @@ -6493,7 +6493,7 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi if (omit_empty_base_classes && ClangASTContext::RecordHasFields(base_class_decl) == false) continue; - ClangASTType base_class_clang_type (getASTContext(), base_class->getType()); + CompilerType base_class_clang_type (getASTContext(), base_class->getType()); std::string base_class_type_name (base_class_clang_type.GetTypeName().AsCString("")); if (base_class_type_name.compare (name) == 0) return child_idx; @@ -6558,7 +6558,7 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi case clang::Type::ObjCObjectPointer: { - ClangASTType pointee_clang_type (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()); + CompilerType pointee_clang_type (getASTContext(), llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()); return pointee_clang_type.GetIndexOfChildWithName (name, omit_empty_base_classes); } break; @@ -6602,7 +6602,7 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi case clang::Type::RValueReference: { const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr()); - ClangASTType pointee_type (getASTContext(), reference_type->getPointeeType()); + CompilerType pointee_type (getASTContext(), reference_type->getPointeeType()); if (pointee_type.IsAggregateType ()) { @@ -6614,7 +6614,7 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi case clang::Type::Pointer: { const clang::PointerType *pointer_type = llvm::cast<clang::PointerType>(qual_type.getTypePtr()); - ClangASTType pointee_type (getASTContext(), pointer_type->getPointeeType()); + CompilerType pointee_type (getASTContext(), pointer_type->getPointeeType()); if (pointee_type.IsAggregateType ()) { @@ -6642,13 +6642,13 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi break; case clang::Type::Elaborated: - return ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildWithName (name, omit_empty_base_classes); + return CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildWithName (name, omit_empty_base_classes); case clang::Type::Paren: - return ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildWithName (name, omit_empty_base_classes); + return CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildWithName (name, omit_empty_base_classes); case clang::Type::Typedef: - return ClangASTType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildWithName (name, omit_empty_base_classes); + return CompilerType (getASTContext(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildWithName (name, omit_empty_base_classes); default: break; @@ -6659,7 +6659,7 @@ ClangASTContext::GetIndexOfChildWithName (void* type, const char *name, bool omi size_t -ClangASTContext::GetNumTemplateArguments (const ClangASTType& type) +ClangASTContext::GetNumTemplateArguments (const CompilerType& type) { if (!type) return 0; @@ -6685,13 +6685,13 @@ ClangASTContext::GetNumTemplateArguments (const ClangASTType& type) break; case clang::Type::Typedef: - return GetNumTemplateArguments(ClangASTType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr())); + return GetNumTemplateArguments(CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr())); case clang::Type::Elaborated: - return GetNumTemplateArguments(ClangASTType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr())); + return GetNumTemplateArguments(CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr())); case clang::Type::Paren: - return GetNumTemplateArguments(ClangASTType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr())); + return GetNumTemplateArguments(CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr())); default: break; @@ -6700,11 +6700,11 @@ ClangASTContext::GetNumTemplateArguments (const ClangASTType& type) return 0; } -ClangASTType -ClangASTContext::GetTemplateArgument (const ClangASTType& type, size_t arg_idx, lldb::TemplateArgumentKind &kind) +CompilerType +ClangASTContext::GetTemplateArgument (const CompilerType& type, size_t arg_idx, lldb::TemplateArgumentKind &kind) { if (!type) - return ClangASTType(); + return CompilerType(); ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (ast) { @@ -6727,35 +6727,35 @@ ClangASTContext::GetTemplateArgument (const ClangASTType& type, size_t arg_idx, { case clang::TemplateArgument::Null: kind = eTemplateArgumentKindNull; - return ClangASTType(); + return CompilerType(); case clang::TemplateArgument::Type: kind = eTemplateArgumentKindType; - return ClangASTType(ast, template_arg.getAsType().getAsOpaquePtr()); + return CompilerType(ast, template_arg.getAsType().getAsOpaquePtr()); case clang::TemplateArgument::Declaration: kind = eTemplateArgumentKindDeclaration; - return ClangASTType(); + return CompilerType(); case clang::TemplateArgument::Integral: kind = eTemplateArgumentKindIntegral; - return ClangASTType(ast, template_arg.getIntegralType().getAsOpaquePtr()); + return CompilerType(ast, template_arg.getIntegralType().getAsOpaquePtr()); case clang::TemplateArgument::Template: kind = eTemplateArgumentKindTemplate; - return ClangASTType(); + return CompilerType(); case clang::TemplateArgument::TemplateExpansion: kind = eTemplateArgumentKindTemplateExpansion; - return ClangASTType(); + return CompilerType(); case clang::TemplateArgument::Expression: kind = eTemplateArgumentKindExpression; - return ClangASTType(); + return CompilerType(); case clang::TemplateArgument::Pack: kind = eTemplateArgumentKindPack; - return ClangASTType(); + return CompilerType(); default: assert (!"Unhandled clang::TemplateArgument::ArgKind"); @@ -6767,20 +6767,20 @@ ClangASTContext::GetTemplateArgument (const ClangASTType& type, size_t arg_idx, break; case clang::Type::Typedef: - return GetTemplateArgument(ClangASTType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), arg_idx, kind); + return GetTemplateArgument(CompilerType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), arg_idx, kind); case clang::Type::Elaborated: - return GetTemplateArgument(ClangASTType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), arg_idx, kind); + return GetTemplateArgument(CompilerType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), arg_idx, kind); case clang::Type::Paren: - return GetTemplateArgument(ClangASTType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), arg_idx, kind); + return GetTemplateArgument(CompilerType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), arg_idx, kind); default: break; } } kind = eTemplateArgumentKindNull; - return ClangASTType (); + return CompilerType (); } static bool @@ -7000,7 +7000,7 @@ IsOperator (const char *name, clang::OverloadedOperatorKind &op_kind) } clang::EnumDecl * -ClangASTContext::GetAsEnumDecl (const ClangASTType& type) +ClangASTContext::GetAsEnumDecl (const CompilerType& type) { const clang::EnumType *enutype = llvm::dyn_cast<clang::EnumType>(GetCanonicalQualType(type)); if (enutype) @@ -7009,7 +7009,7 @@ ClangASTContext::GetAsEnumDecl (const ClangASTType& type) } clang::RecordDecl * -ClangASTContext::GetAsRecordDecl (const ClangASTType& type) +ClangASTContext::GetAsRecordDecl (const CompilerType& type) { const clang::RecordType *record_type = llvm::dyn_cast<clang::RecordType>(GetCanonicalQualType(type)); if (record_type) @@ -7024,7 +7024,7 @@ ClangASTContext::GetAsCXXRecordDecl (void* type) } clang::ObjCInterfaceDecl * -ClangASTContext::GetAsObjCInterfaceDecl (const ClangASTType& type) +ClangASTContext::GetAsObjCInterfaceDecl (const CompilerType& type) { const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(GetCanonicalQualType(type)); if (objc_class_type) @@ -7033,8 +7033,8 @@ ClangASTContext::GetAsObjCInterfaceDecl (const ClangASTType& type) } clang::FieldDecl * -ClangASTContext::AddFieldToRecordType (const ClangASTType& type, const char *name, - const ClangASTType &field_clang_type, +ClangASTContext::AddFieldToRecordType (const CompilerType& type, const char *name, + const CompilerType &field_clang_type, AccessType access, uint32_t bitfield_bit_size) { @@ -7128,7 +7128,7 @@ ClangASTContext::AddFieldToRecordType (const ClangASTType& type, const char *nam } void -ClangASTContext::BuildIndirectFields (const ClangASTType& type) +ClangASTContext::BuildIndirectFields (const CompilerType& type) { ClangASTContext* ast = nullptr; if (type) @@ -7239,7 +7239,7 @@ ClangASTContext::BuildIndirectFields (const ClangASTType& type) } void -ClangASTContext::SetIsPacked (const ClangASTType& type) +ClangASTContext::SetIsPacked (const CompilerType& type) { clang::RecordDecl *record_decl = GetAsRecordDecl(type); @@ -7250,8 +7250,8 @@ ClangASTContext::SetIsPacked (const ClangASTType& type) } clang::VarDecl * -ClangASTContext::AddVariableToRecordType (const ClangASTType& type, const char *name, - const ClangASTType &var_type, +ClangASTContext::AddVariableToRecordType (const CompilerType& type, const char *name, + const CompilerType &var_type, AccessType access) { clang::VarDecl *var_decl = nullptr; @@ -7289,7 +7289,7 @@ ClangASTContext::AddVariableToRecordType (const ClangASTType& type, const char * clang::CXXMethodDecl * ClangASTContext::AddMethodToCXXRecordType (void* type, const char *name, - const ClangASTType &method_clang_type, + const CompilerType &method_clang_type, lldb::AccessType access, bool is_virtual, bool is_static, @@ -7539,7 +7539,7 @@ ClangASTContext::SetBaseClassesForClassType (void* type, clang::CXXBaseSpecifier } bool -ClangASTContext::SetObjCSuperClass (const ClangASTType& type, const ClangASTType &superclass_clang_type) +ClangASTContext::SetObjCSuperClass (const CompilerType& type, const CompilerType &superclass_clang_type) { ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (!ast) @@ -7560,9 +7560,9 @@ ClangASTContext::SetObjCSuperClass (const ClangASTType& type, const ClangASTType } bool -ClangASTContext::AddObjCClassProperty (const ClangASTType& type, +ClangASTContext::AddObjCClassProperty (const CompilerType& type, const char *property_name, - const ClangASTType &property_clang_type, + const CompilerType &property_clang_type, clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, @@ -7580,12 +7580,12 @@ ClangASTContext::AddObjCClassProperty (const ClangASTType& type, if (class_interface_decl) { - ClangASTType property_clang_type_to_access; + CompilerType property_clang_type_to_access; if (property_clang_type.IsValid()) property_clang_type_to_access = property_clang_type; else if (ivar_decl) - property_clang_type_to_access = ClangASTType (clang_ast, ivar_decl->getType()); + property_clang_type_to_access = CompilerType (clang_ast, ivar_decl->getType()); if (class_interface_decl && property_clang_type_to_access.IsValid()) { @@ -7753,7 +7753,7 @@ ClangASTContext::AddObjCClassProperty (const ClangASTType& type, } bool -ClangASTContext::IsObjCClassTypeAndHasIVars (const ClangASTType& type, bool check_superclass) +ClangASTContext::IsObjCClassTypeAndHasIVars (const CompilerType& type, bool check_superclass) { clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl (type); if (class_interface_decl) @@ -7763,9 +7763,9 @@ ClangASTContext::IsObjCClassTypeAndHasIVars (const ClangASTType& type, bool chec clang::ObjCMethodDecl * -ClangASTContext::AddMethodToObjCObjectType (const ClangASTType& type, +ClangASTContext::AddMethodToObjCObjectType (const CompilerType& type, const char *name, // the full symbol name as seen in the symbol table (void* type, "-[NString stringWithCString:]") - const ClangASTType &method_clang_type, + const CompilerType &method_clang_type, lldb::AccessType access, bool is_artificial) { @@ -7955,7 +7955,7 @@ ClangASTContext::SetHasExternalStorage (void* type, bool has_extern) #pragma mark TagDecl bool -ClangASTContext::StartTagDeclarationDefinition (const ClangASTType &type) +ClangASTContext::StartTagDeclarationDefinition (const CompilerType &type) { if (type) { @@ -7991,7 +7991,7 @@ ClangASTContext::StartTagDeclarationDefinition (const ClangASTType &type) } bool -ClangASTContext::CompleteTagDeclarationDefinition (const ClangASTType& type) +ClangASTContext::CompleteTagDeclarationDefinition (const CompilerType& type) { if (type) { @@ -8050,7 +8050,7 @@ ClangASTContext::CompleteTagDeclarationDefinition (const ClangASTType& type) bool -ClangASTContext::AddEnumerationValueToEnumerationType (void* type, const ClangASTType &enumerator_clang_type, +ClangASTContext::AddEnumerationValueToEnumerationType (void* type, const CompilerType &enumerator_clang_type, const Declaration &decl, const char *name, int64_t enum_value, @@ -8097,7 +8097,7 @@ ClangASTContext::AddEnumerationValueToEnumerationType (void* type, const ClangAS } -ClangASTType +CompilerType ClangASTContext::GetEnumerationIntegerType (void* type) { clang::QualType enum_qual_type (GetCanonicalQualType(type)); @@ -8109,25 +8109,25 @@ ClangASTContext::GetEnumerationIntegerType (void* type) { clang::EnumDecl *enum_decl = enutype->getDecl(); if (enum_decl) - return ClangASTType (getASTContext(), enum_decl->getIntegerType()); + return CompilerType (getASTContext(), enum_decl->getIntegerType()); } } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTContext::CreateMemberPointerType (const ClangASTType& type, const ClangASTType &pointee_type) +CompilerType +ClangASTContext::CreateMemberPointerType (const CompilerType& type, const CompilerType &pointee_type) { if (type && pointee_type.IsValid() && type.GetTypeSystem() == pointee_type.GetTypeSystem()) { ClangASTContext* ast = type.GetTypeSystem()->AsClangASTContext(); if (!ast) - return ClangASTType(); - return ClangASTType (ast->getASTContext(), + return CompilerType(); + return CompilerType (ast->getASTContext(), ast->getASTContext()->getMemberPointerType (GetQualType(pointee_type), GetQualType(type).getTypePtr())); } - return ClangASTType(); + return CompilerType(); } @@ -8243,7 +8243,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, clang::TypeInfo base_class_type_info = getASTContext()->getTypeInfo(base_class_qual_type); // Dump the value of the member - ClangASTType base_clang_type(getASTContext(), base_class_qual_type); + CompilerType base_clang_type(getASTContext(), base_class_qual_type); base_clang_type.DumpValue (exe_ctx, s, // Stream to dump to base_clang_type.GetFormat(), // The format with which to display the member @@ -8302,7 +8302,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, // Dump the value of the member - ClangASTType field_clang_type (getASTContext(), field_type); + CompilerType field_clang_type (getASTContext(), field_type); field_clang_type.DumpValue (exe_ctx, s, // Stream to dump to field_clang_type.GetFormat(), // The format with which to display the member @@ -8374,7 +8374,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, } else { - ClangASTType element_clang_type(getASTContext(), element_qual_type); + CompilerType element_clang_type(getASTContext(), element_qual_type); lldb::Format element_format = element_clang_type.GetFormat(); for (element_idx = 0; element_idx < element_count; ++element_idx) @@ -8419,7 +8419,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, { clang::QualType typedef_qual_type = llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType(); - ClangASTType typedef_clang_type (getASTContext(), typedef_qual_type); + CompilerType typedef_clang_type (getASTContext(), typedef_qual_type); lldb::Format typedef_format = typedef_clang_type.GetFormat(); clang::TypeInfo typedef_type_info = getASTContext()->getTypeInfo(typedef_qual_type); uint64_t typedef_byte_size = typedef_type_info.Width / 8; @@ -8442,7 +8442,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, case clang::Type::Elaborated: { clang::QualType elaborated_qual_type = llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType(); - ClangASTType elaborated_clang_type (getASTContext(), elaborated_qual_type); + CompilerType elaborated_clang_type (getASTContext(), elaborated_qual_type); lldb::Format elaborated_format = elaborated_clang_type.GetFormat(); clang::TypeInfo elaborated_type_info = getASTContext()->getTypeInfo(elaborated_qual_type); uint64_t elaborated_byte_size = elaborated_type_info.Width / 8; @@ -8465,7 +8465,7 @@ ClangASTContext::DumpValue (void* type, ExecutionContext *exe_ctx, case clang::Type::Paren: { clang::QualType desugar_qual_type = llvm::cast<clang::ParenType>(qual_type)->desugar(); - ClangASTType desugar_clang_type (getASTContext(), desugar_qual_type); + CompilerType desugar_clang_type (getASTContext(), desugar_qual_type); lldb::Format desugar_format = desugar_clang_type.GetFormat(); clang::TypeInfo desugar_type_info = getASTContext()->getTypeInfo(desugar_qual_type); @@ -8533,7 +8533,7 @@ ClangASTContext::DumpTypeValue (void* type, Stream *s, case clang::Type::Typedef: { clang::QualType typedef_qual_type = llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType(); - ClangASTType typedef_clang_type (getASTContext(), typedef_qual_type); + CompilerType typedef_clang_type (getASTContext(), typedef_qual_type); if (format == eFormatDefault) format = typedef_clang_type.GetFormat(); clang::TypeInfo typedef_type_info = getASTContext()->getTypeInfo(typedef_qual_type); @@ -8778,11 +8778,11 @@ ClangASTContext::DumpTypeDescription (void* type, Stream *s) break; case clang::Type::Elaborated: - ClangASTType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).DumpTypeDescription(s); + CompilerType (getASTContext(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).DumpTypeDescription(s); return; case clang::Type::Paren: - ClangASTType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).DumpTypeDescription(s); + CompilerType (getASTContext(), llvm::cast<clang::ParenType>(qual_type)->desugar()).DumpTypeDescription(s); return; case clang::Type::Record: diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/CompilerType.cpp index 9463193..8569d1b 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/CompilerType.cpp @@ -1,4 +1,4 @@ -//===-- ClangASTType.cpp ----------------------------------------*- C++ -*-===// +//===-- CompilerType.cpp ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,31 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Symbol/ClangASTType.h" - -#include "clang/AST/ASTConsumer.h" -#include "clang/AST/ASTContext.h" -#include "clang/AST/Attr.h" -#include "clang/AST/CXXInheritance.h" -#include "clang/AST/Decl.h" -#include "clang/AST/DeclCXX.h" -#include "clang/AST/DeclObjC.h" -#include "clang/AST/DeclGroup.h" -#include "clang/AST/DeclTemplate.h" -#include "clang/AST/RecordLayout.h" -#include "clang/AST/Type.h" -#include "clang/AST/VTableBuilder.h" - -#include "clang/Basic/Builtins.h" -#include "clang/Basic/IdentifierTable.h" -#include "clang/Basic/LangOptions.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/TargetInfo.h" - -#include "llvm/Support/Format.h" -#include "llvm/Support/Signals.h" -#include "llvm/Support/FormattedStream.h" -#include "llvm/Support/raw_ostream.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/DataBufferHeap.h" @@ -55,21 +31,21 @@ using namespace lldb; using namespace lldb_private; -ClangASTType::ClangASTType (TypeSystem *type_system, +CompilerType::CompilerType (TypeSystem *type_system, void* type) : m_type (type), m_type_system (type_system) { } -ClangASTType::ClangASTType (clang::ASTContext *ast, +CompilerType::CompilerType (clang::ASTContext *ast, clang::QualType qual_type) : m_type (qual_type.getAsOpaquePtr()), m_type_system (ClangASTContext::GetASTContext(ast)) { } -ClangASTType::~ClangASTType() +CompilerType::~CompilerType() { } @@ -78,7 +54,7 @@ ClangASTType::~ClangASTType() //---------------------------------------------------------------------- bool -ClangASTType::IsAggregateType () const +CompilerType::IsAggregateType () const { if (IsValid()) return m_type_system->IsAggregateType(m_type); @@ -86,7 +62,7 @@ ClangASTType::IsAggregateType () const } bool -ClangASTType::IsArrayType (ClangASTType *element_type_ptr, +CompilerType::IsArrayType (CompilerType *element_type_ptr, uint64_t *size, bool *is_incomplete) const { @@ -103,7 +79,7 @@ ClangASTType::IsArrayType (ClangASTType *element_type_ptr, } bool -ClangASTType::IsVectorType (ClangASTType *element_type, +CompilerType::IsVectorType (CompilerType *element_type, uint64_t *size) const { if (IsValid()) @@ -112,7 +88,7 @@ ClangASTType::IsVectorType (ClangASTType *element_type, } bool -ClangASTType::IsRuntimeGeneratedType () const +CompilerType::IsRuntimeGeneratedType () const { if (IsValid()) return m_type_system->IsRuntimeGeneratedType(m_type); @@ -120,7 +96,7 @@ ClangASTType::IsRuntimeGeneratedType () const } bool -ClangASTType::IsCharType () const +CompilerType::IsCharType () const { if (IsValid()) return m_type_system->IsCharType(m_type); @@ -129,7 +105,7 @@ ClangASTType::IsCharType () const bool -ClangASTType::IsCompleteType () const +CompilerType::IsCompleteType () const { if (IsValid()) return m_type_system->IsCompleteType(m_type); @@ -137,7 +113,7 @@ ClangASTType::IsCompleteType () const } bool -ClangASTType::IsConst() const +CompilerType::IsConst() const { if (IsValid()) return m_type_system->IsConst(m_type); @@ -145,7 +121,7 @@ ClangASTType::IsConst() const } bool -ClangASTType::IsCStringType (uint32_t &length) const +CompilerType::IsCStringType (uint32_t &length) const { if (IsValid()) return m_type_system->IsCStringType(m_type, length); @@ -153,7 +129,7 @@ ClangASTType::IsCStringType (uint32_t &length) const } bool -ClangASTType::IsFunctionType (bool *is_variadic_ptr) const +CompilerType::IsFunctionType (bool *is_variadic_ptr) const { if (IsValid()) return m_type_system->IsFunctionType(m_type, is_variadic_ptr); @@ -162,7 +138,7 @@ ClangASTType::IsFunctionType (bool *is_variadic_ptr) const // Used to detect "Homogeneous Floating-point Aggregates" uint32_t -ClangASTType::IsHomogeneousAggregate (ClangASTType* base_type_ptr) const +CompilerType::IsHomogeneousAggregate (CompilerType* base_type_ptr) const { if (IsValid()) return m_type_system->IsHomogeneousAggregate(m_type, base_type_ptr); @@ -170,23 +146,23 @@ ClangASTType::IsHomogeneousAggregate (ClangASTType* base_type_ptr) const } size_t -ClangASTType::GetNumberOfFunctionArguments () const +CompilerType::GetNumberOfFunctionArguments () const { if (IsValid()) return m_type_system->GetNumberOfFunctionArguments(m_type); return 0; } -ClangASTType -ClangASTType::GetFunctionArgumentAtIndex (const size_t index) const +CompilerType +CompilerType::GetFunctionArgumentAtIndex (const size_t index) const { if (IsValid()) return m_type_system->GetFunctionArgumentAtIndex(m_type, index); - return ClangASTType(); + return CompilerType(); } bool -ClangASTType::IsFunctionPointerType () const +CompilerType::IsFunctionPointerType () const { if (IsValid()) return m_type_system->IsFunctionPointerType(m_type); @@ -195,7 +171,7 @@ ClangASTType::IsFunctionPointerType () const } bool -ClangASTType::IsIntegerType (bool &is_signed) const +CompilerType::IsIntegerType (bool &is_signed) const { if (IsValid()) return m_type_system->IsIntegerType(m_type, is_signed); @@ -203,7 +179,7 @@ ClangASTType::IsIntegerType (bool &is_signed) const } bool -ClangASTType::IsPointerType (ClangASTType *pointee_type) const +CompilerType::IsPointerType (CompilerType *pointee_type) const { if (IsValid()) { @@ -216,7 +192,7 @@ ClangASTType::IsPointerType (ClangASTType *pointee_type) const bool -ClangASTType::IsPointerOrReferenceType (ClangASTType *pointee_type) const +CompilerType::IsPointerOrReferenceType (CompilerType *pointee_type) const { if (IsValid()) { @@ -229,7 +205,7 @@ ClangASTType::IsPointerOrReferenceType (ClangASTType *pointee_type) const bool -ClangASTType::IsReferenceType (ClangASTType *pointee_type, bool* is_rvalue) const +CompilerType::IsReferenceType (CompilerType *pointee_type, bool* is_rvalue) const { if (IsValid()) { @@ -241,7 +217,7 @@ ClangASTType::IsReferenceType (ClangASTType *pointee_type, bool* is_rvalue) cons } bool -ClangASTType::IsFloatingPointType (uint32_t &count, bool &is_complex) const +CompilerType::IsFloatingPointType (uint32_t &count, bool &is_complex) const { if (IsValid()) { @@ -254,7 +230,7 @@ ClangASTType::IsFloatingPointType (uint32_t &count, bool &is_complex) const bool -ClangASTType::IsDefined() const +CompilerType::IsDefined() const { if (IsValid()) return m_type_system->IsDefined(m_type); @@ -262,7 +238,7 @@ ClangASTType::IsDefined() const } bool -ClangASTType::IsPolymorphicClass () const +CompilerType::IsPolymorphicClass () const { if (IsValid()) { @@ -272,7 +248,7 @@ ClangASTType::IsPolymorphicClass () const } bool -ClangASTType::IsPossibleDynamicType (ClangASTType *dynamic_pointee_type, +CompilerType::IsPossibleDynamicType (CompilerType *dynamic_pointee_type, bool check_cplusplus, bool check_objc) const { @@ -283,7 +259,7 @@ ClangASTType::IsPossibleDynamicType (ClangASTType *dynamic_pointee_type, bool -ClangASTType::IsScalarType () const +CompilerType::IsScalarType () const { if (!IsValid()) return false; @@ -292,7 +268,7 @@ ClangASTType::IsScalarType () const } bool -ClangASTType::IsTypedefType () const +CompilerType::IsTypedefType () const { if (!IsValid()) return false; @@ -300,7 +276,7 @@ ClangASTType::IsTypedefType () const } bool -ClangASTType::IsVoidType () const +CompilerType::IsVoidType () const { if (!IsValid()) return false; @@ -308,7 +284,7 @@ ClangASTType::IsVoidType () const } bool -ClangASTType::IsPointerToScalarType () const +CompilerType::IsPointerToScalarType () const { if (!IsValid()) return false; @@ -317,16 +293,16 @@ ClangASTType::IsPointerToScalarType () const } bool -ClangASTType::IsArrayOfScalarType () const +CompilerType::IsArrayOfScalarType () const { - ClangASTType element_type; + CompilerType element_type; if (IsArrayType(&element_type, nullptr, nullptr)) return element_type.IsScalarType(); return false; } bool -ClangASTType::IsBeingDefined () const +CompilerType::IsBeingDefined () const { if (!IsValid()) return false; @@ -338,7 +314,7 @@ ClangASTType::IsBeingDefined () const //---------------------------------------------------------------------- bool -ClangASTType::GetCompleteType () const +CompilerType::GetCompleteType () const { if (!IsValid()) return false; @@ -349,7 +325,7 @@ ClangASTType::GetCompleteType () const // AST related queries //---------------------------------------------------------------------- size_t -ClangASTType::GetPointerByteSize () const +CompilerType::GetPointerByteSize () const { if (m_type_system) return m_type_system->GetPointerByteSize(); @@ -357,13 +333,13 @@ ClangASTType::GetPointerByteSize () const } ConstString -ClangASTType::GetConstQualifiedTypeName () const +CompilerType::GetConstQualifiedTypeName () const { return GetConstTypeName (); } ConstString -ClangASTType::GetConstTypeName () const +CompilerType::GetConstTypeName () const { if (IsValid()) { @@ -375,7 +351,7 @@ ClangASTType::GetConstTypeName () const } ConstString -ClangASTType::GetTypeName () const +CompilerType::GetTypeName () const { if (IsValid()) { @@ -385,13 +361,13 @@ ClangASTType::GetTypeName () const } ConstString -ClangASTType::GetDisplayTypeName () const +CompilerType::GetDisplayTypeName () const { return GetTypeName(); } uint32_t -ClangASTType::GetTypeInfo (ClangASTType *pointee_or_element_clang_type) const +CompilerType::GetTypeInfo (CompilerType *pointee_or_element_clang_type) const { if (!IsValid()) return 0; @@ -402,7 +378,7 @@ ClangASTType::GetTypeInfo (ClangASTType *pointee_or_element_clang_type) const lldb::LanguageType -ClangASTType::GetMinimumLanguage () +CompilerType::GetMinimumLanguage () { if (!IsValid()) return lldb::eLanguageTypeC; @@ -411,7 +387,7 @@ ClangASTType::GetMinimumLanguage () } lldb::TypeClass -ClangASTType::GetTypeClass () const +CompilerType::GetTypeClass () const { if (!IsValid()) return lldb::eTypeClassInvalid; @@ -421,21 +397,21 @@ ClangASTType::GetTypeClass () const } void -ClangASTType::SetClangType (TypeSystem* type_system, void* type) +CompilerType::SetClangType (TypeSystem* type_system, void* type) { m_type_system = type_system; m_type = type; } void -ClangASTType::SetClangType (clang::ASTContext *ast, clang::QualType qual_type) +CompilerType::SetClangType (clang::ASTContext *ast, clang::QualType qual_type) { m_type_system = ClangASTContext::GetASTContext(ast); m_type = qual_type.getAsOpaquePtr(); } unsigned -ClangASTType::GetTypeQualifiers() const +CompilerType::GetTypeQualifiers() const { if (IsValid()) return m_type_system->GetTypeQualifiers(m_type); @@ -446,36 +422,36 @@ ClangASTType::GetTypeQualifiers() const // Creating related types //---------------------------------------------------------------------- -ClangASTType -ClangASTType::GetArrayElementType (uint64_t *stride) const +CompilerType +CompilerType::GetArrayElementType (uint64_t *stride) const { if (IsValid()) { return m_type_system->GetArrayElementType(m_type, stride); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetCanonicalType () const +CompilerType +CompilerType::GetCanonicalType () const { if (IsValid()) return m_type_system->GetCanonicalType(m_type); - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetFullyUnqualifiedType () const +CompilerType +CompilerType::GetFullyUnqualifiedType () const { if (IsValid()) return m_type_system->GetFullyUnqualifiedType(m_type); - return ClangASTType(); + return CompilerType(); } int -ClangASTType::GetFunctionArgumentCount () const +CompilerType::GetFunctionArgumentCount () const { if (IsValid()) { @@ -484,28 +460,28 @@ ClangASTType::GetFunctionArgumentCount () const return -1; } -ClangASTType -ClangASTType::GetFunctionArgumentTypeAtIndex (size_t idx) const +CompilerType +CompilerType::GetFunctionArgumentTypeAtIndex (size_t idx) const { if (IsValid()) { return m_type_system->GetFunctionArgumentTypeAtIndex(m_type, idx); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetFunctionReturnType () const +CompilerType +CompilerType::GetFunctionReturnType () const { if (IsValid()) { return m_type_system->GetFunctionReturnType(m_type); } - return ClangASTType(); + return CompilerType(); } size_t -ClangASTType::GetNumMemberFunctions () const +CompilerType::GetNumMemberFunctions () const { if (IsValid()) { @@ -515,7 +491,7 @@ ClangASTType::GetNumMemberFunctions () const } TypeMemberFunctionImpl -ClangASTType::GetMemberFunctionAtIndex (size_t idx) +CompilerType::GetMemberFunctionAtIndex (size_t idx) { if (IsValid()) { @@ -524,48 +500,48 @@ ClangASTType::GetMemberFunctionAtIndex (size_t idx) return TypeMemberFunctionImpl(); } -ClangASTType -ClangASTType::GetNonReferenceType () const +CompilerType +CompilerType::GetNonReferenceType () const { if (IsValid()) return m_type_system->GetNonReferenceType(m_type); - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetPointeeType () const +CompilerType +CompilerType::GetPointeeType () const { if (IsValid()) { return m_type_system->GetPointeeType(m_type); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetPointerType () const +CompilerType +CompilerType::GetPointerType () const { if (IsValid()) { return m_type_system->GetPointerType(m_type); } - return ClangASTType(); + return CompilerType(); } -ClangASTType -ClangASTType::GetTypedefedType () const +CompilerType +CompilerType::GetTypedefedType () const { if (IsValid()) return m_type_system->GetTypedefedType(m_type); - return ClangASTType(); + return CompilerType(); } -//ClangASTType -//ClangASTType::RemoveFastQualifiers () const +//CompilerType +//CompilerType::RemoveFastQualifiers () const //{ // if (IsValid()) // return m_type_system->RemoveFastQualifiers(m_type); -// return ClangASTType(); +// return CompilerType(); //} @@ -573,19 +549,19 @@ ClangASTType::GetTypedefedType () const // Create related types using the current type's AST //---------------------------------------------------------------------- -ClangASTType -ClangASTType::GetBasicTypeFromAST (lldb::BasicType basic_type) const +CompilerType +CompilerType::GetBasicTypeFromAST (lldb::BasicType basic_type) const { if (IsValid()) return m_type_system->GetBasicTypeFromAST(m_type, basic_type); - return ClangASTType(); + return CompilerType(); } //---------------------------------------------------------------------- // Exploring the type //---------------------------------------------------------------------- uint64_t -ClangASTType::GetBitSize (ExecutionContextScope *exe_scope) const +CompilerType::GetBitSize (ExecutionContextScope *exe_scope) const { if (IsValid()) { @@ -595,14 +571,14 @@ ClangASTType::GetBitSize (ExecutionContextScope *exe_scope) const } uint64_t -ClangASTType::GetByteSize (ExecutionContextScope *exe_scope) const +CompilerType::GetByteSize (ExecutionContextScope *exe_scope) const { return (GetBitSize (exe_scope) + 7) / 8; } size_t -ClangASTType::GetTypeBitAlign () const +CompilerType::GetTypeBitAlign () const { if (IsValid()) return m_type_system->GetTypeBitAlign(m_type); @@ -611,7 +587,7 @@ ClangASTType::GetTypeBitAlign () const lldb::Encoding -ClangASTType::GetEncoding (uint64_t &count) const +CompilerType::GetEncoding (uint64_t &count) const { if (!IsValid()) return lldb::eEncodingInvalid; @@ -620,7 +596,7 @@ ClangASTType::GetEncoding (uint64_t &count) const } lldb::Format -ClangASTType::GetFormat () const +CompilerType::GetFormat () const { if (!IsValid()) return lldb::eFormatDefault; @@ -629,7 +605,7 @@ ClangASTType::GetFormat () const } uint32_t -ClangASTType::GetNumChildren (bool omit_empty_base_classes) const +CompilerType::GetNumChildren (bool omit_empty_base_classes) const { if (!IsValid()) return 0; @@ -637,7 +613,7 @@ ClangASTType::GetNumChildren (bool omit_empty_base_classes) const } lldb::BasicType -ClangASTType::GetBasicTypeEnumeration () const +CompilerType::GetBasicTypeEnumeration () const { if (IsValid()) return m_type_system->GetBasicTypeEnumeration(m_type); @@ -647,28 +623,28 @@ ClangASTType::GetBasicTypeEnumeration () const uint32_t -ClangASTType::GetNumFields () const +CompilerType::GetNumFields () const { if (!IsValid()) return 0; return m_type_system->GetNumFields(m_type); } -ClangASTType -ClangASTType::GetFieldAtIndex (size_t idx, +CompilerType +CompilerType::GetFieldAtIndex (size_t idx, std::string& name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const { if (!IsValid()) - return ClangASTType(); + return CompilerType(); return m_type_system->GetFieldAtIndex(m_type, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr); } uint32_t -ClangASTType::GetIndexOfFieldWithName (const char* name, - ClangASTType* field_clang_type_ptr, +CompilerType::GetIndexOfFieldWithName (const char* name, + CompilerType* field_clang_type_ptr, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const @@ -677,7 +653,7 @@ ClangASTType::GetIndexOfFieldWithName (const char* name, std::string field_name; for (unsigned index = 0; index < count; index++) { - ClangASTType field_clang_type (GetFieldAtIndex(index, field_name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); + CompilerType field_clang_type (GetFieldAtIndex(index, field_name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr)); if (strcmp(field_name.c_str(), name) == 0) { if (field_clang_type_ptr) @@ -689,8 +665,8 @@ ClangASTType::GetIndexOfFieldWithName (const char* name, } -ClangASTType -ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, +CompilerType +CompilerType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, size_t idx, bool transparent_pointers, bool omit_empty_base_classes, @@ -705,7 +681,7 @@ ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, ValueObject *valobj) const { if (!IsValid()) - return ClangASTType(); + return CompilerType(); return m_type_system->GetChildClangTypeAtIndex(m_type, exe_ctx, idx, @@ -757,7 +733,7 @@ ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx, // The second index 1 is the child index for "m_b" within class A size_t -ClangASTType::GetIndexOfChildMemberWithName (const char *name, +CompilerType::GetIndexOfChildMemberWithName (const char *name, bool omit_empty_base_classes, std::vector<uint32_t>& child_indexes) const { @@ -774,7 +750,7 @@ ClangASTType::GetIndexOfChildMemberWithName (const char *name, // matches can include base class names. uint32_t -ClangASTType::GetIndexOfChildWithName (const char *name, bool omit_empty_base_classes) const +CompilerType::GetIndexOfChildWithName (const char *name, bool omit_empty_base_classes) const { if (IsValid() && name && name[0]) { @@ -784,7 +760,7 @@ ClangASTType::GetIndexOfChildWithName (const char *name, bool omit_empty_base_cl } size_t -ClangASTType::ConvertStringToFloatValue (const char *s, uint8_t *dst, size_t dst_size) const +CompilerType::ConvertStringToFloatValue (const char *s, uint8_t *dst, size_t dst_size) const { if (IsValid()) return m_type_system->ConvertStringToFloatValue(m_type, s, dst, dst_size); @@ -799,7 +775,7 @@ ClangASTType::ConvertStringToFloatValue (const char *s, uint8_t *dst, size_t dst #define DEPTH_INCREMENT 2 void -ClangASTType::DumpValue (ExecutionContext *exe_ctx, +CompilerType::DumpValue (ExecutionContext *exe_ctx, Stream *s, lldb::Format format, const lldb_private::DataExtractor &data, @@ -821,7 +797,7 @@ ClangASTType::DumpValue (ExecutionContext *exe_ctx, bool -ClangASTType::DumpTypeValue (Stream *s, +CompilerType::DumpTypeValue (Stream *s, lldb::Format format, const lldb_private::DataExtractor &data, lldb::offset_t byte_offset, @@ -838,7 +814,7 @@ ClangASTType::DumpTypeValue (Stream *s, void -ClangASTType::DumpSummary (ExecutionContext *exe_ctx, +CompilerType::DumpSummary (ExecutionContext *exe_ctx, Stream *s, const lldb_private::DataExtractor &data, lldb::offset_t data_byte_offset, @@ -849,14 +825,14 @@ ClangASTType::DumpSummary (ExecutionContext *exe_ctx, } void -ClangASTType::DumpTypeDescription () const +CompilerType::DumpTypeDescription () const { if (IsValid()) m_type_system->DumpTypeDescription(m_type); } void -ClangASTType::DumpTypeDescription (Stream *s) const +CompilerType::DumpTypeDescription (Stream *s) const { if (IsValid()) { @@ -865,7 +841,7 @@ ClangASTType::DumpTypeDescription (Stream *s) const } bool -ClangASTType::GetValueAsScalar (const lldb_private::DataExtractor &data, +CompilerType::GetValueAsScalar (const lldb_private::DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, Scalar &value) const @@ -1001,7 +977,7 @@ ClangASTType::GetValueAsScalar (const lldb_private::DataExtractor &data, } bool -ClangASTType::SetValueFromScalar (const Scalar &value, Stream &strm) +CompilerType::SetValueFromScalar (const Scalar &value, Stream &strm) { if (!IsValid()) return false; @@ -1080,7 +1056,7 @@ ClangASTType::SetValueFromScalar (const Scalar &value, Stream &strm) } bool -ClangASTType::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, +CompilerType::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, AddressType address_type, lldb_private::DataExtractor &data) @@ -1130,7 +1106,7 @@ ClangASTType::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, } bool -ClangASTType::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, +CompilerType::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, AddressType address_type, StreamString &new_value) @@ -1172,7 +1148,7 @@ ClangASTType::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, } //clang::CXXRecordDecl * -//ClangASTType::GetAsCXXRecordDecl (lldb::clang_type_t opaque_clang_qual_type) +//CompilerType::GetAsCXXRecordDecl (lldb::clang_type_t opaque_clang_qual_type) //{ // if (opaque_clang_qual_type) // return clang::QualType::getFromOpaquePtr(opaque_clang_qual_type)->getAsCXXRecordDecl(); @@ -1180,14 +1156,14 @@ ClangASTType::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, //} bool -lldb_private::operator == (const lldb_private::ClangASTType &lhs, const lldb_private::ClangASTType &rhs) +lldb_private::operator == (const lldb_private::CompilerType &lhs, const lldb_private::CompilerType &rhs) { return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueQualType() == rhs.GetOpaqueQualType(); } bool -lldb_private::operator != (const lldb_private::ClangASTType &lhs, const lldb_private::ClangASTType &rhs) +lldb_private::operator != (const lldb_private::CompilerType &lhs, const lldb_private::CompilerType &rhs) { return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueQualType() != rhs.GetOpaqueQualType(); } diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index be51925..4224cda 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -12,7 +12,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Host/Host.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/SymbolFile.h" @@ -545,13 +545,13 @@ Function::GetType() const return m_type; } -ClangASTType +CompilerType Function::GetClangType() { Type *function_type = GetType(); if (function_type) return function_type->GetClangFullType(); - return ClangASTType(); + return CompilerType(); } uint32_t diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 23cda8a..80f6f727 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -15,7 +15,7 @@ #include "lldb/Core/Scalar.h" #include "lldb/Core/StreamString.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolContextScope.h" @@ -86,7 +86,7 @@ Type::Type user_id_t encoding_uid, EncodingDataType encoding_uid_type, const Declaration& decl, - const ClangASTType &clang_type, + const CompilerType &clang_type, ResolveState clang_type_resolve_state ) : std::enable_shared_from_this<Type> (), @@ -502,7 +502,7 @@ Type::ResolveClangType (ResolveState clang_type_resolve_state) { case eEncodingIsUID: { - ClangASTType encoding_clang_type = encoding_type->GetClangForwardType(); + CompilerType encoding_clang_type = encoding_type->GetClangForwardType(); if (encoding_clang_type.IsValid()) { m_clang_type = encoding_clang_type; @@ -550,7 +550,7 @@ Type::ResolveClangType (ResolveState clang_type_resolve_state) else { // We have no encoding type, return void? - ClangASTType void_clang_type (ClangASTContext::GetBasicType(GetClangASTContext().getASTContext(), eBasicTypeVoid)); + CompilerType void_clang_type (ClangASTContext::GetBasicType(GetClangASTContext().getASTContext(), eBasicTypeVoid)); switch (m_encoding_uid_type) { case eEncodingIsUID: @@ -655,21 +655,21 @@ Type::GetEncodingMask () return encoding_mask; } -ClangASTType +CompilerType Type::GetClangFullType () { ResolveClangType(eResolveStateFull); return m_clang_type; } -ClangASTType +CompilerType Type::GetClangLayoutType () { ResolveClangType(eResolveStateLayout); return m_clang_type; } -ClangASTType +CompilerType Type::GetClangForwardType () { ResolveClangType (eResolveStateForward); @@ -699,7 +699,7 @@ Type::Compare(const Type &a, const Type &b) #if 0 // START REMOVE -// Move this into ClangASTType +// Move this into CompilerType void * Type::CreateClangPointerType (Type *type) { @@ -908,7 +908,7 @@ TypeAndOrName::SetTypeSP (lldb::TypeSP type_sp) } void -TypeAndOrName::SetClangASTType (ClangASTType clang_type) +TypeAndOrName::SetCompilerType (CompilerType clang_type) { m_type_pair.SetType(clang_type); if (m_type_pair) @@ -944,9 +944,9 @@ TypeAndOrName::HasTypeSP () const } bool -TypeAndOrName::HasClangASTType () const +TypeAndOrName::HasCompilerType () const { - return m_type_pair.GetClangASTType().IsValid(); + return m_type_pair.GetCompilerType().IsValid(); } @@ -972,7 +972,7 @@ TypeImpl::TypeImpl (const lldb::TypeSP &type_sp) : SetType (type_sp); } -TypeImpl::TypeImpl (const ClangASTType &clang_type) : +TypeImpl::TypeImpl (const CompilerType &clang_type) : m_module_wp (), m_static_type(), m_dynamic_type() @@ -980,7 +980,7 @@ TypeImpl::TypeImpl (const ClangASTType &clang_type) : SetType (clang_type); } -TypeImpl::TypeImpl (const lldb::TypeSP &type_sp, const ClangASTType &dynamic) : +TypeImpl::TypeImpl (const lldb::TypeSP &type_sp, const CompilerType &dynamic) : m_module_wp (), m_static_type (type_sp), m_dynamic_type(dynamic) @@ -988,7 +988,7 @@ TypeImpl::TypeImpl (const lldb::TypeSP &type_sp, const ClangASTType &dynamic) : SetType (type_sp, dynamic); } -TypeImpl::TypeImpl (const ClangASTType &static_type, const ClangASTType &dynamic_type) : +TypeImpl::TypeImpl (const CompilerType &static_type, const CompilerType &dynamic_type) : m_module_wp (), m_static_type (), m_dynamic_type() @@ -996,7 +996,7 @@ TypeImpl::TypeImpl (const ClangASTType &static_type, const ClangASTType &dynamic SetType (static_type, dynamic_type); } -TypeImpl::TypeImpl (const TypePair &pair, const ClangASTType &dynamic) : +TypeImpl::TypeImpl (const TypePair &pair, const CompilerType &dynamic) : m_module_wp (), m_static_type (), m_dynamic_type() @@ -1015,21 +1015,21 @@ TypeImpl::SetType (const lldb::TypeSP &type_sp) } void -TypeImpl::SetType (const ClangASTType &clang_type) +TypeImpl::SetType (const CompilerType &clang_type) { m_module_wp = lldb::ModuleWP(); m_static_type.SetType (clang_type); } void -TypeImpl::SetType (const lldb::TypeSP &type_sp, const ClangASTType &dynamic) +TypeImpl::SetType (const lldb::TypeSP &type_sp, const CompilerType &dynamic) { SetType (type_sp); m_dynamic_type = dynamic; } void -TypeImpl::SetType (const ClangASTType &clang_type, const ClangASTType &dynamic) +TypeImpl::SetType (const CompilerType &clang_type, const CompilerType &dynamic) { m_module_wp = lldb::ModuleWP(); m_static_type.SetType (clang_type); @@ -1037,7 +1037,7 @@ TypeImpl::SetType (const ClangASTType &clang_type, const ClangASTType &dynamic) } void -TypeImpl::SetType (const TypePair &pair, const ClangASTType &dynamic) +TypeImpl::SetType (const TypePair &pair, const CompilerType &dynamic) { m_module_wp = pair.GetModule(); m_static_type = pair; @@ -1252,8 +1252,8 @@ TypeImpl::GetCanonicalType() const return TypeImpl(); } -ClangASTType -TypeImpl::GetClangASTType (bool prefer_dynamic) +CompilerType +TypeImpl::GetCompilerType (bool prefer_dynamic) { ModuleSP module_sp; if (CheckModule (module_sp)) @@ -1263,9 +1263,9 @@ TypeImpl::GetClangASTType (bool prefer_dynamic) if (m_dynamic_type.IsValid()) return m_dynamic_type; } - return m_static_type.GetClangASTType(); + return m_static_type.GetCompilerType(); } - return ClangASTType(); + return CompilerType(); } TypeSystem * @@ -1279,7 +1279,7 @@ TypeImpl::GetTypeSystem (bool prefer_dynamic) if (m_dynamic_type.IsValid()) return m_dynamic_type.GetTypeSystem(); } - return m_static_type.GetClangASTType().GetTypeSystem(); + return m_static_type.GetCompilerType().GetTypeSystem(); } return NULL; } @@ -1297,7 +1297,7 @@ TypeImpl::GetDescription (lldb_private::Stream &strm, m_dynamic_type.DumpTypeDescription(&strm); strm.Printf("\nStatic:\n"); } - m_static_type.GetClangASTType().DumpTypeDescription(&strm); + m_static_type.GetCompilerType().DumpTypeDescription(&strm); } else { @@ -1331,7 +1331,7 @@ TypeMemberFunctionImpl::GetName () const return m_name; } -ClangASTType +CompilerType TypeMemberFunctionImpl::GetType () const { return m_type; @@ -1384,14 +1384,14 @@ TypeMemberFunctionImpl::GetDescription (Stream& stream) return true; } -ClangASTType +CompilerType TypeMemberFunctionImpl::GetReturnType () const { if (m_type) return m_type.GetFunctionReturnType(); if (m_objc_method_decl) - return ClangASTType(&m_objc_method_decl->getASTContext(), m_objc_method_decl->getReturnType()); - return ClangASTType(); + return CompilerType(&m_objc_method_decl->getASTContext(), m_objc_method_decl->getReturnType()); + return CompilerType(); } size_t @@ -1404,7 +1404,7 @@ TypeMemberFunctionImpl::GetNumArguments () const return 0; } -ClangASTType +CompilerType TypeMemberFunctionImpl::GetArgumentAtIndex (size_t idx) const { if (m_type) @@ -1412,13 +1412,13 @@ TypeMemberFunctionImpl::GetArgumentAtIndex (size_t idx) const if (m_objc_method_decl) { if (idx < m_objc_method_decl->param_size()) - return ClangASTType(&m_objc_method_decl->getASTContext(), m_objc_method_decl->parameters()[idx]->getOriginalType()); + return CompilerType(&m_objc_method_decl->getASTContext(), m_objc_method_decl->parameters()[idx]->getOriginalType()); } - return ClangASTType(); + return CompilerType(); } TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl, - const lldb_private::ClangASTType& integer_type) : + const lldb_private::CompilerType& integer_type) : m_integer_type_sp(), m_name(), m_value(), diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp index 0de45f2..c2772cd 100644 --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -558,7 +558,7 @@ static void PrivateAutoComplete (StackFrame *frame, const std::string &partial_path, const std::string &prefix_path, // Anything that has been resolved already will be in here - const ClangASTType& clang_type, + const CompilerType& clang_type, StringList &matches, bool &word_complete); @@ -567,7 +567,7 @@ PrivateAutoCompleteMembers (StackFrame *frame, const std::string &partial_member_name, const std::string &partial_path, const std::string &prefix_path, // Anything that has been resolved already will be in here - const ClangASTType& clang_type, + const CompilerType& clang_type, StringList &matches, bool &word_complete); @@ -576,7 +576,7 @@ PrivateAutoCompleteMembers (StackFrame *frame, const std::string &partial_member_name, const std::string &partial_path, const std::string &prefix_path, // Anything that has been resolved already will be in here - const ClangASTType& clang_type, + const CompilerType& clang_type, StringList &matches, bool &word_complete) { @@ -588,7 +588,7 @@ PrivateAutoCompleteMembers (StackFrame *frame, { for (uint32_t i = 0; i < num_bases; ++i) { - ClangASTType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(clang_type, i, nullptr)); + CompilerType base_class_type (ClangASTContext::GetDirectBaseClassAtIndex(clang_type, i, nullptr)); PrivateAutoCompleteMembers (frame, partial_member_name, @@ -606,7 +606,7 @@ PrivateAutoCompleteMembers (StackFrame *frame, { for (uint32_t i = 0; i < num_vbases; ++i) { - ClangASTType vbase_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(clang_type, i,nullptr)); + CompilerType vbase_class_type (ClangASTContext::GetVirtualBaseClassAtIndex(clang_type, i,nullptr)); PrivateAutoCompleteMembers (frame, partial_member_name, @@ -627,7 +627,7 @@ PrivateAutoCompleteMembers (StackFrame *frame, { std::string member_name; - ClangASTType member_clang_type = clang_type.GetFieldAtIndex (i, member_name, nullptr, nullptr, nullptr); + CompilerType member_clang_type = clang_type.GetFieldAtIndex (i, member_name, nullptr, nullptr, nullptr); if (partial_member_name.empty() || member_name.find(partial_member_name) == 0) @@ -654,7 +654,7 @@ static void PrivateAutoComplete (StackFrame *frame, const std::string &partial_path, const std::string &prefix_path, // Anything that has been resolved already will be in here - const ClangASTType& clang_type, + const CompilerType& clang_type, StringList &matches, bool &word_complete) { @@ -767,7 +767,7 @@ PrivateAutoComplete (StackFrame *frame, { case lldb::eTypeClassPointer: { - ClangASTType pointee_type(clang_type.GetPointeeType()); + CompilerType pointee_type(clang_type.GetPointeeType()); if (partial_path[2]) { // If there is more after the "->", then search deeper @@ -886,7 +886,7 @@ PrivateAutoComplete (StackFrame *frame, Type *variable_type = variable->GetType(); if (variable_type) { - ClangASTType variable_clang_type (variable_type->GetClangForwardType()); + CompilerType variable_clang_type (variable_type->GetClangForwardType()); PrivateAutoComplete (frame, remaining_partial_path, prefix_path + token, // Anything that has been resolved already will be in here @@ -923,7 +923,7 @@ Variable::AutoComplete (const ExecutionContext &exe_ctx, word_complete = false; std::string partial_path; std::string prefix_path; - ClangASTType clang_type; + CompilerType clang_type; if (partial_path_cstr && partial_path_cstr[0]) partial_path = partial_path_cstr; diff --git a/lldb/source/Target/ABI.cpp b/lldb/source/Target/ABI.cpp index 8809c1e..291117d 100644 --- a/lldb/source/Target/ABI.cpp +++ b/lldb/source/Target/ABI.cpp @@ -12,7 +12,7 @@ #include "lldb/Core/Value.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Expression/ClangPersistentVariables.h" -#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/CompilerType.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" @@ -105,7 +105,7 @@ ABI::GetRegisterInfoByKind (RegisterKind reg_kind, uint32_t reg_num, RegisterInf ValueObjectSP ABI::GetReturnValueObject (Thread &thread, - ClangASTType &ast_type, + CompilerType &ast_type, bool persistent) const { if (!ast_type.IsValid()) diff --git a/lldb/source/Target/ObjCLanguageRuntime.cpp b/lldb/source/Target/ObjCLanguageRuntime.cpp index 73d7899..df986f6 100644 --- a/lldb/source/Target/ObjCLanguageRuntime.cpp +++ b/lldb/source/Target/ObjCLanguageRuntime.cpp @@ -152,7 +152,7 @@ ObjCLanguageRuntime::LookupInCompleteClassCache (ConstString &name) } size_t -ObjCLanguageRuntime::GetByteOffsetForIvar (ClangASTType &parent_qual_type, const char *ivar_name) +ObjCLanguageRuntime::GetByteOffsetForIvar (CompilerType &parent_qual_type, const char *ivar_name) { return LLDB_INVALID_IVAR_OFFSET; } @@ -619,20 +619,20 @@ ObjCLanguageRuntime::GetNonKVOClassDescriptor (ObjCISA isa) } -ClangASTType +CompilerType ObjCLanguageRuntime::EncodingToType::RealizeType (const char* name, bool for_expression) { if (m_scratch_ast_ctx_ap) return RealizeType(*m_scratch_ast_ctx_ap, name, for_expression); - return ClangASTType(); + return CompilerType(); } -ClangASTType +CompilerType ObjCLanguageRuntime::EncodingToType::RealizeType (ClangASTContext& ast_ctx, const char* name, bool for_expression) { clang::ASTContext *clang_ast = ast_ctx.getASTContext(); if (!clang_ast) - return ClangASTType(); + return CompilerType(); return RealizeType(*clang_ast, name, for_expression); } @@ -645,7 +645,7 @@ ObjCLanguageRuntime::GetEncodingToType () } bool -ObjCLanguageRuntime::GetTypeBitSize (const ClangASTType& clang_type, +ObjCLanguageRuntime::GetTypeBitSize (const CompilerType& clang_type, uint64_t &size) { void *opaque_ptr = clang_type.GetOpaqueQualType(); diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 3e4292f..df209b6 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -621,7 +621,7 @@ CheckIfWatchpointsExhausted(Target *target, Error &error) // See also Watchpoint::SetWatchpointType(uint32_t type) and // the OptionGroupWatchpoint::WatchType enum type. WatchpointSP -Target::CreateWatchpoint(lldb::addr_t addr, size_t size, const ClangASTType *type, uint32_t kind, Error &error) +Target::CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, Error &error) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_WATCHPOINTS)); if (log) diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 0f06228..a1e6956 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -1923,7 +1923,7 @@ Thread::ReturnFromFrame (lldb::StackFrameSP frame_sp, lldb::ValueObjectSP return Type *function_type = sc.function->GetType(); if (function_type) { - ClangASTType return_type = sc.function->GetClangType().GetFunctionReturnType(); + CompilerType return_type = sc.function->GetClangType().GetFunctionReturnType(); if (return_type) { StreamString s; diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index e7b3abd3..cf4d0c4 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -135,7 +135,7 @@ ThreadPlanCallFunction::ConstructorSetup (Thread &thread, ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, const Address &function, - const ClangASTType &return_type, + const CompilerType &return_type, llvm::ArrayRef<addr_t> args, const EvaluateExpressionOptions &options) : ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion), @@ -188,7 +188,7 @@ ThreadPlanCallFunction::ThreadPlanCallFunction(Thread &thread, m_should_clear_objc_exception_bp(false), m_should_clear_cxx_exception_bp(false), m_stop_address(LLDB_INVALID_ADDRESS), - m_return_type(ClangASTType()) + m_return_type(CompilerType()) { } diff --git a/lldb/source/Target/ThreadPlanCallUserExpression.cpp b/lldb/source/Target/ThreadPlanCallUserExpression.cpp index 1773777..3ec3284 100644 --- a/lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ b/lldb/source/Target/ThreadPlanCallUserExpression.cpp @@ -42,7 +42,7 @@ ThreadPlanCallUserExpression::ThreadPlanCallUserExpression (Thread &thread, llvm::ArrayRef<lldb::addr_t> args, const EvaluateExpressionOptions &options, lldb::ClangUserExpressionSP &user_expression_sp) : - ThreadPlanCallFunction (thread, function, ClangASTType(), args, options), + ThreadPlanCallFunction (thread, function, CompilerType(), args, options), m_user_expression_sp (user_expression_sp) { // User expressions are generally "User generated" so we should set them up to stop when done. diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp index 9b39d1c..0cdc4c7 100644 --- a/lldb/source/Target/ThreadPlanStepOut.cpp +++ b/lldb/source/Target/ThreadPlanStepOut.cpp @@ -533,7 +533,7 @@ ThreadPlanStepOut::CalculateReturnValue () if (m_immediate_step_from_function != NULL) { - ClangASTType return_clang_type = m_immediate_step_from_function->GetClangType().GetFunctionReturnType(); + CompilerType return_clang_type = m_immediate_step_from_function->GetClangType().GetFunctionReturnType(); if (return_clang_type) { lldb::ABISP abi_sp = m_thread.GetProcess()->GetABI(); |