diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-30 17:37:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-30 17:37:43 +0000 |
commit | 15676ac89f4f0c3e10108f267ddad19149ad9cb5 (patch) | |
tree | f84ede60d01bb0b508d25d0b779101a5e28c1e09 /lib/Transforms | |
parent | 2eb314b33dec984dfccca0dfae46d5b211fa9c9f (diff) | |
download | external_llvm-15676ac89f4f0c3e10108f267ddad19149ad9cb5.zip external_llvm-15676ac89f4f0c3e10108f267ddad19149ad9cb5.tar.gz external_llvm-15676ac89f4f0c3e10108f267ddad19149ad9cb5.tar.bz2 |
Twines: Don't allow implicit conversion from integers, this is too tricky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/ArgumentPromotion.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 14 | ||||
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index c31e0ef..69df497 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -764,9 +764,9 @@ Function *ArgPromotion::DoPromotion(Function *F, Idxs[1] = ConstantInt::get(Type::Int32Ty, i); Value *Idx = GetElementPtrInst::Create(TheAlloca, Idxs, Idxs+2, - TheAlloca->getName()+"."+i, + TheAlloca->getName()+"."+Twine(i), InsertPt); - I2->setName(I->getName()+"."+i); + I2->setName(I->getName()+"."+Twine(i)); new StoreInst(I2++, Idx, InsertPt); } diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 629edee..e0e5b60 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -494,7 +494,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD, GlobalVariable *NGV = new GlobalVariable(Context, STy->getElementType(i), false, GlobalVariable::InternalLinkage, - In, GV->getName()+"."+i, + In, GV->getName()+"."+Twine(i), GV->isThreadLocal(), GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); @@ -530,7 +530,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD, GlobalVariable *NGV = new GlobalVariable(Context, STy->getElementType(), false, GlobalVariable::InternalLinkage, - In, GV->getName()+"."+i, + In, GV->getName()+"."+Twine(i), GV->isThreadLocal(), GV->getType()->getAddressSpace()); Globals.insert(GV, NGV); @@ -584,7 +584,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD, for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) Idxs.push_back(GEPI->getOperand(i)); NewPtr = GetElementPtrInst::Create(NewPtr, Idxs.begin(), Idxs.end(), - GEPI->getName()+"."+Val, GEPI); + GEPI->getName()+"."+Twine(Val),GEPI); } } GEP->replaceAllUsesWith(NewPtr); @@ -1152,7 +1152,7 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo, Result = new LoadInst(GetHeapSROAValue(LI->getOperand(0), FieldNo, InsertedScalarizedValues, PHIsToRewrite, Context), - LI->getName()+".f" + FieldNo, LI); + LI->getName()+".f"+Twine(FieldNo), LI); } else if (PHINode *PN = dyn_cast<PHINode>(V)) { // PN's type is pointer to struct. Make a new PHI of pointer to struct // field. @@ -1161,7 +1161,7 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo, Result = PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)), - PN->getName()+".f"+FieldNo, PN); + PN->getName()+".f"+Twine(FieldNo), PN); PHIsToRewrite.push_back(std::make_pair(PN, FieldNo)); } else { llvm_unreachable("Unknown usable value"); @@ -1287,12 +1287,12 @@ static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, MallocInst *MI, new GlobalVariable(*GV->getParent(), PFieldTy, false, GlobalValue::InternalLinkage, Context.getNullValue(PFieldTy), - GV->getName() + ".f" + FieldNo, GV, + GV->getName() + ".f" + Twine(FieldNo), GV, GV->isThreadLocal()); FieldGlobals.push_back(NGV); MallocInst *NMI = new MallocInst(FieldTy, MI->getArraySize(), - MI->getName() + ".f" + FieldNo,MI); + MI->getName() + ".f" + Twine(FieldNo), MI); FieldMallocs.push_back(NMI); new StoreInst(NMI, NGV, MI); } diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 6826494..7eec908 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -335,7 +335,7 @@ void SROA::DoScalarReplacement(AllocationInst *AI, for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i) { AllocaInst *NA = new AllocaInst(ST->getContainedType(i), 0, AI->getAlignment(), - AI->getName() + "." + i, AI); + AI->getName() + "." + Twine(i), AI); ElementAllocas.push_back(NA); WorkList.push_back(NA); // Add to worklist for recursive processing } @@ -345,7 +345,7 @@ void SROA::DoScalarReplacement(AllocationInst *AI, const Type *ElTy = AT->getElementType(); for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) { AllocaInst *NA = new AllocaInst(ElTy, 0, AI->getAlignment(), - AI->getName() + "." + i, AI); + AI->getName() + "." + Twine(i), AI); ElementAllocas.push_back(NA); WorkList.push_back(NA); // Add to worklist for recursive processing } @@ -776,7 +776,7 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *BCInst, if (OtherPtr) { Value *Idx[2] = { Zero, ConstantInt::get(Type::Int32Ty, i) }; OtherElt = GetElementPtrInst::Create(OtherPtr, Idx, Idx + 2, - OtherPtr->getNameStr()+"."+i, + OtherPtr->getNameStr()+"."+Twine(i), MI); uint64_t EltOffset; const PointerType *OtherPtrTy = cast<PointerType>(OtherPtr->getType()); diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 7f8d202..5645110 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -867,7 +867,7 @@ bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo, // Create a PhiNode using the dereferenced type... and add the phi-node to the // BasicBlock. PN = PHINode::Create(Allocas[AllocaNo]->getAllocatedType(), - Allocas[AllocaNo]->getName() + "." + Version++, + Allocas[AllocaNo]->getName() + "." + Twine(Version++), BB->begin()); ++NumPHIInsert; PhiToAllocaMap[PN] = AllocaNo; |