LowerBitSets: Ignore bitset entries that do not directly refer to a global.
authorPeter Collingbourne <peter@pcc.me.uk>
Sat, 27 Jun 2015 00:17:51 +0000 (00:17 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 27 Jun 2015 00:17:51 +0000 (00:17 +0000)
commitba4c8b50043a33eefac3d150d82e4fd5dfeba7dd
treef2272f92ae386a8b1de19ba7d1d4de8135af161e
parentf8b3ad611d7b51d0a24603fca497dbb553c38a5b
LowerBitSets: Ignore bitset entries that do not directly refer to a global.

It is possible for a global to be substituted with another global of a
different type or a different kind (i.e. an alias) at IR link time. One
example of this scenario is when a Microsoft ABI vtable is substituted with
an alias referring to a larger vtable containing an RTTI reference.

This will cause the global to be RAUW'd with a possibly bitcasted reference
to the other global. This will of course also affect any references to the
global in bitset metadata.

The right way to handle such metadata is simply to ignore it. This is sound
because the linked module should contain another copy of the bitset entries as
applied to the new global.

llvm-svn: 240866
llvm/lib/Transforms/IPO/LowerBitSets.cpp
llvm/test/Transforms/LowerBitSets/nonglobal.ll [new file with mode: 0644]