// If possible, print out the short form of the call instruction. We can
// only do this if the first argument is a pointer to a nonvararg function,
// and if the return type is not a pointer to a function.
- //
Out << ' ';
TypePrinter.print(FTy->isVarArg() ? FTy : RetTy, Out);
Out << ' ';
// is only to aid readability, musttail calls forward varargs by default.
if (CI->isMustTailCall() && CI->getParent() &&
CI->getParent()->getParent() &&
- CI->getParent()->getParent()->isVarArg())
- Out << ", ...";
+ CI->getParent()->getParent()->isVarArg()) {
+ if (CI->arg_size() > 0)
+ Out << ", ";
+ Out << "...";
+ }
Out << ')';
if (PAL.hasFnAttrs())
; CHECK-LABEL: define void @fn_musttail(
define void @fn_musttail() {
call void (...) @bf_musttail()
- ; CHECK: call void (...) @bf_musttail(
+ ; CHECK: call void (...) @bf_musttail()
ret void
}
; CHECK-LABEL: define internal void @bf_musttail(
define internal void @bf_musttail(...) {
musttail call void (...) @llvm.icall.branch.funnel(...)
- ; CHECK: musttail call void (...) @llvm.icall.branch.funnel(
+ ; CHECK: musttail call void (...) @llvm.icall.branch.funnel(...)
ret void
}
; CHECK-LABEL: define void @fn_musttail_always(
define void @fn_musttail_always() {
call void (...) @bf_musttail_always()
- ; CHECK: call void (...) @bf_musttail_always(
+ ; CHECK: call void (...) @bf_musttail_always()
ret void
}
; CHECK-LABEL: define internal void @bf_musttail_always(
define internal void @bf_musttail_always(...) alwaysinline {
musttail call void (...) @llvm.icall.branch.funnel(...)
- ; CHECK: musttail call void (...) @llvm.icall.branch.funnel(
+ ; CHECK: musttail call void (...) @llvm.icall.branch.funnel(...)
ret void
}