aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-26 03:48:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-26 03:48:08 +0000
commitfd406f1ee2d94bafcb4943e4b21c2f4ea4bd8f3a (patch)
tree727f479e404c60a6bef17467a116e29274ff9741 /lib/Linker
parent6dabd9dba013173460c0b95e6b41b5776c66270d (diff)
downloadexternal_llvm-fd406f1ee2d94bafcb4943e4b21c2f4ea4bd8f3a.zip
external_llvm-fd406f1ee2d94bafcb4943e4b21c2f4ea4bd8f3a.tar.gz
external_llvm-fd406f1ee2d94bafcb4943e4b21c2f4ea4bd8f3a.tar.bz2
Revert r112091, "Remap metadata attached to instructions when remapping
individual ...", which depends on r111922, which I am reverting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkModules.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index 07089f7..89f4cdc 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -1005,31 +1005,13 @@ static bool LinkFunctionBody(Function *Dest, Function *Src,
// the Source function as operands. Loop through all of the operands of the
// functions and patch them up to point to the local versions...
//
- // This is the same as RemapInstruction, except that it avoids remapping
- // instruction and basic block operands.
- //
for (Function::iterator BB = Dest->begin(), BE = Dest->end(); BB != BE; ++BB)
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- // Remap operands.
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
for (Instruction::op_iterator OI = I->op_begin(), OE = I->op_end();
OI != OE; ++OI)
if (!isa<Instruction>(*OI) && !isa<BasicBlock>(*OI))
*OI = MapValue(*OI, ValueMap);
- // Remap attached metadata.
- SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
- I->getAllMetadata(MDs);
- for (SmallVectorImpl<std::pair<unsigned, MDNode *> >::iterator
- MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
- Value *Old = MI->second;
- if (!isa<Instruction>(Old) && !isa<BasicBlock>(Old)) {
- Value *New = MapValue(Old, ValueMap);
- if (New != Old)
- I->setMetadata(MI->first, cast<MDNode>(New));
- }
- }
- }
-
// There is no need to map the arguments anymore.
for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
I != E; ++I)