[llvm] r317923 - [SimplifyCFG] Use auto * when the type is obvious. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 12:46:21 PST 2017
Author: davide
Date: Fri Nov 10 12:46:21 2017
New Revision: 317923
URL: http://llvm.org/viewvc/llvm-project?rev=317923&view=rev
Log:
[SimplifyCFG] Use auto * when the type is obvious. NFCI.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=317923&r1=317922&r2=317923&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Fri Nov 10 12:46:21 2017
@@ -6012,12 +6012,12 @@ bool SimplifyCFGOpt::run(BasicBlock *BB)
// If there is a trivial two-entry PHI node in this basic block, and we can
// eliminate it, do so now.
- if (PHINode *PN = dyn_cast<PHINode>(BB->begin()))
+ if (auto *PN = dyn_cast<PHINode>(BB->begin()))
if (PN->getNumIncomingValues() == 2)
Changed |= FoldTwoEntryPHINode(PN, TTI, DL);
Builder.SetInsertPoint(BB->getTerminator());
- if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
+ if (auto *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
if (BI->isUnconditional()) {
if (SimplifyUncondBranch(BI, Builder))
return true;
@@ -6025,25 +6025,22 @@ bool SimplifyCFGOpt::run(BasicBlock *BB)
if (SimplifyCondBranch(BI, Builder))
return true;
}
- } else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
+ } else if (auto *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
if (SimplifyReturn(RI, Builder))
return true;
- } else if (ResumeInst *RI = dyn_cast<ResumeInst>(BB->getTerminator())) {
+ } else if (auto *RI = dyn_cast<ResumeInst>(BB->getTerminator())) {
if (SimplifyResume(RI, Builder))
return true;
- } else if (CleanupReturnInst *RI =
- dyn_cast<CleanupReturnInst>(BB->getTerminator())) {
+ } else if (auto *RI = dyn_cast<CleanupReturnInst>(BB->getTerminator())) {
if (SimplifyCleanupReturn(RI))
return true;
- } else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
+ } else if (auto *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
if (SimplifySwitch(SI, Builder))
return true;
- } else if (UnreachableInst *UI =
- dyn_cast<UnreachableInst>(BB->getTerminator())) {
+ } else if (auto *UI = dyn_cast<UnreachableInst>(BB->getTerminator())) {
if (SimplifyUnreachable(UI))
return true;
- } else if (IndirectBrInst *IBI =
- dyn_cast<IndirectBrInst>(BB->getTerminator())) {
+ } else if (auto *IBI = dyn_cast<IndirectBrInst>(BB->getTerminator())) {
if (SimplifyIndirectBr(IBI))
return true;
}
More information about the llvm-commits
mailing list