[llvm] r300242 - [LCSSA] Use `auto` when the type is obvious. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 13:01:30 PDT 2017


Author: davide
Date: Thu Apr 13 15:01:30 2017
New Revision: 300242

URL: http://llvm.org/viewvc/llvm-project?rev=300242&view=rev
Log:
[LCSSA] Use `auto` when the type is obvious. NFCI.

Modified:
    llvm/trunk/lib/Transforms/Utils/LCSSA.cpp

Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=300242&r1=300241&r2=300242&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Thu Apr 13 15:01:30 2017
@@ -105,7 +105,7 @@ bool llvm::formLCSSAForInstructions(Smal
     for (Use &U : I->uses()) {
       Instruction *User = cast<Instruction>(U.getUser());
       BasicBlock *UserBB = User->getParent();
-      if (PHINode *PN = dyn_cast<PHINode>(User))
+      if (auto *PN = dyn_cast<PHINode>(User))
         UserBB = PN->getIncomingBlock(U);
 
       if (InstBB != UserBB && !L->contains(UserBB))
@@ -123,7 +123,7 @@ bool llvm::formLCSSAForInstructions(Smal
     // DomBB dominates the value, so adjust DomBB to the normal destination
     // block, which is effectively where the value is first usable.
     BasicBlock *DomBB = InstBB;
-    if (InvokeInst *Inv = dyn_cast<InvokeInst>(I))
+    if (auto *Inv = dyn_cast<InvokeInst>(I))
       DomBB = Inv->getNormalDest();
 
     DomTreeNode *DomNode = DT.getNode(DomBB);
@@ -188,7 +188,7 @@ bool llvm::formLCSSAForInstructions(Smal
       // block.
       Instruction *User = cast<Instruction>(UseToRewrite->getUser());
       BasicBlock *UserBB = User->getParent();
-      if (PHINode *PN = dyn_cast<PHINode>(User))
+      if (auto *PN = dyn_cast<PHINode>(User))
         UserBB = PN->getIncomingBlock(*UseToRewrite);
 
       if (isa<PHINode>(UserBB->begin()) && isExitBlock(UserBB, ExitBlocks)) {




More information about the llvm-commits mailing list