summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallFunction.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-09-21 00:44:12 +0000
committerSean Callanan <scallanan@apple.com>2010-09-21 00:44:12 +0000
commitfc55f5d1b0d2b3a0deca20369700945eb70c7494 (patch)
tree259a61a987333c4ef998040d566d709ce284211b /lldb/source/Target/ThreadPlanCallFunction.cpp
parent461a692c7fa3fece7bee48bd6318c9dbb62db131 (diff)
downloadbcm5719-llvm-fc55f5d1b0d2b3a0deca20369700945eb70c7494.tar.gz
bcm5719-llvm-fc55f5d1b0d2b3a0deca20369700945eb70c7494.zip
Removed the hacky "#define this ___clang_this" handler
for C++ classes. Replaced it with a less hacky approach: - If an expression is defined in the context of a method of class A, then that expression is wrapped as ___clang_class::___clang_expr(void*) { ... } instead of ___clang_expr(void*) { ... }. - ___clang_class is resolved as the type of the target of the "this" pointer in the method the expression is defined in. - When reporting the type of ___clang_class, a method with the signature ___clang_expr(void*) is added to that class, so that Clang doesn't complain about a method being defined without a corresponding declaration. - Whenever the expression gets called, "this" gets looked up, type-checked, and then passed in as the first argument. This required the following changes: - The ABIs were changed to support passing of the "this" pointer as part of trivial calls. - ThreadPlanCallFunction and ClangFunction were changed to support passing of an optional "this" pointer. - ClangUserExpression was extended to perform the wrapping described above. - ClangASTSource was changed to revert the changes required by the hack. - ClangExpressionParser, IRForTarget, and ClangExpressionDeclMap were changed to handle different manglings of ___clang_expr flexibly. This meant no longer searching for a function called ___clang_expr, but rather looking for a function whose name *contains* ___clang_expr. - ClangExpressionParser and ClangExpressionDeclMap now remember whether "this" is required, and know how to look it up as necessary. A few inheritance bugs remain, and I'm trying to resolve these. But it is now possible to use "this" as well as refer implicitly to member variables, when in the proper context. llvm-svn: 114384
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index f8d7f6a6bf6..3935a1340ec 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -34,7 +34,8 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
Address &function,
lldb::addr_t arg,
bool stop_other_threads,
- bool discard_on_error) :
+ bool discard_on_error,
+ lldb::addr_t *this_arg) :
ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion),
m_valid (false),
m_stop_other_threads (stop_other_threads),
@@ -43,7 +44,6 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
m_process (thread.GetProcess()),
m_thread (thread)
{
-
SetOkayToDiscard (discard_on_error);
Process& process = thread.GetProcess();
@@ -78,7 +78,8 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
spBelowRedZone,
FunctionLoadAddr,
StartLoadAddr,
- m_arg_addr))
+ m_arg_addr,
+ this_arg))
return;
m_valid = true;
OpenPOWER on IntegriCloud