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

Vitaly Buka via All-commits all-commits at lists.llvm.org
Thu Apr 25 21:31:46 PDT 2024


  Branch: refs/heads/users/vitalybuka/spr/libcxx-avoid-__cxa_atexit-with-o0
  Home:   https://github.com/llvm/llvm-project
  Commit: 91a4e94a8b6db9a9867a3fdc4288237a9304a677
      https://github.com/llvm/llvm-project/commit/91a4e94a8b6db9a9867a3fdc4288237a9304a677
  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: 7af3423de2c49655d664135dcde57ac34cb705f9
      https://github.com/llvm/llvm-project/commit/7af3423de2c49655d664135dcde57ac34cb705f9
  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: 8b72be78462729a6cba0fc5939a601e9b63152dd
      https://github.com/llvm/llvm-project/commit/8b72be78462729a6cba0fc5939a601e9b63152dd
  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: 3101c5db1b450d7b82f0601db2ec750df831e322
      https://github.com/llvm/llvm-project/commit/3101c5db1b450d7b82f0601db2ec750df831e322
  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: 5acfb99ab2a42da983b22c3e40f558c7c4ee3af3
      https://github.com/llvm/llvm-project/commit/5acfb99ab2a42da983b22c3e40f558c7c4ee3af3
  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: 699f60a2664c05e0d69bec04a2dad320a05e0945
      https://github.com/llvm/llvm-project/commit/699f60a2664c05e0d69bec04a2dad320a05e0945
  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: b37628659220fc2d80991c4cb58dd02075697a1a
      https://github.com/llvm/llvm-project/commit/b37628659220fc2d80991c4cb58dd02075697a1a
  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: ae1511af569e9c838533ee79ba11d8bf3000951b
      https://github.com/llvm/llvm-project/commit/ae1511af569e9c838533ee79ba11d8bf3000951b
  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: dd0d9f220326a8fa4a1700b5a9029f9aa7b97c58
      https://github.com/llvm/llvm-project/commit/dd0d9f220326a8fa4a1700b5a9029f9aa7b97c58
  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/90a2082ded35...dd0d9f220326

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