Skip to content

Commit b604520

Browse files
boomanaiden154nekoshirro
authored andcommitted
[CallBrPrepare] Prefer Function &F over Function &Fn
Function &F is the more standard abbreviation (~4000 uses in llvm versus ~300 uses). Signed-off-by: Hafidz Muzakky <[email protected]>
1 parent 0008fc2 commit b604520

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/include/llvm/CodeGen/CallBrPrepare.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace llvm {
1515

1616
class CallBrPreparePass : public PassInfoMixin<CallBrPreparePass> {
1717
public:
18-
PreservedAnalyses run(Function &Fn, FunctionAnalysisManager &FAM);
18+
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
1919
};
2020

2121
} // namespace llvm

llvm/lib/CodeGen/CallBrPrepare.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,29 @@ static bool InsertIntrinsicCalls(ArrayRef<CallBrInst *> CBRs,
5959
DominatorTree &DT);
6060
static void UpdateSSA(DominatorTree &DT, CallBrInst *CBR, CallInst *Intrinsic,
6161
SSAUpdater &SSAUpdate);
62-
static SmallVector<CallBrInst *, 2> FindCallBrs(Function &Fn);
62+
static SmallVector<CallBrInst *, 2> FindCallBrs(Function &F);
6363

6464
namespace {
6565

6666
class CallBrPrepare : public FunctionPass {
6767
public:
6868
CallBrPrepare() : FunctionPass(ID) {}
6969
void getAnalysisUsage(AnalysisUsage &AU) const override;
70-
bool runOnFunction(Function &Fn) override;
70+
bool runOnFunction(Function &F) override;
7171
static char ID;
7272
};
7373

7474
} // end anonymous namespace
7575

76-
PreservedAnalyses CallBrPreparePass::run(Function &Fn,
76+
PreservedAnalyses CallBrPreparePass::run(Function &F,
7777
FunctionAnalysisManager &FAM) {
7878
bool Changed = false;
79-
SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(Fn);
79+
SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(F);
8080

8181
if (CBRs.empty())
8282
return PreservedAnalyses::all();
8383

84-
auto &DT = FAM.getResult<DominatorTreeAnalysis>(Fn);
84+
auto &DT = FAM.getResult<DominatorTreeAnalysis>(F);
8585

8686
Changed |= SplitCriticalEdges(CBRs, DT);
8787
Changed |= InsertIntrinsicCalls(CBRs, DT);
@@ -106,9 +106,9 @@ void CallBrPrepare::getAnalysisUsage(AnalysisUsage &AU) const {
106106
AU.addPreserved<DominatorTreeWrapperPass>();
107107
}
108108

109-
SmallVector<CallBrInst *, 2> FindCallBrs(Function &Fn) {
109+
SmallVector<CallBrInst *, 2> FindCallBrs(Function &F) {
110110
SmallVector<CallBrInst *, 2> CBRs;
111-
for (BasicBlock &BB : Fn)
111+
for (BasicBlock &BB : F)
112112
if (auto *CBR = dyn_cast<CallBrInst>(BB.getTerminator()))
113113
if (!CBR->getType()->isVoidTy() && !CBR->use_empty())
114114
CBRs.push_back(CBR);
@@ -219,9 +219,9 @@ void UpdateSSA(DominatorTree &DT, CallBrInst *CBR, CallInst *Intrinsic,
219219
}
220220
}
221221

222-
bool CallBrPrepare::runOnFunction(Function &Fn) {
222+
bool CallBrPrepare::runOnFunction(Function &F) {
223223
bool Changed = false;
224-
SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(Fn);
224+
SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(F);
225225

226226
if (CBRs.empty())
227227
return Changed;
@@ -238,7 +238,7 @@ bool CallBrPrepare::runOnFunction(Function &Fn) {
238238
if (auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>())
239239
DT = &DTWP->getDomTree();
240240
else {
241-
LazilyComputedDomTree.emplace(Fn);
241+
LazilyComputedDomTree.emplace(F);
242242
DT = &*LazilyComputedDomTree;
243243
}
244244

0 commit comments

Comments
 (0)