diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-11 18:21:29 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-11 18:21:29 +0000 |
commit | 4fe16d607d11e29d742208894909733f5ad01f8f (patch) | |
tree | a669ba57373e87d31c3af6f301fe4a61f773f4b3 /lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 34dceb47573b0aedd188b5e72bb848ba29a4960f (diff) |
Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index c1944dbe95..ce30477c87 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -710,7 +710,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, // If there is a comparison against null, we will insert a global bool to // keep track of whether the global was initialized yet or not. GlobalVariable *InitBool = - new GlobalVariable(Type::BoolTy, false, GlobalValue::InternalLinkage, + new GlobalVariable(Type::Int1Ty, false, GlobalValue::InternalLinkage, ConstantInt::getFalse(), GV->getName()+".init"); bool InitBoolUsed = false; @@ -1139,13 +1139,13 @@ static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal, /// values ever stored into GV are its initializer and OtherVal. static void ShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) { // Create the new global, initializing it to false. - GlobalVariable *NewGV = new GlobalVariable(Type::BoolTy, false, + GlobalVariable *NewGV = new GlobalVariable(Type::Int1Ty, false, GlobalValue::InternalLinkage, ConstantInt::getFalse(), GV->getName()+".b"); GV->getParent()->getGlobalList().insert(GV, NewGV); Constant *InitVal = GV->getInitializer(); - assert(InitVal->getType() != Type::BoolTy && "No reason to shrink to bool!"); + assert(InitVal->getType() != Type::Int1Ty && "No reason to shrink to bool!"); // If initialized to zero and storing one into the global, we can use a cast // instead of a select to synthesize the desired value. @@ -1341,7 +1341,7 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV, // Otherwise, if the global was not a boolean, we can shrink it to be a // boolean. if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue)) - if (GV->getType()->getElementType() != Type::BoolTy && + if (GV->getType()->getElementType() != Type::Int1Ty && !GV->getType()->getElementType()->isFloatingPoint() && !GS.HasPHIUser) { DOUT << " *** SHRINKING TO BOOL: " << *GV; @@ -1801,7 +1801,7 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal, dyn_cast<ConstantInt>(getVal(Values, BI->getCondition())); // Cannot determine. - if (!Cond || Cond->getType() != Type::BoolTy) + if (!Cond || Cond->getType() != Type::Int1Ty) return false; NewBB = BI->getSuccessor(!Cond->getBoolValue()); } |