[Lldb-commits] [lldb] r117249 - in /lldb/trunk/source: Core/ValueObjectChild.cpp Symbol/ClangASTContext.cpp
Sean Callanan
scallanan at apple.com
Sun Oct 24 17:29:48 PDT 2010
Author: spyffe
Date: Sun Oct 24 19:29:48 2010
New Revision: 117249
URL: http://llvm.org/viewvc/llvm-project?rev=117249&view=rev
Log:
Fixes to Objective-C built-in type handling.
Specifically, we fixed handling of the objc_class
built-in type, which allowed us to pass
named Objective-C objects to functions,
call variable list -t on objects safely, etc.
Modified:
lldb/trunk/source/Core/ValueObjectChild.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=117249&r1=117248&r2=117249&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Sun Oct 24 19:29:48 2010
@@ -45,6 +45,8 @@
m_bitfield_bit_offset (bitfield_bit_offset),
m_is_base_class (is_base_class)
{
+ assert(byte_size != 0 && "TEMPORARY DEBUGGING ASSERT");
+
m_name = name;
}
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=117249&r1=117248&r2=117249&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Sun Oct 24 19:29:48 2010
@@ -666,19 +666,19 @@
clang_type_t
ClangASTContext::GetBuiltInType_objc_id()
{
- return getASTContext()->getObjCIdType().getAsOpaquePtr();
+ return getASTContext()->ObjCBuiltinIdTy.getAsOpaquePtr();
}
clang_type_t
ClangASTContext::GetBuiltInType_objc_Class()
{
- return getASTContext()->getObjCClassType().getAsOpaquePtr();
+ return getASTContext()->ObjCBuiltinClassTy.getAsOpaquePtr();
}
clang_type_t
ClangASTContext::GetBuiltInType_objc_selector()
{
- return getASTContext()->getObjCSelType().getAsOpaquePtr();
+ return getASTContext()->ObjCBuiltinSelTy.getAsOpaquePtr();
}
clang_type_t
@@ -777,7 +777,7 @@
{
ASTContext *ast_context = getASTContext();
assert (ast_context != NULL);
-
+
if (decl_ctx == NULL)
decl_ctx = ast_context->getTranslationUnitDecl();
@@ -1662,8 +1662,18 @@
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
+ case clang::Type::Builtin:
+ switch (cast<clang::BuiltinType>(qual_type)->getKind())
+ {
+ default:
+ break;
+ case clang::BuiltinType::ObjCId:
+ case clang::BuiltinType::ObjCClass:
+ case clang::BuiltinType::ObjCSel:
+ return eTypeIsBuiltIn | eTypeIsPointer | eTypeHasValue;
+ }
+ return eTypeIsBuiltIn | eTypeHasValue;
case clang::Type::BlockPointer: return eTypeIsPointer | eTypeHasChildren | eTypeIsBlock;
- case clang::Type::Builtin: return eTypeIsBuiltIn | eTypeHasValue;
case clang::Type::Complex: return eTypeHasChildren | eTypeIsBuiltIn | eTypeHasValue;
case clang::Type::ConstantArray: return eTypeHasChildren | eTypeIsArray;
case clang::Type::DependentName: return 0;
@@ -1949,13 +1959,16 @@
{
case clang::BuiltinType::ObjCId:
case clang::BuiltinType::ObjCClass:
+ child_name = "isa";
+ child_byte_size = ast_context->getTypeSize(ast_context->ObjCBuiltinClassTy) / CHAR_BIT;
return ast_context->ObjCBuiltinClassTy.getAsOpaquePtr();
case clang::BuiltinType::ObjCSel:
{
QualType char_type(ast_context->CharTy);
char_type.addConst();
- return ast_context->getPointerType(char_type).getAsOpaquePtr();
+ child_byte_size = ast_context->getTypeSize(char_type);
+ return char_type.getAsOpaquePtr();
}
break;
@@ -3150,6 +3163,15 @@
return true;
}
+ ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type);
+
+ if (objc_class_type)
+ {
+ ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+
+ class_interface_decl->setForwardDecl(false);
+ }
+
const EnumType *enum_type = dyn_cast<EnumType>(qual_type.getTypePtr());
if (enum_type)
@@ -3350,6 +3372,17 @@
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
+ case clang::Type::Builtin:
+ switch (cast<clang::BuiltinType>(qual_type)->getKind())
+ {
+ default:
+ break;
+ case clang::BuiltinType::ObjCId:
+ case clang::BuiltinType::ObjCClass:
+ case clang::BuiltinType::ObjCSel:
+ return true;
+ }
+ return false;
case clang::Type::ObjCObjectPointer:
if (target_type)
*target_type = cast<ObjCObjectPointerType>(qual_type)->getPointeeType().getAsOpaquePtr();
@@ -3411,6 +3444,17 @@
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class)
{
+ case clang::Type::Builtin:
+ switch (cast<clang::BuiltinType>(qual_type)->getKind())
+ {
+ default:
+ break;
+ case clang::BuiltinType::ObjCId:
+ case clang::BuiltinType::ObjCClass:
+ case clang::BuiltinType::ObjCSel:
+ return true;
+ }
+ return false;
case clang::Type::ObjCObjectPointer:
if (target_type)
*target_type = cast<ObjCObjectPointerType>(qual_type)->getPointeeType().getAsOpaquePtr();
More information about the lldb-commits
mailing list