Linker: Disallow linking appending globals with different addrspaces
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Dec 2022 17:35:42 +0000 (12:35 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Thu, 22 Dec 2022 03:15:01 +0000 (22:15 -0500)
commit2600a58931d8d49f21a32fd69a844b76fc5cb0b2
tree559d4f1a275efcdc95620b595ca7d655e5cd005c
parent31ec840c61687cc76f405ca09aaae426935c4e9a
Linker: Disallow linking appending globals with different addrspaces

The current appending linkage handling implicitly assumes this by
using a basic ConstantExpr::getBitCast to resolve type
mismatches. Avoid this edge case so we don't need to keep the type
mismatch replacement code around after opaque pointers.
llvm/lib/Linker/IRMover.cpp
llvm/test/Linker/appending-global-err6.ll [new file with mode: 0644]