summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-03-20 19:04:28 +0000
committerEnrico Granata <egranata@apple.com>2013-03-20 19:04:28 +0000
commitbdbda93f35167175b82e2a8897fefb841331bd81 (patch)
tree73647cd2c06b96d3c25edaff98c088ce494c078f
parent9dc548944127c89e25988a34df2884d6d5cbd14b (diff)
downloadbcm5719-llvm-bdbda93f35167175b82e2a8897fefb841331bd81.tar.gz
bcm5719-llvm-bdbda93f35167175b82e2a8897fefb841331bd81.zip
Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
llvm-svn: 177558
-rw-r--r--lldb/include/lldb/Symbol/ClangASTContext.h3
-rw-r--r--lldb/include/lldb/Target/ObjCLanguageRuntime.h35
-rw-r--r--lldb/source/DataFormatters/Cocoa.cpp3
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp2
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp6
5 files changed, 12 insertions, 37 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 14402df1658..a1589b5ded7 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -201,6 +201,9 @@ public:
lldb::clang_type_t
GetBuiltInType_objc_id();
+
+ static lldb::clang_type_t
+ GetBuiltInType_objc_id(clang::ASTContext *ast);
lldb::clang_type_t
GetBuiltInType_objc_Class();
diff --git a/lldb/include/lldb/Target/ObjCLanguageRuntime.h b/lldb/include/lldb/Target/ObjCLanguageRuntime.h
index 6650115dcc4..5938d2b43cf 100644
--- a/lldb/include/lldb/Target/ObjCLanguageRuntime.h
+++ b/lldb/include/lldb/Target/ObjCLanguageRuntime.h
@@ -249,41 +249,6 @@ public:
lldb::TypeWP m_type_wp;
};
- // a convenience subclass of ClassDescriptor meant to represent invalid objects
- class ClassDescriptor_Invalid : public ClassDescriptor
- {
- public:
- ClassDescriptor_Invalid() {}
-
- virtual
- ~ClassDescriptor_Invalid ()
- {}
-
- virtual ConstString
- GetClassName () { return ConstString(""); }
-
- virtual ClassDescriptorSP
- GetSuperclass () { return ClassDescriptorSP(new ClassDescriptor_Invalid()); }
-
- virtual bool
- IsValid () { return false; }
-
- virtual bool
- IsTagged () { return false; }
-
- virtual uint64_t
- GetInstanceSize () { return 0; }
-
- virtual ObjCISA
- GetISA () { return 0; }
-
- virtual bool
- CheckPointer (lldb::addr_t value, uint32_t ptr_size) const
- {
- return false;
- }
- };
-
virtual ClassDescriptorSP
GetClassDescriptor (ValueObject& in_value);
diff --git a/lldb/source/DataFormatters/Cocoa.cpp b/lldb/source/DataFormatters/Cocoa.cpp
index 2ae7ee09b0d..afc7fe21166 100644
--- a/lldb/source/DataFormatters/Cocoa.cpp
+++ b/lldb/source/DataFormatters/Cocoa.cpp
@@ -55,8 +55,9 @@ lldb_private::formatters::NSBundleSummaryProvider (ValueObject& valobj, Stream&
if (!strcmp(class_name,"NSBundle"))
{
uint64_t offset = 5 * ptr_size;
- ClangASTType type(valobj.GetClangAST(),valobj.GetClangType());
+ ClangASTType type(valobj.GetClangAST(),ClangASTContext::GetBuiltInType_objc_id(valobj.GetClangAST()));
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(offset, type, true));
+ valobj_addr = text->GetValueAsUnsigned(0);
StreamString summary_stream;
bool was_nsstring_ok = NSStringSummaryProvider(*text.get(), summary_stream);
if (was_nsstring_ok && summary_stream.GetSize() > 0)
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index f116bc79ec1..752e526a449 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -1508,7 +1508,7 @@ public:
// tagged pointers can represent a class that has a superclass, but since that information is not
// stored in the object itself, we would have to query the runtime to discover the hierarchy
// for the time being, we skip this step in the interest of static discovery
- return ObjCLanguageRuntime::ClassDescriptorSP(new ObjCLanguageRuntime::ClassDescriptor_Invalid());
+ return ObjCLanguageRuntime::ClassDescriptorSP();
}
virtual bool
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 69e22c3177a..6eed9fc42cc 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -944,6 +944,12 @@ ClangASTContext::GetBuiltInType_objc_id()
return getASTContext()->getObjCIdType().getAsOpaquePtr();
}
+lldb::clang_type_t
+ClangASTContext::GetBuiltInType_objc_id(clang::ASTContext *ast)
+{
+ return ast->getObjCIdType().getAsOpaquePtr();
+}
+
clang_type_t
ClangASTContext::GetBuiltInType_objc_Class()
{
OpenPOWER on IntegriCloud