[all-commits] [llvm/llvm-project] c86899: [clang] Add support for `__declspec(no_init_all)` ...

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Wed Nov 20 16:48:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c86899d2d218e19f5a69d9f97f6ff43abc6c897c
      https://github.com/llvm/llvm-project/commit/c86899d2d218e19f5a69d9f97f6ff43abc6c897c
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2024-11-20 (Wed, 20 Nov 2024)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/lib/CodeGen/CGDecl.cpp
    A clang/test/CodeGenCXX/auto-var-init-attr.cpp

  Log Message:
  -----------
  [clang] Add support for `__declspec(no_init_all)` (#116847)

In MSVC, when `/d1initall` is enabled, `__declspec(no_init_all)` can be
applied to a type to suppress auto-initialization for all instances of
that type or to a function to suppress auto-initialization for all
locals within that function.

This change does the same for Clang, except that it applies to the
`-ftrivial-auto-var-init` flag instead.

NOTE: I did not add a Clang-specific spelling for this but would be
happy to make a followup PR if folks are interested in that.



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