[clang] Revert "[clang] Revert "Disable Unique Internal Linkage Names for internal global vars." (#219261)" (PR #222486)

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 22:55:48 PDT 2026


nickdesaulniers wrote:

Spent 2 minutes asking Gemini (LLM) about this (going to bed now), FWIW:

  ### How to implement "the aliasee should not be uniqued":

  1. Flag the aliasee in Sema / AST: When SemaDeclAttr.cpp:1743 finds the target NamedDecl,
  mark it as an alias target (for example, by setting a bit on Decl or attaching an implicit
  attribute / checking isUsed()).
  2. Add the guard: In CodeGenModule.cpp:2475 (and ItaniumMangle.cpp:731), check this guard to
  return false, preventing the module hash suffix .__uniq.<hash> from being appended to the
  aliasee.

https://github.com/llvm/llvm-project/pull/222486


More information about the cfe-commits mailing list