[llvm-commits] [llvm] r94632 - /llvm/trunk/lib/Linker/LinkModules.cpp
Victor Hernandez
vhernandez at apple.com
Wed Jan 27 14:03:16 PST 2010
This is fixed in r94691.
Victor
On Jan 26, 2010, at 6:18 PM, Chris Lattner wrote:
>
> On Jan 26, 2010, at 4:30 PM, Victor Hernandez wrote:
>
>> Author: hernande
>> Date: Tue Jan 26 18:30:42 2010
>> New Revision: 94632
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=94632&view=rev
>> Log:
>> Linker needs to do deep-copy of function-local metadata to update references to function arguments
>>
>> Modified:
>> llvm/trunk/lib/Linker/LinkModules.cpp
>>
>> Modified: llvm/trunk/lib/Linker/LinkModules.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=94632&r1=94631&r2=94632&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Linker/LinkModules.cpp (original)
>> +++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Jan 26 18:30:42 2010
>> @@ -392,7 +392,19 @@
>> assert(!isa<GlobalValue>(CPV) && "Unmapped global?");
>> llvm_unreachable("Unknown type of derived type constant value!");
>> }
>> - } else if (isa<MDNode>(In) || isa<MDString>(In)) {
>> + } else if (const MDNode *MD = dyn_cast<MDNode>(In)) {
>> + if (MD->isFunctionLocal()) {
>> + SmallVector<Value*, 4> Elts;
>> + for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) {
>> + Value *Op = MD->getOperand(i);
>> + // LinkFunctionBody() already handled non-argument values.
>> + Elts.push_back(isa<Argument>(Op) ? RemapOperand(Op, ValueMap) : Op);
>
> I don't follow this logic. It seems that you should call RemapOperand on all operands of the function MDNode. What if you have something like !{ !{ i32 %0 } }
>
> ?
>
> -Chris
>
>> + }
>> + Result = MDNode::get(In->getContext(), Elts.data(), MD->getNumOperands());
>> + } else {
>> + Result = const_cast<Value*>(In);
>> + }
>> + } else if (isa<MDString>(In)) {
>> Result = const_cast<Value*>(In);
>> } else if (isa<InlineAsm>(In)) {
>> Result = const_cast<Value*>(In);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list