forked from OSchip/llvm-project
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:
parent
0067ee02f9
commit
85a0a83a26
|
@ -219,6 +219,21 @@ private:
|
|||
llvm::Value *V,
|
||||
bool Store);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Handle all the arguments to a function call
|
||||
///
|
||||
/// @param[in] M
|
||||
/// The module currently being processed.
|
||||
///
|
||||
/// @param[in] C
|
||||
/// The call instruction.
|
||||
///
|
||||
/// @return
|
||||
/// True on success; false otherwise
|
||||
//------------------------------------------------------------------
|
||||
bool MaybeHandleCallArguments(llvm::Module &M,
|
||||
llvm::CallInst *C);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Handle a single external function call
|
||||
///
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue