diff options
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/ConstantMerge.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/IPO/DeadTypeElimination.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/IPO/InlineSimple.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/IPO/MutateStructTypes.cpp | 10 |
4 files changed, 14 insertions, 14 deletions
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index 3564a814c8..70e3437bb9 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/lib/Transforms/IPO/ConstantMerge.cpp @@ -23,7 +23,7 @@ // static inline bool mergeDuplicateConstants(Module *M, unsigned &ConstantNo, - map<ConstPoolVal*, GlobalVariable*> &CMap) { + map<Constant*, GlobalVariable*> &CMap) { Module::GlobalListType &GList = M->getGlobalList(); if (GList.size() <= ConstantNo) return false; // No new constants bool MadeChanges = false; @@ -32,10 +32,10 @@ bool mergeDuplicateConstants(Module *M, unsigned &ConstantNo, GlobalVariable *GV = GList[ConstantNo]; if (GV->isConstant()) { // Only process constants assert(GV->hasInitializer() && "Globals constants must have inits!"); - ConstPoolVal *Init = GV->getInitializer(); + Constant *Init = GV->getInitializer(); // Check to see if the initializer is already known... - map<ConstPoolVal*, GlobalVariable*>::iterator I = CMap.find(Init); + map<Constant*, GlobalVariable*>::iterator I = CMap.find(Init); if (I == CMap.end()) { // Nope, add it to the map CMap.insert(make_pair(Init, GV)); @@ -59,7 +59,7 @@ bool mergeDuplicateConstants(Module *M, unsigned &ConstantNo, // deal with passes. // bool ConstantMerge::mergeDuplicateConstants(Module *M) { - map<ConstPoolVal*, GlobalVariable*> Constants; + map<Constant*, GlobalVariable*> Constants; unsigned LastConstantSeen = 0; return ::mergeDuplicateConstants(M, LastConstantSeen, Constants); } diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index f29ae29e0b..8599118c38 100644 --- a/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -458,13 +458,13 @@ static inline void CheckIncomingValueFor(PHINode *PN, BasicBlock *BB) { const Type *Ty = PN->getType(); if (const PointerType *PT = dyn_cast<PointerType>(Ty)) - NewVal = ConstPoolPointerNull::get(PT); + NewVal = ConstantPointerNull::get(PT); else if (Ty == Type::BoolTy) - NewVal = ConstPoolBool::True; + NewVal = ConstantBool::True; else if (Ty == Type::FloatTy || Ty == Type::DoubleTy) - NewVal = ConstPoolFP::get(Ty, 42); + NewVal = ConstantFP::get(Ty, 42); else if (Ty->isIntegral()) - NewVal = ConstPoolInt::get(Ty, 42); + NewVal = ConstantInt::get(Ty, 42); assert(NewVal && "Unknown PHI node type!"); PN->addIncoming(NewVal, BB); diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index e54e0d9b7f..40b98bd67d 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -41,7 +41,7 @@ static inline void RemapInstruction(Instruction *I, for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { const Value *Op = I->getOperand(op); Value *V = ValueMap[Op]; - if (!V && (isa<GlobalValue>(Op) || isa<ConstPoolVal>(Op))) + if (!V && (isa<GlobalValue>(Op) || isa<Constant>(Op))) continue; // Globals and constants don't get relocated if (!V) { diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp index a433e26ec5..c9f7917bd9 100644 --- a/lib/Transforms/IPO/MutateStructTypes.cpp +++ b/lib/Transforms/IPO/MutateStructTypes.cpp @@ -115,7 +115,7 @@ void MutateStructTypes::AdjustIndices(const CompositeType *OldTy, if (const StructType *OldST = dyn_cast<StructType>(OldTy)) { // Figure out what the current index is... - unsigned ElNum = cast<ConstPoolUInt>(Idx[i])->getValue(); + unsigned ElNum = cast<ConstantUInt>(Idx[i])->getValue(); assert(ElNum < OldST->getElementTypes().size()); map<const StructType*, TransformType>::iterator I = Transforms.find(OldST); @@ -123,7 +123,7 @@ void MutateStructTypes::AdjustIndices(const CompositeType *OldTy, assert(ElNum < I->second.second.size()); // Apply the XForm specified by Transforms map... unsigned NewElNum = I->second.second[ElNum]; - Idx[i] = ConstPoolUInt::get(Type::UByteTy, NewElNum); + Idx[i] = ConstantUInt::get(Type::UByteTy, NewElNum); } } @@ -140,12 +140,12 @@ Value *MutateStructTypes::ConvertValue(const Value *V) { // Ignore null values and simple constants.. if (V == 0) return 0; - if (ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(V)) { + if (Constant *CPV = dyn_cast<Constant>(V)) { if (V->getType()->isPrimitiveType()) return CPV; - if (isa<ConstPoolPointerNull>(CPV)) - return ConstPoolPointerNull::get( + if (isa<ConstantPointerNull>(CPV)) + return ConstantPointerNull::get( cast<PointerType>(ConvertType(V->getType()))); assert(0 && "Unable to convert constpool val of this type!"); } |