mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
Added handling for external variables in function
arguments to the expression parser. This means that structs can be returned from the "expr" command. llvm-svn: 115698
This commit is contained in:
@@ -628,6 +628,21 @@ IRForTarget::MaybeHandleVariable(Module &M,
|
||||
return true;
|
||||
}
|
||||
|
||||
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 @@ IRForTarget::resolveExternals(Module &M, BasicBlock &BB)
|
||||
}
|
||||
|
||||
if (CallInst *call = dyn_cast<CallInst>(&inst))
|
||||
{
|
||||
if (!MaybeHandleCallArguments(M, call))
|
||||
return false;
|
||||
|
||||
if (!MaybeHandleCall(M, call))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user