llvm.org GIT mirror llvm / 7f93dc8
Switch obvious clients to Twine instead of utostr (when they were already using a Twine, e.g., for names). - I am a little ambivalent about this; we don't want the string conversion of utostr, but using overload '+' mixed with string and integer arguments is sketchy. On the other hand, this particular usage is something of an idiom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77579 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 11 years ago
5 changed file(s) with 15 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
3434 #include "llvm/Target/TargetRegistry.h"
3535 #include "llvm/ADT/SmallPtrSet.h"
3636 #include "llvm/ADT/Statistic.h"
37 #include "llvm/ADT/StringExtras.h"
3837 #include "llvm/ADT/StringSet.h"
3938 #include "llvm/Support/Compiler.h"
4039 #include "llvm/Support/ErrorHandling.h"
217216 if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")";
218217 if (ACPV->getPCAdjustment() != 0) {
219218 O << "-(" << TAI->getPrivateGlobalPrefix() << "PC"
220 << utostr(ACPV->getLabelId())
219 << ACPV->getLabelId()
221220 << "+" << (unsigned)ACPV->getPCAdjustment();
222221 if (ACPV->mustAddCurrentAddress())
223222 O << "-.";
4646 #include "llvm/Support/raw_ostream.h"
4747 #include "llvm/ADT/DepthFirstIterator.h"
4848 #include "llvm/ADT/Statistic.h"
49 #include "llvm/ADT/StringExtras.h"
5049 #include
5150 using namespace llvm;
5251
764763 Idxs[1] = ConstantInt::get(Type::Int32Ty, i);
765764 Value *Idx =
766765 GetElementPtrInst::Create(TheAlloca, Idxs, Idxs+2,
767 TheAlloca->getName()+"."+utostr(i),
766 TheAlloca->getName()+"."+i,
768767 InsertPt);
769 I2->setName(I->getName()+"."+utostr(i));
768 I2->setName(I->getName()+"."+i);
770769 new StoreInst(I2++, Idx, InsertPt);
771770 }
772771
3535 #include "llvm/ADT/SmallPtrSet.h"
3636 #include "llvm/ADT/SmallVector.h"
3737 #include "llvm/ADT/Statistic.h"
38 #include "llvm/ADT/StringExtras.h"
3938 #include "llvm/ADT/STLExtras.h"
4039 #include
4140 using namespace llvm;
494493 GlobalVariable *NGV = new GlobalVariable(Context,
495494 STy->getElementType(i), false,
496495 GlobalVariable::InternalLinkage,
497 In, GV->getName()+"."+utostr(i),
496 In, GV->getName()+"."+i,
498497 GV->isThreadLocal(),
499498 GV->getType()->getAddressSpace());
500499 Globals.insert(GV, NGV);
530529 GlobalVariable *NGV = new GlobalVariable(Context,
531530 STy->getElementType(), false,
532531 GlobalVariable::InternalLinkage,
533 In, GV->getName()+"."+utostr(i),
532 In, GV->getName()+"."+i,
534533 GV->isThreadLocal(),
535534 GV->getType()->getAddressSpace());
536535 Globals.insert(GV, NGV);
584583 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i)
585584 Idxs.push_back(GEPI->getOperand(i));
586585 NewPtr = GetElementPtrInst::Create(NewPtr, Idxs.begin(), Idxs.end(),
587 GEPI->getName()+"."+utostr(Val), GEPI);
586 GEPI->getName()+"."+Val, GEPI);
588587 }
589588 }
590589 GEP->replaceAllUsesWith(NewPtr);
11521151 Result = new LoadInst(GetHeapSROAValue(LI->getOperand(0), FieldNo,
11531152 InsertedScalarizedValues,
11541153 PHIsToRewrite, Context),
1155 LI->getName()+".f" + utostr(FieldNo), LI);
1154 LI->getName()+".f" + FieldNo, LI);
11561155 } else if (PHINode *PN = dyn_cast(V)) {
11571156 // PN's type is pointer to struct. Make a new PHI of pointer to struct
11581157 // field.
11611160
11621161 Result =
11631162 PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)),
1164 PN->getName()+".f"+utostr(FieldNo), PN);
1163 PN->getName()+".f"+FieldNo, PN);
11651164 PHIsToRewrite.push_back(std::make_pair(PN, FieldNo));
11661165 } else {
11671166 llvm_unreachable("Unknown usable value");
12871286 new GlobalVariable(*GV->getParent(),
12881287 PFieldTy, false, GlobalValue::InternalLinkage,
12891288 Context.getNullValue(PFieldTy),
1290 GV->getName() + ".f" + utostr(FieldNo), GV,
1289 GV->getName() + ".f" + FieldNo, GV,
12911290 GV->isThreadLocal());
12921291 FieldGlobals.push_back(NGV);
12931292
12941293 MallocInst *NMI = new MallocInst(FieldTy, MI->getArraySize(),
1295 MI->getName() + ".f" + utostr(FieldNo),MI);
1294 MI->getName() + ".f" + FieldNo,MI);
12961295 FieldMallocs.push_back(NMI);
12971296 new StoreInst(NMI, NGV, MI);
12981297 }
4040 #include "llvm/Support/Compiler.h"
4141 #include "llvm/ADT/SmallVector.h"
4242 #include "llvm/ADT/Statistic.h"
43 #include "llvm/ADT/StringExtras.h"
4443 using namespace llvm;
4544
4645 STATISTIC(NumReplaced, "Number of allocas broken up");
335334 for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i) {
336335 AllocaInst *NA = new AllocaInst(ST->getContainedType(i), 0,
337336 AI->getAlignment(),
338 AI->getName() + "." + utostr(i), AI);
337 AI->getName() + "." + i, AI);
339338 ElementAllocas.push_back(NA);
340339 WorkList.push_back(NA); // Add to worklist for recursive processing
341340 }
345344 const Type *ElTy = AT->getElementType();
346345 for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
347346 AllocaInst *NA = new AllocaInst(ElTy, 0, AI->getAlignment(),
348 AI->getName() + "." + utostr(i), AI);
347 AI->getName() + "." + i, AI);
349348 ElementAllocas.push_back(NA);
350349 WorkList.push_back(NA); // Add to worklist for recursive processing
351350 }
776775 if (OtherPtr) {
777776 Value *Idx[2] = { Zero, ConstantInt::get(Type::Int32Ty, i) };
778777 OtherElt = GetElementPtrInst::Create(OtherPtr, Idx, Idx + 2,
779 OtherPtr->getNameStr()+"."+utostr(i),
778 OtherPtr->getNameStr()+"."+i,
780779 MI);
781780 uint64_t EltOffset;
782781 const PointerType *OtherPtrTy = cast(OtherPtr->getType());
2929 #include "llvm/ADT/SmallPtrSet.h"
3030 #include "llvm/ADT/SmallVector.h"
3131 #include "llvm/ADT/Statistic.h"
32 #include "llvm/ADT/StringExtras.h"
3332 #include "llvm/ADT/STLExtras.h"
3433 #include "llvm/Support/CFG.h"
3534 #include "llvm/Support/Compiler.h"
867866 // Create a PhiNode using the dereferenced type... and add the phi-node to the
868867 // BasicBlock.
869868 PN = PHINode::Create(Allocas[AllocaNo]->getAllocatedType(),
870 Allocas[AllocaNo]->getName() + "." +
871 utostr(Version++), BB->begin());
869 Allocas[AllocaNo]->getName() + "." + Version++,
870 BB->begin());
872871 ++NumPHIInsert;
873872 PhiToAllocaMap[PN] = AllocaNo;
874873 PN->reserveOperandSpace(getNumPreds(BB));