
`convertCallToIndirectCall` applies the PLTCall optimization and returns an (updated if needed) iterator to the converted call instruction. Since AArch64 requires to inject additional instructions to implement this pass, the relevant BasicBlock and an iterator was passed to the `convertCallToIndirectCall`. `NumCallsOptimized` is updated only on successful application of the pass. Tests: - Inputs/plt-tailcall.c: an example of a tail call optimized PLT call. - AArch64/plt-call.test: it is the actual A64 test, that runs the PLTCall optimization on the above input file and verifies the application of the pass to the calls: 'printf' and 'puts'.
9 lines
131 B
C
9 lines
131 B
C
#include "stub.h"
|
|
|
|
int foo(char *c) {
|
|
printf("");
|
|
__attribute__((musttail)) return puts(c);
|
|
}
|
|
|
|
int main() { return foo("a"); }
|