forked from OSchip/llvm-project
[InlineFunction] Only replace call if there are VarArgs to forward.
Summary: There is no need to replace the original call instruction if no VarArgs need to be forwarded. Reviewers: davide, rnk, majnemer, efriedma Reviewed By: efriedma Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D40412 llvm-svn: 319947
This commit is contained in:
parent
3e069f5724
commit
115d99162c
|
@ -1860,7 +1860,8 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
|
|||
if (MarkNoUnwind)
|
||||
CI->setDoesNotThrow();
|
||||
|
||||
if (ForwardVarArgsTo && CI->getCalledFunction() == ForwardVarArgsTo) {
|
||||
if (ForwardVarArgsTo && !VarArgsToForward.empty() &&
|
||||
CI->getCalledFunction() == ForwardVarArgsTo) {
|
||||
SmallVector<Value*, 6> Params(CI->arg_operands());
|
||||
Params.append(VarArgsToForward.begin(), VarArgsToForward.end());
|
||||
CallInst *Call = CallInst::Create(CI->getCalledFunction(), Params, "", CI);
|
||||
|
|
Loading…
Reference in New Issue