================
@@ -4046,6 +4065,12 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
// The value must be emitted, but cannot be emitted eagerly.
assert(!MayBeEmittedEagerly(Global));
addDeferredDeclToEmit(GD);
+ } else if (!getLangOpts().CPlusPlus && ND &&
+ GetGlobalValue(ND->getName()) != nullptr &&
+ MangledName.contains(llvm::FunctionSamples::UniqSuffix)) {
+ // Emit static C function that is mangled with
+ // -funique-internal-linkage-names.
----------------
efriedma-quic wrote:
I'm not really happy with this. The code for deferred declarations and
diagnosing name conflicts is complicated enough without adding the possibility
that the name of a declaration can change later.
Can we just suppress mangling in cases where we reference a symbol without
knowing if it's internal, then it turns out to be internal later?
https://github.com/llvm/llvm-project/pull/145652
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits