diff options
author | Sean Callanan <scallanan@apple.com> | 2011-11-15 02:11:17 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-11-15 02:11:17 +0000 |
commit | d5c17edb04b4260fbbaca8e9a9b5e18f86964799 (patch) | |
tree | e817fa4ab4bdc539b7b8c3d1fb182c14a2ec0353 /lldb/source/Expression/ClangUserExpression.cpp | |
parent | 29cdcda80d45a58eefbd488980965048efba2b8a (diff) | |
download | bcm5719-llvm-d5c17edb04b4260fbbaca8e9a9b5e18f86964799.tar.gz bcm5719-llvm-d5c17edb04b4260fbbaca8e9a9b5e18f86964799.zip |
Pulled in a new version of LLVM/Clang to solve a variety
of problems with Objective-C object completion. To go
along with the LLVM/Clang-side fixes, we have a variety
of Objective-C improvements.
Fixes include:
- It is now possible to run expressions when stopped in
an Objective-C class method and have "self" act just
like "self" would act in the class method itself (i.e.,
[self classMethod] works without casting the return
type if debug info is present). To accomplish this,
the expression masquerades as a class method added by
a category.
- Objective-C objects can now provide methods and
properties and methods to Clang on demand (i.e., the
ASTImporter sets hasExternalVisibleDecls on Objective-C
interface objects).
- Objective-C built-in types, which had long been a bone
of contention (should we be using "id"? "id*"?), are
now fetched correctly using accessor functions on
ClangASTContext. We inhibit searches for them in the
debug information.
There are also a variety of logging fixes, and I made two
changes to the test suite:
- Enabled a test case for Objective-C properties in the
current translation unit.
- Added a test case for calling Objective-C class methods
when stopped in a class method.
llvm-svn: 144607
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 25eb8c4bc13..4ae34a38d58 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -56,6 +56,7 @@ ClangUserExpression::ClangUserExpression (const char *expr, m_objectivec (false), m_needs_object_ptr (false), m_const_object (false), + m_static_method(false), m_target (NULL), m_evaluated_statically (false), m_const_result () @@ -167,7 +168,7 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) } else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_context)) { - if (m_allow_objc && method_decl->isInstanceMethod()) + if (m_allow_objc) { VariableList *vars = frame->GetVariableList(false); @@ -193,6 +194,9 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err) m_objectivec = true; m_needs_object_ptr = true; + + if (!method_decl->isInstanceMethod()) + m_static_method = true; } } } @@ -274,7 +278,7 @@ ClangUserExpression::Parse (Stream &error_stream, else lang_type = lldb::eLanguageTypeC; - if (!source_code->GetText(m_transformed_text, lang_type, m_const_object)) + if (!source_code->GetText(m_transformed_text, lang_type, m_const_object, m_static_method)) { error_stream.PutCString ("error: couldn't construct expression body"); return false; |