[Lldb-commits] [lldb] r177558 - Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
Enrico Granata
egranata at apple.com
Wed Mar 20 12:04:28 PDT 2013
Author: enrico
Date: Wed Mar 20 14:04:28 2013
New Revision: 177558
URL: http://llvm.org/viewvc/llvm-project?rev=177558&view=rev
Log:
Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
lldb/trunk/source/DataFormatters/Cocoa.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=177558&r1=177557&r2=177558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Mar 20 14:04:28 2013
@@ -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();
Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=177558&r1=177557&r2=177558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Wed Mar 20 14:04:28 2013
@@ -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);
Modified: lldb/trunk/source/DataFormatters/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/Cocoa.cpp?rev=177558&r1=177557&r2=177558&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/Cocoa.cpp (original)
+++ lldb/trunk/source/DataFormatters/Cocoa.cpp Wed Mar 20 14:04:28 2013
@@ -55,8 +55,9 @@ lldb_private::formatters::NSBundleSummar
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)
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=177558&r1=177557&r2=177558&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Wed Mar 20 14:04:28 2013
@@ -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
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=177558&r1=177557&r2=177558&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Mar 20 14:04:28 2013
@@ -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()
{
More information about the lldb-commits
mailing list