[llvm-commits] CVS: llvm/include/llvm/Instructions.h

Dan Gohman djg at cray.com
Fri May 11 13:59:47 PDT 2007



Changes in directory llvm/include/llvm:

Instructions.h updated: 1.73 -> 1.74
---
Log message:

Simplify BranchInst::getSuccessor, avoiding a conditional operator.


---
Diffs of the changes:  (+1 -2)

 Instructions.h |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.73 llvm/include/llvm/Instructions.h:1.74
--- llvm/include/llvm/Instructions.h:1.73	Fri Apr 27 15:35:56 2007
+++ llvm/include/llvm/Instructions.h	Fri May 11 15:59:29 2007
@@ -1323,8 +1323,7 @@
 
   BasicBlock *getSuccessor(unsigned i) const {
     assert(i < getNumSuccessors() && "Successor # out of range for Branch!");
-    return (i == 0) ? cast<BasicBlock>(getOperand(0)) :
-                      cast<BasicBlock>(getOperand(1));
+    return cast<BasicBlock>(getOperand(i));
   }
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {






More information about the llvm-commits mailing list