Added handling for external variables in function
arguments to the expression parser. This means that
structs can be returned from the "expr" command.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115698 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index 662c086..6cf8628 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -629,6 +629,21 @@
}
bool
+IRForTarget::MaybeHandleCallArguments(Module &M,
+ CallInst *C)
+{
+ // lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS);
+
+ for (unsigned op_index = 0, num_ops = C->getNumArgOperands();
+ op_index < num_ops;
+ ++op_index)
+ if (!MaybeHandleVariable(M, C->getArgOperand(op_index), true)) // conservatively believe that this is a store
+ return false;
+
+ return true;
+}
+
+bool
IRForTarget::MaybeHandleCall(Module &M,
CallInst *C)
{
@@ -772,8 +787,13 @@
}
if (CallInst *call = dyn_cast<CallInst>(&inst))
+ {
+ if (!MaybeHandleCallArguments(M, call))
+ return false;
+
if (!MaybeHandleCall(M, call))
return false;
+ }
}
return true;