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

Vitaly Buka via All-commits all-commits at lists.llvm.org
Fri Apr 26 11:07:25 PDT 2024


  Branch: refs/heads/users/vitalybuka/spr/libcxx-avoid-__cxa_atexit-with-o0
  Home:   https://github.com/llvm/llvm-project
  Commit: c8bc53a3698412d7cbbfcefe52b90bd7feae1b00
      https://github.com/llvm/llvm-project/commit/c8bc53a3698412d7cbbfcefe52b90bd7feae1b00
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-26 (Fri, 26 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: 687ced355d1d489cffc4c74a3e83ad90669c1355
      https://github.com/llvm/llvm-project/commit/687ced355d1d489cffc4c74a3e83ad90669c1355
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-26 (Fri, 26 Apr 2024)

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

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


  Commit: 5d621bdc7b13fd414d24769494a2297641726ea6
      https://github.com/llvm/llvm-project/commit/5d621bdc7b13fd414d24769494a2297641726ea6
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-26 (Fri, 26 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: fa32ebc86f0ec6beecf9d69f8dffb7f1d37dfb46
      https://github.com/llvm/llvm-project/commit/fa32ebc86f0ec6beecf9d69f8dffb7f1d37dfb46
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-04-26 (Fri, 26 Apr 2024)

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

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


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

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

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


Compare: https://github.com/llvm/llvm-project/compare/2a4d7469b457...bd0af57f1ae6

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