[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

Chris Lattner sabre at nondot.org
Thu Sep 28 16:35:38 PDT 2006



Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.64 -> 1.65
---
Log message:


Eliminate ConstantBool::True and ConstantBool::False.  Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


---
Diffs of the changes:  (+5 -4)

 GlobalOpt.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.64 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.65
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.64	Thu Sep 14 13:23:27 2006
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Thu Sep 28 18:35:21 2006
@@ -709,7 +709,7 @@
   // keep track of whether the global was initialized yet or not.
   GlobalVariable *InitBool =
     new GlobalVariable(Type::BoolTy, false, GlobalValue::InternalLinkage,
-                       ConstantBool::False, GV->getName()+".init");
+                       ConstantBool::getFalse(), GV->getName()+".init");
   bool InitBoolUsed = false;
 
   // Loop over all uses of GV, processing them in turn.
@@ -728,7 +728,7 @@
           switch (SCI->getOpcode()) {
           default: assert(0 && "Unknown opcode!");
           case Instruction::SetLT:
-            LV = ConstantBool::False;   // X < null -> always false
+            LV = ConstantBool::getFalse();   // X < null -> always false
             break;
           case Instruction::SetEQ:
           case Instruction::SetLE:
@@ -747,7 +747,7 @@
     } else {
       StoreInst *SI = cast<StoreInst>(GV->use_back());
       // The global is initialized when the store to it occurs.
-      new StoreInst(ConstantBool::True, InitBool, SI);
+      new StoreInst(ConstantBool::getTrue(), InitBool, SI);
       SI->eraseFromParent();
     }
 
@@ -859,7 +859,8 @@
 static void ShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
   // Create the new global, initializing it to false.
   GlobalVariable *NewGV = new GlobalVariable(Type::BoolTy, false,
-         GlobalValue::InternalLinkage, ConstantBool::False, GV->getName()+".b");
+         GlobalValue::InternalLinkage, ConstantBool::getFalse(),
+                                             GV->getName()+".b");
   GV->getParent()->getGlobalList().insert(GV, NewGV);
 
   Constant *InitVal = GV->getInitializer();






More information about the llvm-commits mailing list