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/SymbolFile/DWARF/SymbolFileDWARF.cpp182
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp13
8 files changed, 102 insertions, 127 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
index 3e0861b87d6..700d223fbc6 100644
--- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
@@ -424,8 +424,7 @@ ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread,
if (!clang_type)
return return_valobj_sp;
- ClangASTContext* ast = clang_type.GetTypeSystem()->AsClangASTContext();
- clang::ASTContext *ast_context = ast ? ast->getASTContext() : nullptr;
+ clang::ASTContext *ast_context = clang_type.GetASTContext();
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 4425dd7e7b3..50a9863d83e 100644
--- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -408,6 +408,10 @@ 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 e4b17afda51..7d21b779ebd 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 (ClangASTContext::IsCXXClassType(type_sp->GetClangFullType()))
+ if (type_sp->GetClangFullType().IsCXXClassType())
{
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 5236af257a9..76ac690e717 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -363,7 +363,7 @@ public:
clang::Selector sel = ast_ctx.Selectors.getSelector(is_zero_argument ? 0 : selector_components.size(), selector_components.data());
- clang::QualType ret_type = ClangASTContext::GetQualType(type_realizer_sp->RealizeType(interface_decl->getASTContext(), m_type_vector[0].c_str(), for_expression));
+ clang::QualType ret_type = type_realizer_sp->RealizeType(interface_decl->getASTContext(), m_type_vector[0].c_str(), for_expression).GetQualType();
if (ret_type.isNull())
return NULL;
@@ -390,7 +390,7 @@ public:
++ai)
{
const bool for_expression = true;
- clang::QualType arg_type = ClangASTContext::GetQualType(type_realizer_sp->RealizeType(ast_ctx, m_type_vector[ai].c_str(), for_expression));
+ clang::QualType arg_type = type_realizer_sp->RealizeType(ast_ctx, m_type_vector[ai].c_str(), for_expression).GetQualType();
if (arg_type.isNull())
return NULL; // well, we just wasted a bunch of time. Wish we could delete the stuff we'd just made!
@@ -512,7 +512,7 @@ AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl)
clang::SourceLocation(),
clang::SourceLocation(),
&m_ast_ctx.getASTContext()->Idents.get(name),
- ClangASTContext::GetQualType(ivar_type),
+ ivar_type.GetQualType(),
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 4434404797f..258df3f1642 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 (!ClangASTContext::IsObjCObjectPointerType(clang_type))
+ if (!clang_type.IsObjCObjectPointerType())
{
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 019c0944dd4..dfb609445f3 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)
{
- ClangASTContext::StartTagDeclarationDefinition(union_type);
+ union_type.StartTagDeclarationDefinition();
unsigned int count = 0;
for (auto element: elements)
@@ -150,12 +150,13 @@ 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);
+ union_type.AddFieldToRecordType(element.name.c_str(), ClangASTType(&ast_ctx,element.type.getAsOpaquePtr()), lldb::eAccessPublic, element.bitfield);
++count;
}
- ClangASTContext::CompleteTagDeclarationDefinition(union_type);
+
+ union_type.CompleteTagDeclarationDefinition();
}
- return ClangASTContext::GetQualType(union_type);
+ return union_type.GetQualType();
}
clang::QualType
@@ -170,8 +171,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), size, false));
- return ClangASTContext::GetQualType(array_type);
+ ClangASTType array_type(lldb_ctx->CreateArrayType(ClangASTType(&ast_ctx,element_type.getAsOpaquePtr()), size, false));
+ return array_type.GetQualType();
}
// the runtime can emit these in the form of @"SomeType", giving more specifics
@@ -262,7 +263,7 @@ AppleObjCTypeEncodingParser::BuildObjCObjectPointerType (clang::ASTContext &ast_
return ast_ctx.getObjCIdType();
#endif
- return ClangASTContext::GetQualType(ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType());
+ return ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType().GetQualType();
}
else
{
@@ -391,7 +392,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);
+ return ClangASTType(&ast_ctx, qual_type.getAsOpaquePtr());
}
return ClangASTType();
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index c618ffcdb53..7ed2998c92b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1591,11 +1591,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),
- ClangASTContext::GetQualType(clang_type)));
+ clang_type.GetQualType()));
}
else
{
- template_param_infos.args.push_back (clang::TemplateArgument (ClangASTContext::GetQualType(clang_type)));
+ template_param_infos.args.push_back (clang::TemplateArgument (clang_type.GetQualType()));
}
}
else
@@ -1722,16 +1722,13 @@ public:
bool
Finalize()
{
- 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());
+ 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());
}
private:
ClangASTType m_class_opaque_type;
@@ -1825,9 +1822,6 @@ 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())
{
@@ -2016,8 +2010,7 @@ SymbolFileDWARF::ParseChildMembers
{
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
- ClangASTContext::AddVariableToRecordType (class_clang_type,
- name,
+ class_clang_type.AddVariableToRecordType (name,
var_type->GetClangLayoutType(),
accessibility);
}
@@ -2134,12 +2127,10 @@ SymbolFileDWARF::ParseChildMembers
if (anon_field_info.IsValid())
{
- clang::FieldDecl *unnamed_bitfield_decl =
- ClangASTContext::AddFieldToRecordType (class_clang_type,
- NULL,
- GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width),
- accessibility,
- anon_field_info.bit_size);
+ clang::FieldDecl *unnamed_bitfield_decl = class_clang_type.AddFieldToRecordType (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));
@@ -2186,8 +2177,7 @@ SymbolFileDWARF::ParseChildMembers
}
}
- field_decl = ClangASTContext::AddFieldToRecordType (class_clang_type,
- name,
+ field_decl = class_clang_type.AddFieldToRecordType (name,
member_clang_type,
accessibility,
bit_size);
@@ -2342,14 +2332,13 @@ SymbolFileDWARF::ParseChildMembers
assert (base_class_clang_type);
if (class_language == eLanguageTypeObjC)
{
- ast->SetObjCSuperClass(class_clang_type, base_class_clang_type);
+ class_clang_type.SetObjCSuperClass(base_class_clang_type);
}
else
{
- base_classes.push_back (ast->CreateBaseClassSpecifier (base_class_clang_type.GetOpaqueQualType(),
- accessibility,
- is_virtual,
- is_base_of_class));
+ base_classes.push_back (base_class_clang_type.CreateBaseClassSpecifier (accessibility,
+ is_virtual,
+ is_base_of_class));
if (is_virtual)
{
@@ -2364,7 +2353,7 @@ SymbolFileDWARF::ParseChildMembers
else
{
layout_info.base_offsets.insert(
- std::make_pair(ast->GetAsCXXRecordDecl(base_class_clang_type.GetOpaqueQualType()),
+ std::make_pair(base_class_clang_type.GetAsCXXRecordDecl(),
clang::CharUnits::fromQuantity(member_byte_offset)));
}
}
@@ -2485,7 +2474,7 @@ SymbolFileDWARF::ResolveTypeUID (DWARFCompileUnit* cu, const DWARFDebugInfoEntry
bool
SymbolFileDWARF::HasForwardDeclForClangType (const ClangASTType &clang_type)
{
- ClangASTType clang_type_no_qualifiers = ClangASTContext::RemoveFastQualifiers(clang_type);
+ ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers();
const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType());
return die != NULL;
}
@@ -2495,7 +2484,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 = ClangASTContext::RemoveFastQualifiers(clang_type);
+ ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers();
const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType());
if (die == NULL)
{
@@ -2508,16 +2497,9 @@ 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.
- ast->SetHasExternalStorage (clang_type.GetOpaqueQualType(), false);
+ clang_type.SetHasExternalStorage (false);
DWARFDebugInfo* debug_info = DebugInfo();
@@ -2548,12 +2530,12 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (die->HasChildren())
{
LanguageType class_language = eLanguageTypeUnknown;
- if (ClangASTContext::IsObjCObjectOrInterfaceType(clang_type))
+ if (clang_type.IsObjCObjectOrInterfaceType())
{
class_language = eLanguageTypeObjC;
// For objective C we don't start the definition when
// the class is created.
- ClangASTContext::StartTagDeclarationDefinition (clang_type);
+ clang_type.StartTagDeclarationDefinition ();
}
int tag_decl_kind = -1;
@@ -2660,7 +2642,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
if (class_language != eLanguageTypeObjC)
{
if (is_a_class && tag_decl_kind != clang::TTK_Class)
- GetClangASTContext().SetTagTypeKind (ClangASTContext::GetQualType(clang_type), clang::TTK_Class);
+ clang_type.SetTagTypeKind (clang::TTK_Class);
}
// Since DW_TAG_structure_type gets used for both classes
@@ -2677,10 +2659,9 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
{
// This is a class and all members that didn't have
// their access specified are private.
- GetClangASTContext().SetDefaultAccessForRecordFields (ast->GetAsRecordDecl(clang_type),
- eAccessPrivate,
- &member_accessibilities.front(),
- member_accessibilities.size());
+ clang_type.SetDefaultAccessForRecordFields (eAccessPrivate,
+ &member_accessibilities.front(),
+ member_accessibilities.size());
}
if (!base_classes.empty())
@@ -2711,26 +2692,24 @@ 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.
-
- ClangASTContext::StartTagDeclarationDefinition (base_class_type);
- ClangASTContext::CompleteTagDeclarationDefinition (base_class_type);
+ base_class_type.StartTagDeclarationDefinition ();
+ base_class_type.CompleteTagDeclarationDefinition ();
}
}
}
- ast->SetBaseClassesForClassType (clang_type.GetOpaqueQualType(),
- &base_classes.front(),
- base_classes.size());
+ clang_type.SetBaseClassesForClassType (&base_classes.front(),
+ base_classes.size());
// Clang will copy each CXXBaseSpecifier in "base_classes"
// so we have to free them all.
- ClangASTContext::DeleteBaseClassSpecifiers (&base_classes.front(),
- base_classes.size());
+ ClangASTType::DeleteBaseClassSpecifiers (&base_classes.front(),
+ base_classes.size());
}
}
}
- ClangASTContext::BuildIndirectFields (clang_type);
- ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
+ clang_type.BuildIndirectFields ();
+ clang_type.CompleteTagDeclarationDefinition ();
if (!layout_info.field_offsets.empty() ||
!layout_info.base_offsets.empty() ||
@@ -2741,7 +2720,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 = ast->GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+ clang::CXXRecordDecl *record_decl = clang_type.GetAsCXXRecordDecl();
if (record_decl)
{
if (log)
@@ -2806,7 +2785,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
return (bool)clang_type;
case DW_TAG_enumeration_type:
- ClangASTContext::StartTagDeclarationDefinition (clang_type);
+ clang_type.StartTagDeclarationDefinition ();
if (die->HasChildren())
{
SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
@@ -2814,7 +2793,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type)
clang_type.IsIntegerType(is_signed);
ParseChildEnumerators(sc, clang_type, is_signed, type->GetByteSize(), dwarf_cu, die);
}
- ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
+ clang_type.CompleteTagDeclarationDefinition ();
return (bool)clang_type;
default:
@@ -4685,17 +4664,12 @@ SymbolFileDWARF::ParseChildEnumerators
if (name && name[0] && got_value)
{
- 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;
- }
+ clang_type.AddEnumerationValueToEnumerationType (clang_type.GetEnumerationIntegerType(),
+ decl,
+ name,
+ enum_value,
+ enumerator_byte_size * 8);
+ ++enumerators_added;
}
}
}
@@ -4962,7 +4936,7 @@ SymbolFileDWARF::GetClangDeclContextContainingDIE (DWARFCompileUnit *cu, const D
Type* type = ResolveType (cu, decl_ctx_die);
if (type)
{
- clang::DeclContext *decl_ctx = GetClangASTContext().GetDeclContextForType(type->GetClangForwardType());
+ clang::DeclContext *decl_ctx = type->GetClangForwardType().GetDeclContextForType ();
if (decl_ctx)
{
LinkDeclContextToDIE (decl_ctx, decl_ctx_die);
@@ -6264,7 +6238,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
}
assert (tag_decl_kind != -1);
bool clang_type_was_created = false;
- clang_type.SetClangType(&ast, m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetClangType(ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
const DWARFDebugInfoEntry *decl_ctx_die;
@@ -6321,7 +6295,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(ast.GetDeclContextForType(clang_type), die);
+ LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die);
type_sp.reset (new Type (MakeUserID(die->GetOffset()),
this,
type_name_const_str,
@@ -6386,12 +6360,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (die->HasChildren() == false)
{
// No children for this struct/union/class, lets finish it
- ClangASTContext::StartTagDeclarationDefinition (clang_type);
- ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
+ clang_type.StartTagDeclarationDefinition ();
+ clang_type.CompleteTagDeclarationDefinition ();
if (tag == DW_TAG_structure_type) // this only applies in C
{
- clang::RecordDecl *record_decl = ClangASTContext::GetAsRecordDecl(clang_type);
+ clang::RecordDecl *record_decl = clang_type.GetAsRecordDecl();
if (record_decl)
m_record_decl_to_layout_map.insert(std::make_pair(record_decl, LayoutInfo()));
@@ -6409,7 +6383,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (class_language != eLanguageTypeObjC &&
class_language != eLanguageTypeObjC_plus_plus)
- ClangASTContext::StartTagDeclarationDefinition (clang_type);
+ clang_type.StartTagDeclarationDefinition ();
// Leave this as a forward declaration until we need
// to know the details of the type. lldb_private::Type
@@ -6417,8 +6391,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[ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] = die;
- ast.SetHasExternalStorage (clang_type.GetOpaqueQualType(), true);
+ m_forward_decl_clang_type_to_die[clang_type.RemoveFastQualifiers().GetOpaqueQualType()] = die;
+ clang_type.SetHasExternalStorage (true);
}
}
@@ -6474,7 +6448,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, m_forward_decl_die_to_clang_type.lookup (die));
+ clang_type.SetClangType (ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die));
if (!clang_type)
{
if (encoding_uid != DW_INVALID_OFFSET)
@@ -6496,10 +6470,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
}
else
{
- enumerator_clang_type = ast.GetEnumerationIntegerType (clang_type.GetOpaqueQualType());
+ enumerator_clang_type = clang_type.GetEnumerationIntegerType ();
}
- LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die);
+ LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die);
type_sp.reset( new Type (MakeUserID(die->GetOffset()),
this,
@@ -6512,7 +6486,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
clang_type,
Type::eResolveStateForward));
- ClangASTContext::StartTagDeclarationDefinition (clang_type);
+ clang_type.StartTagDeclarationDefinition ();
if (die->HasChildren())
{
SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
@@ -6520,7 +6494,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);
}
- ClangASTContext::CompleteTagDeclarationDefinition (clang_type);
+ clang_type.CompleteTagDeclarationDefinition ();
}
}
break;
@@ -6710,7 +6684,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 (ClangASTContext::IsObjCObjectOrInterfaceType(type_clang_forward_type))
+ if (type_clang_forward_type.IsObjCObjectOrInterfaceType ())
class_opaque_type = type_clang_forward_type;
}
}
@@ -6722,11 +6696,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
- clang::ObjCMethodDecl *objc_method_decl = ast.AddMethodToObjCObjectType (class_opaque_type,
- type_name_cstr,
- clang_type,
- accessibility,
- is_artificial);
+ clang::ObjCMethodDecl *objc_method_decl = class_opaque_type.AddMethodToObjCObjectType (type_name_cstr,
+ clang_type,
+ accessibility,
+ is_artificial);
type_handled = objc_method_decl != NULL;
if (type_handled)
{
@@ -6846,7 +6819,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
else
{
ClangASTType class_opaque_type = class_type->GetClangForwardType();
- if (ClangASTContext::IsCXXClassType(class_opaque_type))
+ if (class_opaque_type.IsCXXClassType ())
{
if (class_opaque_type.IsBeingDefined ())
{
@@ -6874,16 +6847,15 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
const bool is_attr_used = false;
- 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);
+ 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);
type_handled = cxx_method_decl != NULL;
@@ -7136,7 +7108,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 = ClangASTContext::CreateMemberPointerType(pointee_clang_type, class_clang_type);
+ clang_type = pointee_clang_type.CreateMemberPointerType(class_clang_type);
byte_size = clang_type.GetByteSize(nullptr);
@@ -8053,7 +8025,7 @@ SymbolFileDWARF::SearchDeclContext (const clang::DeclContext *decl_context,
Type *matching_type = ResolveType (dwarf_cu, die);
- clang::QualType qual_type = ClangASTContext::GetQualType(matching_type->GetClangForwardType());
+ clang::QualType qual_type = matching_type->GetClangForwardType().GetQualType();
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 d047aaae2cf..9b18eadbf1d 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -448,13 +448,12 @@ 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);
-
- 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);
+ 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();
ProcessStructReader struct_reader (m_process, m_dispatch_tsd_indexes_addr, dispatch_tsd_indexes_s);
OpenPOWER on IntegriCloud