From 88339f0fd182dee901c9b7a3ebb63a68375b9e32 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Mon, 6 Dec 2010 22:16:55 +0000 Subject: [PATCH] Fixed a bug in which the SEL type was being resolved wrongly as the target of a pointer rather than the SEL pointer itself. This caused incorrect behavior when dealing with Objective-C selector variables. llvm-svn: 121048 --- lldb/source/Expression/IRForTarget.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 2 +- lldb/source/Symbol/ClangASTType.cpp | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 3012a78def5a..591009831c6c 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -846,7 +846,7 @@ IRForTarget::MaybeHandleVariable (Module &llvm_module, Value *llvm_value_ptr) lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); if (log) - log->Printf("MaybeHandleVariable (%s)\n", PrintValue(llvm_value_ptr).c_str()); + log->Printf("MaybeHandleVariable (%s)", PrintValue(llvm_value_ptr).c_str()); if (ConstantExpr *constant_expr = dyn_cast(llvm_value_ptr)) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index f40ad156a3d2..cd143a96ee79 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2933,7 +2933,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else if (type_name_const_str == g_objc_type_name_selector) { - clang_type = ast.GetBuiltInType_objc_selector(); + clang_type = ast.CreatePointerType(ast.GetBuiltInType_objc_selector()); resolve_state = Type::eResolveStateFull; } } diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp index 138cd85a8da4..9a2d9227c083 100644 --- a/lldb/source/Symbol/ClangASTType.cpp +++ b/lldb/source/Symbol/ClangASTType.cpp @@ -160,6 +160,9 @@ ClangASTType::GetEncoding (clang_type_t clang_type, uint32_t &count) case clang::BuiltinType::Float: case clang::BuiltinType::Double: case clang::BuiltinType::LongDouble: return lldb::eEncodingIEEE754; + + case clang::BuiltinType::ObjCId: + case clang::BuiltinType::ObjCSel: return lldb::eEncodingUint; case clang::BuiltinType::NullPtr: return lldb::eEncodingUint; }