[all-commits] [llvm/llvm-project] 3bee38: [Clang][AIX] Preserve -mloadtime-comment-vars vari...

Tony Varghese via All-commits all-commits at lists.llvm.org
Thu Aug 6 01:34:37 PDT 2026


  Branch: refs/heads/users/tonykuttai/pragma-comment-copyright-cli
  Home:   https://github.com/llvm/llvm-project
  Commit: 3bee38f3cbc87f392ea701a260d92dccfc2db621
      https://github.com/llvm/llvm-project/commit/3bee38f3cbc87f392ea701a260d92dccfc2db621
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/CodeGen/PowerPC/loadtime-comment-vars-modules.cpp
    M clang/test/CodeGen/PowerPC/loadtime-comment-vars.cpp
    A clang/test/PCH/loadtime-comment-vars.c
    M clang/test/Sema/loadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Preserve -mloadtime-comment-vars variables across serialization

Named internal-linkage variables were silently dropped when their
definition crossed a PCH or C++20 named-module (BMI-to-object) boundary:
DeclMustBeEmitted did not know the implicit attribute, so the PCH writer
never marked the unreferenced variable as required, and for named modules
only non-discardable variables are recorded in the module-initializer
lists that EmitModuleInitializers walks. Teach DeclMustBeEmitted about
the attribute (the CodeGen-side check becomes redundant and is removed)
and record validated internal-linkage module-purview variables in the
module-initializer list.

Since DeclMustBeEmitted now sees the attribute, a preserved variable no
longer triggers -Wunused-const-variable: it is materially used.

Add tests for C++20 module preservation, importer behavior, and
instantiation diagnostics; PCH preservation; unused-warning suppression;
the non-AIX cc1 no-op; and char8_t element-type exclusion. Document the
modules/PCH rules.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list