Function::arg_iterator DI = Dest->arg_begin();
for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
I != E; ++I, ++DI) {
- DI->takeName(I); // Copy the name information over...
+ DI->setName(I->getName()); // Copy the name information over...
// Add a mapping to our local map
ValueMap[I] = DI;
// If this instruction is using a value from same basic block then
// update it to use value from cloned instruction.
Instruction *C = In->clone();
- C->takeName(In);
+ C->setName(In->getName());
OrigPreHeader->getInstList().push_back(C);
for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {
BB->eraseFromParent();
// Inherit predecessor's name if it exists...
- if (BB->hasName() && !OnlyPred->hasName())
- OnlyPred->takeName(BB);
+ if (!OldName.empty() && !OnlyPred->hasName())
+ OnlyPred->setName(OldName);
return OnlyPred;
}
//
for (; BI != DestBlock->end(); ++BI) {
Instruction *New = BI->clone();
- New->takeName(BI);
+ New->setName(BI->getName());
SourceBlock->getInstList().push_back(New);
ValueMapping[BI] = New;
}
if (!AggregateArgs) {
AI = newFunction->arg_begin();
for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI)
- AI->takeName(inputs[i]);
+ AI->setName(inputs[i]->getName());
for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI)
AI->setName(outputs[i]->getName()+".out");
}
for (Function::arg_iterator
I = newMain->arg_begin(), E = newMain->arg_end(),
OI = oldMain->arg_begin(); I != E; ++I, ++OI) {
- I->takeName(OI); // Copy argument names from oldMain
+ I->setName(OI->getName()); // Copy argument names from oldMain
args.push_back(I);
}