[CodeGen] Fix an issue when the 'extern C' replacement names broke
authorErich Keane <erich.keane@intel.com>
Tue, 7 Jun 2022 18:29:03 +0000 (11:29 -0700)
committerErich Keane <erich.keane@intel.com>
Tue, 7 Jun 2022 18:30:59 +0000 (11:30 -0700)
commit5c3bde96250c5260773009e691f92cb4823372df
treec61be89082e6974a2f632e2f5b4aa686a38f4dcf
parent4f5648adc588e23e2bf52e189030c792a6f1586a
[CodeGen] Fix an issue when the 'extern C' replacement names broke

Originally broken by me in D122608, this is a regression where we
attempt to replace an extern-C thing with 'itself'.  The problem is that
we end up deleting it, causing the value to fail when it gets put into
llvm.used.
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCXX/externc-used-not-replaced.cpp [new file with mode: 0644]