[all-commits] [llvm/llvm-project] 40b600: [Clang][AIX] Add -mloadtime-comment-vars support t...

Tony Varghese via All-commits all-commits at lists.llvm.org
Thu Sep 10 22:03:20 PDT 2026


  Branch: refs/heads/users/tonykuttai/pragma-comment-copyright-cli
  Home:   https://github.com/llvm/llvm-project
  Commit: 40b600d82a676f031bb4800fbf9953bf550ead94
      https://github.com/llvm/llvm-project/commit/40b600d82a676f031bb4800fbf9953bf550ead94
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Options/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/CodeGen/PowerPC/loadtime-comment-mixed.c
    A clang/test/CodeGen/loadtime-comment-vars.c
    A clang/test/Driver/mloadtime-comment-vars.c
    M llvm/test/Transforms/LowerCommentString/lower-comment-string.ll

  Log Message:
  -----------
  [Clang][AIX] Add -mloadtime-comment-vars support to preserve variables in the final object file.


  Commit: 7c64fa5b273e1f6d3c8b596afa80fc5e7f22eda8
      https://github.com/llvm/llvm-project/commit/7c64fa5b273e1f6d3c8b596afa80fc5e7f22eda8
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    A clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
    M clang/test/CodeGen/loadtime-comment-vars.c
    M clang/test/Driver/mloadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Handle -mloadtime-comment-vars in global var emission


  Commit: ba7068838702adecb49ca200e68498ad2b7b802a
      https://github.com/llvm/llvm-project/commit/ba7068838702adecb49ca200e68498ad2b7b802a
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
    M clang/test/Driver/mloadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Switch -mloadtime-comment-vars name matching to mangled IR names

Replace source-qualified name matching in matchesLoadTimeCommentVarName with
mangled IR symbol name matching via getMangledName(GlobalDecl(VD)).


  Commit: f797448aea23618ac05bcb0d5f18406310c2fb33
      https://github.com/llvm/llvm-project/commit/f797448aea23618ac05bcb0d5f18406310c2fb33
  Author: Tony Varghese <tonypalampalliyil at gmail.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md

  Log Message:
  -----------
  Apply suggestions from code review

Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>


  Commit: 9a14010917a5da819efc9a90dc80dcd057960855
      https://github.com/llvm/llvm-project/commit/9a14010917a5da819efc9a90dc80dcd057960855
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Basic/DiagnosticFrontendKinds.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Options/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    A clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
    A clang/test/CodeGen/PowerPC/loadtime-comment-vars.c
    R clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
    R clang/test/CodeGen/loadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Diagnose unsupported -mloadtime-comment-vars variables


  Commit: d698ef97d3c47e29fa096475dc58d37fe56099cb
      https://github.com/llvm/llvm-project/commit/d698ef97d3c47e29fa096475dc58d37fe56099cb
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp

  Log Message:
  -----------
  Add list-parsing test cases for -mloadtime-comment-vars


  Commit: 6d0a4de3e5971a748d73d1a9cdda71a3e1c280d3
      https://github.com/llvm/llvm-project/commit/6d0a4de3e5971a748d73d1a9cdda71a3e1c280d3
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp

  Log Message:
  -----------
  nit: CodeGenModule.cpp new line deletion


  Commit: 7c738aa3b868239b129c20dd99ad543f3807c12e
      https://github.com/llvm/llvm-project/commit/7c738aa3b868239b129c20dd99ad543f3807c12e
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Basic/DiagnosticFrontendKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.h
    M clang/include/clang/Options/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
    M clang/test/Driver/mloadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Move -mloadtime-comment-vars validation to Sema. Add Release notes.


  Commit: 9efa0663547f0de7f52b2fbe7803f942536cdd53
      https://github.com/llvm/llvm-project/commit/9efa0663547f0de7f52b2fbe7803f942536cdd53
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Basic/LangOptions.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    R clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
    M clang/test/CodeGen/PowerPC/loadtime-comment-vars.c
    A clang/test/CodeGen/PowerPC/loadtime-comment-vars.cpp
    A clang/test/Sema/loadtime-comment-vars.c
    A clang/test/Sema/loadtime-comment-vars.cpp
    M llvm/test/Transforms/LowerCommentString/lower-comment-string.ll

  Log Message:
  -----------
  [Clang][AIX] Restrict -mloadtime-comment-vars to file/namespace scope

Support only file- and namespace-scope variables. Name-matched static
data members, variable template specializations (explicit ones
included), and function-local statics are now diagnosed with
-Wloadtime-comment-var instead of being silently ignored. Implicit
instantiations are diagnosed via the template-instantiation path, once
per instantiating TU. Automatic locals have no symbol to match and
remain out of scope.


  Commit: 38485ce5f6ce9530cfbc7c23c5d3fabaa1f7ef70
      https://github.com/llvm/llvm-project/commit/38485ce5f6ce9530cfbc7c23c5d3fabaa1f7ef70
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 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.


  Commit: 8a3e4e9e73c93d5588622958272fc52ea01d13b6
      https://github.com/llvm/llvm-project/commit/8a3e4e9e73c93d5588622958272fc52ea01d13b6
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/Sema/loadtime-comment-vars.c

  Log Message:
  -----------
  nit: Minor updates to the comments


  Commit: 3bef7e719e65382135c21ea7dc2f772687e30220
      https://github.com/llvm/llvm-project/commit/3bef7e719e65382135c21ea7dc2f772687e30220
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/CodeGen/PowerPC/loadtime-comment-vars.c
    M clang/test/Sema/loadtime-comment-vars.c

  Log Message:
  -----------
  [Clang][AIX] Error on -mloadtime-comment-vars in cc1 for non-AIX targets

The driver continues to warn and drop the option for unsupported targets;
cc1, reachable directly or via -Xclang, now rejects it with
err_drv_unsupported_opt_for_target, mirroring the -mabi=quadword-atomics
and -mxcoff-roptr checks.


  Commit: c69579b61d0721f02700fe41e9620133eac81b42
      https://github.com/llvm/llvm-project/commit/c69579b61d0721f02700fe41e9620133eac81b42
  Author: Tony Varghese <tony.varghese at ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/docs/LanguageExtensions.md

  Log Message:
  -----------
  nit: Minor updates to LanguageExtensions.md


Compare: https://github.com/llvm/llvm-project/compare/2fce408b1c53...c69579b61d07

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