summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2015-08-11 21:38:15 +0000
committerGreg Clayton <gclayton@apple.com>2015-08-11 21:38:15 +0000
commitd8d4a57b37312b62dfa90226293db521e7a4a6fb (patch)
treeace5d255c1f17af9a9e482ba3e61ed20a05c30c6 /lldb/source/Plugins/LanguageRuntime
parent78046b49a9397db7899a7879e0a88d26f0199025 (diff)
downloadbcm5719-llvm-d8d4a57b37312b62dfa90226293db521e7a4a6fb.tar.gz
bcm5719-llvm-d8d4a57b37312b62dfa90226293db521e7a4a6fb.zip
First step in getting LLDB ready to support multiple different type systems.
This is the work done by Ryan Brown from http://reviews.llvm.org/D8712 that makes a TypeSystem class and abstracts types to be able to use a type system. All tests pass on MacOSX and passed on linux the last time this was submitted. llvm-svn: 244679
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime')
-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
4 files changed, 13 insertions, 14 deletions
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();
}
OpenPOWER on IntegriCloud