[all-commits] [llvm/llvm-project] 681a2d: [libcxx] Remove empty ~__no_destroy

Vitaly Buka via All-commits all-commits at lists.llvm.org
Thu Apr 25 16:07:15 PDT 2024


  Branch: refs/heads/users/vitalybuka/spr/libcxx-avoid-__cxa_atexit-with-o0
  Home:   https://github.com/llvm/llvm-project
  Commit: 681a2d85cbc2a0ec346eaca02cc398534451f191
      https://github.com/llvm/llvm-project/commit/681a2d85cbc2a0ec346eaca02cc398534451f191
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h
    A libcxx/test/libcxx/utilities/no_destroy.pass.cpp

  Log Message:
  -----------
  [libcxx] Remove empty ~__no_destroy

Primary motivation is that after #84651 msan will
complain if fields accessed after ~__no_destroy.

Previously msan assumed that __obj_ will have own
destructor, were we will poison the field, but it never
happened before.

After #84651 msan will complain on any field access
after `~__no_destroy`.

As is Msan does validate fields destruction order for
classes with trivial destructor.

Additionally empty destructor will register __cxa_atexit with -O0.
https://gcc.godbolt.org/z/hce587b65

We can not remove the destructor with union where
_Tp can have non-trivial destructor.

But we can remove destructor if we use in-place
new instead of union.
https://gcc.godbolt.org/z/Yqxx57eEd - empty even with -O0.

Reviewers: #reviewers-libcxx

Pull Request: https://github.com/llvm/llvm-project/pull/89882


  Commit: a27de451f46e337f083a6d40d7b41702c2b1d124
      https://github.com/llvm/llvm-project/commit/a27de451f46e337f083a6d40d7b41702c2b1d124
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h

  Log Message:
  -----------
  Remove "unsigned"


  Commit: 538570c78815d09b2c19b0f1327dfcc6a745ffcf
      https://github.com/llvm/llvm-project/commit/538570c78815d09b2c19b0f1327dfcc6a745ffcf
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h
    M libcxx/test/libcxx/utilities/no_destroy.pass.cpp

  Log Message:
  -----------
  Move field initialized and add constinit test


  Commit: 475b9a914fd68736e13d4b5962b0d783c74e1b6a
      https://github.com/llvm/llvm-project/commit/475b9a914fd68736e13d4b5962b0d783c74e1b6a
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/test/libcxx/utilities/no_destroy.pass.cpp

  Log Message:
  -----------
  Inline test


  Commit: 7cacaad8f77fb28895ed1ef26e594201b96bf491
      https://github.com/llvm/llvm-project/commit/7cacaad8f77fb28895ed1ef26e594201b96bf491
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/test/libcxx/utilities/no_destroy.pass.cpp

  Log Message:
  -----------
  reorder test


  Commit: 4ce1313ebeb3a0e5082ae85d63bead590fda238c
      https://github.com/llvm/llvm-project/commit/4ce1313ebeb3a0e5082ae85d63bead590fda238c
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h

  Log Message:
  -----------
  init only for __libcpp_is_constant_evaluated


  Commit: db440d81ad8cff639b8307fadba162b6d32d36fa
      https://github.com/llvm/llvm-project/commit/db440d81ad8cff639b8307fadba162b6d32d36fa
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h

  Log Message:
  -----------
  construct with 0


  Commit: e0eb0f227443c2ec0e98d08518e9e3f6cb039ce3
      https://github.com/llvm/llvm-project/commit/e0eb0f227443c2ec0e98d08518e9e3f6cb039ce3
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h

  Log Message:
  -----------
  fix build


  Commit: 90a2082ded350d07cce2a76bcc18bbe388b65bd7
      https://github.com/llvm/llvm-project/commit/90a2082ded350d07cce2a76bcc18bbe388b65bd7
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-25 (Thu, 25 Apr 2024)

  Changed paths:
    M libcxx/include/__utility/no_destroy.h

  Log Message:
  -----------
  undo __libcpp_is_constant_evaluated to fix
โ€˜constexprโ€™ constructor does not have empty body


Compare: https://github.com/llvm/llvm-project/compare/1824358f58c9...90a2082ded35

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