aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/Linker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-18 02:31:03 +0000
committerChris Lattner <sabre@nondot.org>2002-07-18 02:31:03 +0000
commite306d94782b1c608857738279852dcc050c66004 (patch)
tree3f6ea7bc4b99f773061f910ad4c01adb6681787d /lib/Transforms/Utils/Linker.cpp
parentd124c38993acedc9a473b249108b2ed349be343f (diff)
* Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Linker.cpp')
-rw-r--r--lib/Transforms/Utils/Linker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp
index 094c46fef8..c23de0a178 100644
--- a/lib/Transforms/Utils/Linker.cpp
+++ b/lib/Transforms/Utils/Linker.cpp
@@ -105,7 +105,7 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
if (const ConstantArray *CPA = dyn_cast<ConstantArray>(CPV)) {
const std::vector<Use> &Ops = CPA->getValues();
std::vector<Constant*> Operands(Ops.size());
- for (unsigned i = 0; i < Ops.size(); ++i)
+ for (unsigned i = 0, e = Ops.size(); i != e; ++i)
Operands[i] =
cast<Constant>(RemapOperand(Ops[i], LocalMap, GlobalMap));
Result = ConstantArray::get(cast<ArrayType>(CPA->getType()), Operands);
@@ -154,7 +154,7 @@ static Value *RemapOperand(const Value *In, map<const Value*, Value*> &LocalMap,
}
// Cache the mapping in our local map structure...
- LocalMap.insert(std::make_pair(In, const_cast<Constant*>(CPV)));
+ LocalMap.insert(std::make_pair(In, Result));
return Result;
}