diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-07-18 02:31:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-07-18 02:31:03 +0000 |
| commit | f0cfe654d7615e67ce36511f72a0b895be842261 (patch) | |
| tree | f80d0c02dbbceefd4c1151e43ce0a0d81e0d8db4 /llvm/lib/Transforms | |
| parent | 140153f357ae11d7c8e6164158b0d0af7a516aa1 (diff) | |
| download | bcm5719-llvm-f0cfe654d7615e67ce36511f72a0b895be842261.tar.gz bcm5719-llvm-f0cfe654d7615e67ce36511f72a0b895be842261.zip | |
* Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec
llvm-svn: 2953
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 094c46fef84..c23de0a1786 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/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; } |

