summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangUserExpression.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-09-14 21:59:34 +0000
committerSean Callanan <scallanan@apple.com>2010-09-14 21:59:34 +0000
commit44096b1a7e04ef2aa2e24db9360b843bff88a33c (patch)
treef3134d39a9b9c0c84e57efdd11305f1f3f358471 /lldb/source/Expression/ClangUserExpression.cpp
parent86ac3fc9af774b49ed51a446830e5c4382bc8199 (diff)
downloadbcm5719-llvm-44096b1a7e04ef2aa2e24db9360b843bff88a33c.tar.gz
bcm5719-llvm-44096b1a7e04ef2aa2e24db9360b843bff88a33c.zip
Added code to support use of "this" and "self" in
expressions. This involved three main changes: - In ClangUserExpression::ClangUserExpression(), we now insert the following lines into the expression: #define this ___clang_this #define self ___clang_self - In ClangExpressionDeclMap::GetDecls(), we special-case ___clang_(this|self) and instead look up "this" or "self" - In ClangASTSource, we introduce the capability to generate Decls with a different, overridden, name from the one that was requested, e.g. this for ___clang_this. llvm-svn: 113866
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 4e49c4875a2..6b376560218 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -38,7 +38,13 @@ ClangUserExpression::ClangUserExpression (const char *expr) :
{
StreamString m_transformed_stream;
- m_transformed_stream.Printf("extern \"C\" void %s(void *___clang_arg) { %s; }\n",
+ m_transformed_stream.Printf("#define this ___clang_this \n"
+ "#define self ___clang_self \n"
+ "extern \"C\" void \n"
+ "%s(void *___clang_arg) \n"
+ "{ \n"
+ "%s; \n"
+ "} \n",
FunctionName(),
m_expr_text.c_str());
OpenPOWER on IntegriCloud