[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Here's one scenario where it could make a difference in codegen : ```c++ // Header struct X; extern X x; void f(X&); inline void g() { f(x); } inline void h() { f(*__builtin_launder(__builtin_addressof(x))); } // Source struct X {

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread Erich Keane via cfe-commits
erichkeane wrote: > Should we try to force an instantiation in codegen for > complete-but-not-yet-instantiated classes? I think we have to here. I believe we can do this by changing the `RequireCompleteType` to pass a null `diagnoser`. See this overload:

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread Erich Keane via cfe-commits
erichkeane wrote: > The committee says so > > Because launder is just adding a fence on a pointer to T, we need not know > what T is. > > I don't know whether there are scenarios where calling launder on an > incomplete type would be useful (as presumably you would new an object right >

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread via cfe-commits
cor3ntin wrote: The committee says so Because launder is just adding a fence on a pointer to T, we need not know what T is. I don't know whether there are scenarios where calling launder on an incomplete type would be useful (as presumably you would new an object right before which would

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread Erich Keane via cfe-commits
erichkeane wrote: This patch doesn't really make sense to me. Why would we want `__builtin_launder` to work on incomplete types? https://github.com/llvm/llvm-project/pull/91070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-05 Thread via cfe-commits
https://github.com/cor3ntin commented: Should we try to force an instantiation in codegen for complete-but-not-yet-instantiated classes? https://github.com/llvm/llvm-project/pull/91070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From 11ad517cede0902945c0b7eba0e7f1ff93f08ea0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From fe8c0dc5f7beacae7b1494a5987c3674dbd330d3 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 028f1b078193b9120ddb441808521b6bd6eaed0e 21d9f27692b2a2fa9ac99f4644109e62e3730133 --

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Mital Ashok (MitalAshok) Changes Incomplete types are assumed to need the llvm.launder.invariant.group intrinsic Fixes #90949 --- Full diff: https://github.com/llvm/llvm-project/pull/91070.diff 5 Files Affected: - (modified)

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/91070 Incomplete types are assumed to need the llvm.launder.invariant.group intrinsic Fixes #90949 >From 21d9f27692b2a2fa9ac99f4644109e62e3730133 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024