llvm.org GIT mirror llvm / 7fcef2b
[MetaRenamer] Leave `@main` alone. To the best of my knowledge -metarenamer is used in two cases: 1) obfuscate names, when e.g. they contain informations that can't be shared. 2) Improve clarity of the textual IR for testcases. One of the usecases if getting the output of `opt` and passing it to the lli interpreter to run the test. If metarenamer renames @main, lli can't find an entry point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309657 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 2 years ago
2 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
122122 TLI.getLibFunc(F, Tmp))
123123 continue;
124124
125 F.setName(renamer.newName());
125 // Leave @main alone. The output of -metarenamer might be passed to
126 // lli for execution and the latter needs a main entry point.
127 if (Name != "main")
128 F.setName(renamer.newName());
129
126130 runOnFunction(F);
127131 }
128132 return true;
0 ; Make sure @main is left untouched.
1 ; RUN: opt -metarenamer -S %s | FileCheck %s
2
3 ; CHECK: define void @main
4 ; CHECK: call void @main
5
6 define void @main() {
7 call void @patatino()
8 ret void
9 }
10
11 define void @patatino() {
12 call void @main()
13 ret void
14 }