Fix a variant of PR6112 found by thinking about it: when doing
authorDuncan Sands <baldrick@free.fr>
Tue, 4 May 2010 12:43:36 +0000 (12:43 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 4 May 2010 12:43:36 +0000 (12:43 +0000)
commit203f7cb68b6c509b388d1662d8439693f75bb964
tree682e419c5bf8666129f76bd20da9577d22fcb226
parent2f256f45612fe86f20d6439b917fbc3662e20f02
Fix a variant of PR6112 found by thinking about it: when doing
RAUW of a global variable with a local variable in function F,
if function local metadata M in function G was using the global
then M would become function-local to both F and G, which is not
allowed.  See the testcase for an example.  Fixed by detecting
this situation and zapping the metadata operand when it occurs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103007 91177308-0d34-0410-b5e6-96231b3b80d8
lib/VMCore/Metadata.cpp
test/Transforms/GlobalOpt/metadata.ll