diff options
author | Sean Callanan <scallanan@apple.com> | 2011-08-03 16:23:08 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-08-03 16:23:08 +0000 |
commit | a789aa770ee9fc4a3d10ea583f4abff2c9972cde (patch) | |
tree | 90e2cd051abdde06ecd6c1382cd2b3f73d7f5fea /lldb/source | |
parent | 996ab689fbc1ced95a61669b5207fe9e6a0cdfae (diff) | |
download | bcm5719-llvm-a789aa770ee9fc4a3d10ea583f4abff2c9972cde.tar.gz bcm5719-llvm-a789aa770ee9fc4a3d10ea583f4abff2c9972cde.zip |
Improved the expression parser's detection of the
current context. Previously, if there was a variable
called "self" available, the expression parser
assumed it was inside a method. But class methods
in Objective-C also take a "self" parameter, of DWARF
type "id". We now detect this properly, and only
assume we're in an instance method if "self" is a
pointer to an Objective-C object.
llvm-svn: 136784
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 9bc41889445..71a528280d9 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -68,9 +68,6 @@ ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough) void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx) { - if (!exe_ctx.frame) - return; - VariableList *vars = exe_ctx.frame->GetVariableList(false); if (!vars) @@ -102,6 +99,13 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx) else if (self_var.get()) { m_objectivec = true; + + Type *self_type = self_var->GetType(); + + if (self_type->GetClangForwardType() == self_type->GetClangASTContext().GetBuiltInType_objc_id()) + { + m_objectivec = false; + } } } |