Rewrite calls to bitcast unprototyped functions when emitting a definition.
My variadics patch, r169588, changed these calls to typically be
bitcasts rather than calls to a supposedly variadic function.
This totally subverted a hack where we intentionally dropped
excess arguments from such calls in order to appease the inliner
and a "warning" from the optimizer. This patch extends the hack
to also work with bitcasts, as well as teaching it to rewrite
invokes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170034 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c
index 28e4bd0..8241a3d 100644
--- a/test/CodeGen/functions.c
+++ b/test/CodeGen/functions.c
@@ -24,7 +24,7 @@
void f1();
void f2(void) {
-// CHECK: call void bitcast (void ()* @f1 to void (i32, i32, i32)*)(i32 1, i32 2, i32 3)
+// CHECK: call void @f1()
f1(1, 2, 3);
}
// CHECK: define void @f1()