summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp3
-rw-r--r--lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp4
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp6
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp17
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp182
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp13
9 files changed, 129 insertions, 104 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
index 700d223fbc6..3e0861b87d6 100644
--- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
@@ -424,7 +424,8 @@ ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread,
if (!clang_type)
return return_valobj_sp;
- clang::ASTContext *ast_context = clang_type.GetASTContext();
+ ClangASTContext* ast = clang_type.GetTypeSystem()->AsClangASTContext();
+ clang::ASTContext *ast_context = ast ? ast->getASTContext() : nullptr;
if (!ast_context)
return return_valobj_sp;
diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
index 0d305a390a6..08c0481f8b5 100644
--- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -425,10 +425,6 @@ ABISysV_arm::GetReturnValueObjectImpl (Thread &thread,
if (!clang_type)
return return_valobj_sp;
- clang::ASTContext *ast_context = clang_type.GetASTContext();
- if (!ast_context)
- return return_valobj_sp;
-
//value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType());
value.SetClangType (clang_type);
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 6fc4f558c33..908a53c935f 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -189,7 +189,7 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
type_sp = class_types.GetTypeAtIndex(i);
if (type_sp)
{
- if (type_sp->GetClangFullType().IsCXXClassType())
+ if (ClangASTContext::IsCXXClassType(type_sp->GetClangFullType()))
{
if (log)
log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types, picking this one: uid={0x%" PRIx64 "}, type-name='%s'\n",
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
index 088df76281a..6ceb1486e42 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -357,7 +357,7 @@ public:
clang::Selector sel = ast_ctx.Selectors.getSelector(is_zero_argument ? 0 : selector_components.size(), selector_components.data());
- clang::QualType ret_type = type_realizer_sp->RealizeType(interface_decl->getASTContext(), m_type_vector[0].c_str(), for_expression).GetQualType();
+ clang::QualType ret_type = ClangASTContext::GetQualType(type_realizer_sp->RealizeType(interface_decl->getASTContext(), m_type_vector[0].c_str(), for_expression));
if (ret_type.isNull())
return NULL;
@@ -384,7 +384,7 @@ public:
++ai)
{
const bool for_expression = true;
- clang::QualType arg_type = type_realizer_sp->RealizeType(ast_ctx, m_type_vector[ai].c_str(), for_expression).GetQualType();
+ clang::QualType arg_type = ClangASTContext::GetQualType(type_realizer_sp->RealizeType(ast_ctx, m_type_vector[ai].c_str(), for_expression));
if (arg_type.isNull())
return NULL; // well, we just wasted a bunch of time. Wish we could delete the stuff we'd just made!
@@ -507,7 +507,7 @@ AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl)
clang::SourceLocation(),
clang::SourceLocation(),
&m_ast_ctx.getASTContext()->Idents.get(name),
- ivar_type.GetQualType(),
+ ClangASTContext::GetQualType(ivar_type),
type_source_info, // TypeSourceInfo *
clang::ObjCIvarDecl::Public,
0,
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 258df3f1642..4434404797f 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -92,7 +92,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon
ClangASTType clang_type = value.GetClangType();
if (clang_type)
{
- if (!clang_type.IsObjCObjectPointerType())
+ if (!ClangASTContext::IsObjCObjectPointerType(clang_type))
{
strm.Printf ("Value doesn't point to an ObjC object.\n");
return false;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
index 10f7f82828b..03a1f2ba7a9 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -139,7 +139,7 @@ AppleObjCTypeEncodingParser::BuildAggregate (clang::ASTContext &ast_ctx, lldb_ut
ClangASTType union_type(lldb_ctx->CreateRecordType(nullptr, lldb::eAccessPublic, name.c_str(), kind, lldb::eLanguageTypeC));
if (union_type)
{
- union_type.StartTagDeclarationDefinition();
+ ClangASTContext::StartTagDeclarationDefinition(union_type);
unsigned int count = 0;
for (auto element: elements)
@@ -150,13 +150,12 @@ AppleObjCTypeEncodingParser::BuildAggregate (clang::ASTContext &ast_ctx, lldb_ut
elem_name.Printf("__unnamed_%u",count);
element.name = std::string(elem_name.GetData());
}
- union_type.AddFieldToRecordType(element.name.c_str(), ClangASTType(&ast_ctx,element.type.getAsOpaquePtr()), lldb::eAccessPublic, element.bitfield);
+ ClangASTContext::AddFieldToRecordType(union_type, element.name.c_str(), ClangASTType(&ast_ctx, element.type), lldb::eAccessPublic, element.bitfield);
++count;
}
-
- union_type.CompleteTagDeclarationDefinition();
+ ClangASTContext::CompleteTagDeclarationDefinition(union_type);
}
- return union_type.GetQualType();
+ return ClangASTContext::GetQualType(union_type);
}
clang::QualType
@@ -171,8 +170,8 @@ 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.getAsOpaquePtr()), size, false));
- return array_type.GetQualType();
+ ClangASTType array_type(lldb_ctx->CreateArrayType(ClangASTType(&ast_ctx, element_type), size, false));
+ return ClangASTContext::GetQualType(array_type);
}
// the runtime can emit these in the form of @"SomeType", giving more specifics
@@ -263,7 +262,7 @@ AppleObjCTypeEncodingParser::BuildObjCObjectPointerType (clang::ASTContext &ast_
return ast_ctx.getObjCIdType();
#endif
- return ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType().GetQualType();
+ return ClangASTContext::GetQualType(ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType());
}
else
{
@@ -392,7 +391,7 @@ AppleObjCTypeEncodingParser::RealizeType (clang::ASTContext &ast_ctx, const char
{
StringLexer lexer(name);
clang::QualType qual_type = BuildType(ast_ctx, lexer, for_expression);
- return ClangASTType(&ast_ctx, qual_type.getAsOpaquePtr());
+ return ClangASTType(&ast_ctx, qual_type);
}
return ClangASTType();
}
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
index 01814aac1f3..adfef2e5602 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -434,10 +434,10 @@ public:
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
- GetPluginName();
+ GetPluginName() override;
virtual uint32_t
- GetPluginVersion();
+ GetPluginVersion() override;
protected:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 3f2e1d811c7..c8a598dd2b3 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1707,11 +1707,11 @@ SymbolFileDWARF::ParseTemplateDIE (DWARFCompileUnit* dwarf_cu,
llvm::APInt apint (lldb_type->GetByteSize() * 8, uval64, is_signed);
template_param_infos.args.push_back (clang::TemplateArgument (*ast,
llvm::APSInt(apint),
- clang_type.GetQualType()));
+ ClangASTContext::GetQualType(clang_type)));
}
else
{
- template_param_infos.args.push_back (clang::TemplateArgument (clang_type.GetQualType()));
+ template_param_infos.args.push_back (clang::TemplateArgument (ClangASTContext::GetQualType(clang_type)));
}
}
else
@@ -1838,13 +1838,16 @@ public:
bool
Finalize()
{
- return m_class_opaque_type.AddObjCClassProperty (m_property_name,
- m_property_opaque_type,
- m_ivar_decl,
- m_property_setter_name,
- m_property_getter_name,
- m_property_attributes,
- m_metadata_ap.get());
+ ClangASTContext* ast = m_class_opaque_type.GetTypeSystem()->AsClangASTContext();
+ assert(ast);
+ return ast->AddObjCClassProperty (m_class_opaque_type,
+ m_property_name,
+ m_property_opaque_type,
+ m_ivar_decl,
+ m_property_setter_name,
+ m_property_getter_name,
+ m_property_attributes,
+ m_metadata_ap.get());
}
private:
ClangASTType m_class_opaque_type;
@@ -1938,6 +1941,9 @@ SymbolFileDWARF::ParseChildMembers
uint32_t member_idx = 0;
BitfieldInfo last_field_info;
ModuleSP module = GetObjectFile()->GetModule();
+ ClangASTContext* ast = class_clang_type.GetTypeSystem()->AsClangASTContext();
+ if (ast == nullptr)
+ return 0;
for (die = parent_die->GetFirstChild(); die != NULL; die = die->GetSibling())
{
@@ -2126,7 +2132,8 @@ SymbolFileDWARF::ParseChildMembers
{
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
- class_clang_type.AddVariableToRecordType (name,
+ ClangASTContext::AddVariableToRecordType (class_clang_type,
+ name,
var_type->GetClangLayoutType(),
accessibility);
}
@@ -2243,10 +2250,12 @@ SymbolFileDWARF::ParseChildMembers
if (anon_field_info.IsValid())
{
- clang::FieldDecl *unnamed_bitfield_decl = class_clang_type.AddFieldToRecordType (NULL,
- GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width),
- accessibility,
- anon_field_info.bit_size);
+ clang::FieldDecl *unnamed_bitfield_decl =
+ ClangASTContext::AddFieldToRecordType (class_clang_type,
+ NULL,
+ GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width),
+ accessibility,
+ anon_field_info.bit_size);
layout_info.field_offsets.insert(
std::make_pair(unnamed_bitfield_decl, anon_field_info.bit_offset));
@@ -2293,7 +2302,8 @@ SymbolFileDWARF::ParseChildMembers
}
}
- field_decl = class_clang_type.AddFieldToRecordType (name,
+ field_decl = ClangASTContext::AddFieldToRecordType (class_clang_type,
+ name,
member_clang_type,
accessibility,
bit_size);
@@ -2448,13 +2458,14 @@ SymbolFileDWARF::ParseChildMembers
assert (base_class_clang_type);
if (class_language == eLanguageTypeObjC)
{
- class_clang_type.SetObjCSuperClass(base_class_clang_type);
+ ast->SetObjCSuperClass(class_clang_type, base_class_clang_type);
}
else
{
- base_classes.push_back (base_class_clang_type.CreateBaseClassSpecifier (accessibility,
- is_virtual,
- is_base_of_class));
+ base_classes.push_back (ast->CreateBaseClassSpecifier (base_class_clang_type.GetOpaqueQualType(),
+ accessibility,
+ is_virtual,
+ is_base_of_class));
if (is_virtual)
{
@@ -2469,7 +2480,7 @@ SymbolFileDWARF::ParseChildMembers
else
{
layout_info.base_offsets.insert(
- std::make_pair(base_class_clang_type.GetAsCXXRecordDecl(),
+ std::make_pair(ast->GetAsCXXRecordDecl(base_class_clang_type.GetOpaqueQualType()),
clang::CharUnits::fromQuantity(member_byte_offset)));
}
}
@@ -2590,7 +2601,7 @@ SymbolFileDWARF::ResolveTypeUID (DWARFCompileUnit* cu, const DWARFDebugInfoEntry
bool
SymbolFileDWARF::HasForwardDeclForClangType (const ClangASTType &clang_type)
{
- ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers();
+ ClangASTType 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;
}
@@ -2600,7 +2611,7 @@ bool
SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
{
// We have a struct/union/class/enum that needs to be fully resolved.
- ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers();
+ ClangASTType 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)
{
@@ -2613,9 +2624,16 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
// are done.
m_forward_decl_clang_type_to_die.erase (clang_type_no_qualifiers.GetOpaqueQualType());
+ ClangASTContext* ast = clang_type.GetTypeSystem()->AsClangASTContext();
+ if (ast == NULL)
+ {
+ // Not a clang type
+ return true;
+ }
+
// Disable external storage for this type so we don't get anymore
// clang::ExternalASTSource queries for this type.
- clang_type.SetHasExternalStorage (false);
+ ast->SetHasExternalStorage (clang_type.GetOpaqueQualType(), false);
DWARFDebugInfo* debug_info = DebugInfo();
@@ -2646,12 +2664,12 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (die->HasChildren())
{
LanguageType class_language = eLanguageTypeUnknown;
- if (clang_type.IsObjCObjectOrInterfaceType())
+ if (ClangASTContext::IsObjCObjectOrInterfaceType(clang_type))
{
class_language = eLanguageTypeObjC;
// For objective C we don't start the definition when
// the class is created.
- clang_type.StartTagDeclarationDefinition ();
+ ClangASTContext::StartTagDeclarationDefinition (clang_type);
}
int tag_decl_kind = -1;
@@ -2758,7 +2776,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (class_language != eLanguageTypeObjC)
{
if (is_a_class && tag_decl_kind != clang::TTK_Class)
- clang_type.SetTagTypeKind (clang::TTK_Class);
+ GetClangASTContext().SetTagTypeKind (ClangASTContext::GetQualType(clang_type), clang::TTK_Class);
}
// Since DW_TAG_structure_type gets used for both classes
@@ -2775,9 +2793,10 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
{
// This is a class and all members that didn't have
// their access specified are private.
- clang_type.SetDefaultAccessForRecordFields (eAccessPrivate,
- &member_accessibilities.front(),
- member_accessibilities.size());
+ GetClangASTContext().SetDefaultAccessForRecordFields (ast->GetAsRecordDecl(clang_type),
+ eAccessPrivate,
+ &member_accessibilities.front(),
+ member_accessibilities.size());
}
if (!base_classes.empty())
@@ -2808,24 +2827,26 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
// below. Since we provide layout assistance, all ivars in this
// class and other classes will be fine, this is the best we can do
// short of crashing.
- base_class_type.StartTagDeclarationDefinition ();
- base_class_type.CompleteTagDeclarationDefinition ();
+
+ ClangASTContext::StartTagDeclarationDefinition (base_class_type);
+ ClangASTContext::CompleteTagDeclarationDefinition (base_class_type);
}
}
}
- clang_type.SetBaseClassesForClassType (&base_classes.front(),
- base_classes.size());
+ ast->SetBaseClassesForClassType (clang_type.GetOpaqueQualType(),
+ &base_classes.front(),
+ base_classes.size());
// Clang will copy each CXXBaseSpecifier in "base_classes"
// so we have to free them all.
- ClangASTType::DeleteBaseClassSpecifiers (&base_classes.front(),
- base_classes.size());
+ ClangASTContext::DeleteBaseClassSpecifiers (&base_classes.front(),
+ base_classes.size());
}
}
}
- clang_type.BuildIndirectFields ();
- clang_type.CompleteTagDeclarationDefinition ();
+ ClangASTContext::BuildIndirectFields (clang_type);
+ ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
if (!layout_info.field_offsets.empty() ||
!layout_info.base_offsets.empty() ||
@@ -2836,7 +2857,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (layout_info.bit_size == 0)
layout_info.bit_size = die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, 0) * 8;
- clang::CXXRecordDecl *record_decl = clang_type.GetAsCXXRecordDecl();
+ clang::CXXRecordDecl *record_decl = ast->GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
if (record_decl)
{
if (log)
@@ -2901,7 +2922,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
return (bool)clang_type;
case DW_TAG_enumeration_type:
- clang_type.StartTagDeclarationDefinition ();
+ ClangASTContext::StartTagDeclarationDefinition (clang_type);
if (die->HasChildren())
{
SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
@@ -2909,7 +2930,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
clang_type.IsIntegerType(is_signed);
ParseChildEnumerators(sc, clang_type, is_signed, type->GetByteSize(), dwarf_cu, die);
}
- clang_type.CompleteTagDeclarationDefinition ();
+ ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
return (bool)clang_type;
default:
@@ -4781,12 +4802,17 @@ SymbolFileDWARF::ParseChildEnumerators
if (name && name[0] && got_value)
{
- clang_type.AddEnumerationValueToEnumerationType (clang_type.GetEnumerationIntegerType(),
- decl,
- name,
- enum_value,
- enumerator_byte_size * 8);
- ++enumerators_added;
+ ClangASTContext* ast = clang_type.GetTypeSystem()->AsClangASTContext();
+ if (ast)
+ {
+ ast->AddEnumerationValueToEnumerationType (clang_type.GetOpaqueQualType(),
+ ast->GetEnumerationIntegerType(clang_type.GetOpaqueQualType()),
+ decl,
+ name,
+ enum_value,
+ enumerator_byte_size * 8);
+ ++enumerators_added;
+ }
}
}
}
@@ -5053,7 +5079,7 @@ SymbolFileDWARF::GetClangDeclContextContainingDIE (DWARFCompileUnit *cu, const D
Type* type = ResolveType (cu, decl_ctx_die);
if (type)
{
- clang::DeclContext *decl_ctx = type->GetClangForwardType().GetDeclContextForType ();
+ clang::DeclContext *decl_ctx = GetClangASTContext().GetDeclContextForType(type->GetClangForwardType());
if (decl_ctx)
{
LinkDeclContextToDIE (decl_ctx, decl_ctx_die);
@@ -6355,7 +6381,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
}
assert (tag_decl_kind != -1);
bool clang_type_was_created = false;
- clang_type.SetClangType(ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetClangType(&ast, m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
const DWARFDebugInfoEntry *decl_ctx_die;
@@ -6412,7 +6438,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
// Store a forward declaration to this class type in case any
// parameters in any class methods need it for the clang
// types for function prototypes.
- LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die);
+ LinkDeclContextToDIE(ast.GetDeclContextForType(clang_type), die);
type_sp.reset (new Type (MakeUserID(die->GetOffset()),
this,
type_name_const_str,
@@ -6477,12 +6503,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (die->HasChildren() == false)
{
// No children for this struct/union/class, lets finish it
- clang_type.StartTagDeclarationDefinition ();
- clang_type.CompleteTagDeclarationDefinition ();
+ ClangASTContext::StartTagDeclarationDefinition (clang_type);
+ ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
if (tag == DW_TAG_structure_type) // this only applies in C
{
- clang::RecordDecl *record_decl = clang_type.GetAsRecordDecl();
+ clang::RecordDecl *record_decl = ClangASTContext::GetAsRecordDecl(clang_type);
if (record_decl)
m_record_decl_to_layout_map.insert(std::make_pair(record_decl, LayoutInfo()));
@@ -6500,7 +6526,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (class_language != eLanguageTypeObjC &&
class_language != eLanguageTypeObjC_plus_plus)
- clang_type.StartTagDeclarationDefinition ();
+ ClangASTContext::StartTagDeclarationDefinition (clang_type);
// Leave this as a forward declaration until we need
// to know the details of the type. lldb_private::Type
@@ -6508,8 +6534,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
// "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition(Type *)"
// When the definition needs to be defined.
m_forward_decl_die_to_clang_type[die] = clang_type.GetOpaqueQualType();
- m_forward_decl_clang_type_to_die[clang_type.RemoveFastQualifiers().GetOpaqueQualType()] = die;
- clang_type.SetHasExternalStorage (true);
+ m_forward_decl_clang_type_to_die[ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] = die;
+ ast.SetHasExternalStorage (clang_type.GetOpaqueQualType(), true);
}
}
@@ -6565,7 +6591,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;
- clang_type.SetClangType (ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetClangType (&ast, m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
if (encoding_uid != DW_INVALID_OFFSET)
@@ -6587,10 +6613,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
}
else
{
- enumerator_clang_type = clang_type.GetEnumerationIntegerType ();
+ enumerator_clang_type = ast.GetEnumerationIntegerType (clang_type.GetOpaqueQualType());
}
- LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die);
+ LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die);
type_sp.reset( new Type (MakeUserID(die->GetOffset()),
this,
@@ -6603,7 +6629,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
clang_type,
Type::eResolveStateForward));
- clang_type.StartTagDeclarationDefinition ();
+ ClangASTContext::StartTagDeclarationDefinition (clang_type);
if (die->HasChildren())
{
SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
@@ -6611,7 +6637,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
enumerator_clang_type.IsIntegerType(is_signed);
ParseChildEnumerators(cu_sc, clang_type, is_signed, type_sp->GetByteSize(), dwarf_cu, die);
}
- clang_type.CompleteTagDeclarationDefinition ();
+ ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
}
}
break;
@@ -6801,7 +6827,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();
- if (type_clang_forward_type.IsObjCObjectOrInterfaceType ())
+ if (ClangASTContext::IsObjCObjectOrInterfaceType(type_clang_forward_type))
class_opaque_type = type_clang_forward_type;
}
}
@@ -6813,10 +6839,11 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
- clang::ObjCMethodDecl *objc_method_decl = class_opaque_type.AddMethodToObjCObjectType (type_name_cstr,
- clang_type,
- accessibility,
- is_artificial);
+ clang::ObjCMethodDecl *objc_method_decl = ast.AddMethodToObjCObjectType (class_opaque_type,
+ type_name_cstr,
+ clang_type,
+ accessibility,
+ is_artificial);
type_handled = objc_method_decl != NULL;
if (type_handled)
{
@@ -6936,7 +6963,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
else
{
ClangASTType class_opaque_type = class_type->GetClangForwardType();
- if (class_opaque_type.IsCXXClassType ())
+ if (ClangASTContext::IsCXXClassType(class_opaque_type))
{
if (class_opaque_type.IsBeingDefined ())
{
@@ -6964,15 +6991,16 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
const bool is_attr_used = false;
- cxx_method_decl = class_opaque_type.AddMethodToCXXRecordType (type_name_cstr,
- clang_type,
- accessibility,
- is_virtual,
- is_static,
- is_inline,
- is_explicit,
- is_attr_used,
- is_artificial);
+ cxx_method_decl = ast.AddMethodToCXXRecordType (class_opaque_type.GetOpaqueQualType(),
+ type_name_cstr,
+ clang_type,
+ accessibility,
+ is_virtual,
+ is_static,
+ is_inline,
+ is_explicit,
+ is_attr_used,
+ is_artificial);
type_handled = cxx_method_decl != NULL;
@@ -7225,7 +7253,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
ClangASTType pointee_clang_type = pointee_type->GetClangForwardType();
ClangASTType class_clang_type = class_type->GetClangLayoutType();
- clang_type = pointee_clang_type.CreateMemberPointerType(class_clang_type);
+ clang_type = ClangASTContext::CreateMemberPointerType(pointee_clang_type, class_clang_type);
byte_size = clang_type.GetByteSize(nullptr);
@@ -8142,7 +8170,7 @@ SymbolFileDWARF::SearchDeclContext (const clang::DeclContext *decl_context,
Type *matching_type = ResolveType (dwarf_cu, die);
- clang::QualType qual_type = matching_type->GetClangForwardType().GetQualType();
+ clang::QualType qual_type = ClangASTContext::GetQualType(matching_type->GetClangForwardType());
if (const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr()))
{
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 67f9c59cadf..4e75babc135 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -448,12 +448,13 @@ SystemRuntimeMacOSX::ReadLibdispatchTSDIndexes ()
{
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);
- dispatch_tsd_indexes_s.StartTagDeclarationDefinition();
- dispatch_tsd_indexes_s.AddFieldToRecordType ("dti_version", uint16, lldb::eAccessPublic, 0);
- dispatch_tsd_indexes_s.AddFieldToRecordType ("dti_queue_index", uint16, lldb::eAccessPublic, 0);
- dispatch_tsd_indexes_s.AddFieldToRecordType ("dti_voucher_index", uint16, lldb::eAccessPublic, 0);
- dispatch_tsd_indexes_s.AddFieldToRecordType ("dti_qos_class_index", uint16, lldb::eAccessPublic, 0);
- dispatch_tsd_indexes_s.CompleteTagDeclarationDefinition();
+
+ ClangASTContext::StartTagDeclarationDefinition(dispatch_tsd_indexes_s);
+ ClangASTContext::AddFieldToRecordType (dispatch_tsd_indexes_s, "dti_version", uint16, lldb::eAccessPublic, 0);
+ ClangASTContext::AddFieldToRecordType (dispatch_tsd_indexes_s, "dti_queue_index", uint16, lldb::eAccessPublic, 0);
+ ClangASTContext::AddFieldToRecordType (dispatch_tsd_indexes_s, "dti_voucher_index", uint16, lldb::eAccessPublic, 0);
+ ClangASTContext::AddFieldToRecordType (dispatch_tsd_indexes_s, "dti_qos_class_index", uint16, lldb::eAccessPublic, 0);
+ ClangASTContext::CompleteTagDeclarationDefinition(dispatch_tsd_indexes_s);
ProcessStructReader struct_reader (m_process, m_dispatch_tsd_indexes_addr, dispatch_tsd_indexes_s);
OpenPOWER on IntegriCloud