mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user