diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:35:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:35:22 +0000 |
commit | 6ab03f6a08d34889d694e1f43f99ba9b8328dcee (patch) | |
tree | 9d649e009e973007ffc1dcdd43c173bd96b38359 /llvm/lib/Transforms/IPO | |
parent | 7843066e15c526b9d4e1364a3a344b9f6fa678e0 (diff) | |
download | bcm5719-llvm-6ab03f6a08d34889d694e1f43f99ba9b8328dcee.tar.gz bcm5719-llvm-6ab03f6a08d34889d694e1f43f99ba9b8328dcee.zip |
Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().
llvm-svn: 30665
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 609bd94aa1a..37c1e40494a 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -709,7 +709,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, // 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 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, 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 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, } 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 bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal, 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(); |