[compiler-rt] [clang] [llvm] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-02-01 Thread via cfe-commits
@@ -143,6 +169,201 @@ ReplListCompleter::operator()(llvm::StringRef Buffer, size_t Pos, return Comps; } +static llvm::Error sanitizeOopArguments(const char *ArgV0) { + llvm::Triple SystemTriple(llvm::sys::getProcessTriple()); + if ((OutOfProcessExecutor.getNumOccurrences(

[compiler-rt] [llvm] [clang] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-02-01 Thread via cfe-commits
@@ -16,13 +16,24 @@ #include "clang/Interpreter/CodeCompletion.h" #include "clang/Interpreter/Interpreter.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h" #include "llvm/ExecutionEngine/Orc/LLJIT.h" +#include "llvm/Execution

[compiler-rt] [llvm] [clang] [clang-repl] [ORC] Add support for out-of-process execution on ELF (PR #79936)

2024-02-01 Thread via cfe-commits
@@ -0,0 +1,61 @@ +// REQUIRES: host-supports-jit, x86_64-linux jameshu15869 wrote: Since only ELF and Linux are supported right now, I thought that adding extra `RUN` lines to the others tests would cause unnecessary failures in COFF (Windows) and MachO (Mac).

[libcxx] [lldb] [clang] [lld] [libc] [llvm] [mlir] [flang] [openmp] [clang-tools-extra] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -3878,6 +3883,130 @@ static Align computeCommonAlignment(ArrayRef VL) { return CommonAlignment; } +/// Check if \p Order represents reverse order. +static bool isReverseOrder(ArrayRef Order) { + unsigned Sz = Order.size(); + return !Order.empty() && all_of(enumerate(Or

[openmp] [clang-tools-extra] [libcxx] [lld] [flang] [clang] [llvm] [lldb] [mlir] [libc] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -3930,30 +4065,68 @@ static LoadsState canVectorizeLoads(ArrayRef VL, const Value *VL0, std::optional Diff = getPointersDiff(ScalarTy, Ptr0, ScalarTy, PtrN, DL, SE); // Check that the sorted loads are consecutive. - if (static_cast(*Diff) == VL.si

[libcxx] [flang] [mlir] [openmp] [llvm] [clang] [clang-tools-extra] [lldb] [lld] [libc] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
https://github.com/preames commented: These comments are trying to be helpful in pointing out bits which might be simplified or split off, but my track record with SLP reviews is not great. Feel free to ignore any or all of these. https://github.com/llvm/llvm-project/pull/80310

[flang] [libcxx] [lldb] [lld] [mlir] [clang-tools-extra] [libc] [openmp] [llvm] [clang] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -30,7 +30,7 @@ define void @test() { ; CHECK-SLP-THRESHOLD: bb: ; CHECK-SLP-THRESHOLD-NEXT:[[TMP0:%.*]] = insertelement <4 x ptr> poison, ptr [[COND_IN_V]], i32 0 ; CHECK-SLP-THRESHOLD-NEXT:[[TMP1:%.*]] = shufflevector <4 x ptr> [[TMP0]], <4 x ptr> poison, <4

[clang] [libc] [lld] [llvm] [lldb] [libcxx] [mlir] [flang] [openmp] [clang-tools-extra] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -17,7 +17,7 @@ define i16 @test() { ; CHECK-NEXT:[[TMP4:%.*]] = call <2 x i16> @llvm.masked.gather.v2i16.v2p0(<2 x ptr> [[TMP3]], i32 2, <2 x i1> , <2 x i16> poison) ; CHECK-NEXT:[[TMP5:%.*]] = extractelement <2 x i16> [[TMP4]], i32 0 ; CHECK-NEXT:[[TMP6:%.*]] =

[flang] [libc] [mlir] [libcxx] [lldb] [lld] [clang] [openmp] [clang-tools-extra] [llvm] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -397,27 +241,12 @@ define void @test3([48 x float]* %p, float* noalias %s) { ; CHECK-NEXT: entry: ; CHECK-NEXT:[[ARRAYIDX:%.*]] = getelementptr inbounds [48 x float], ptr [[P:%.*]], i64 0, i64 0 ; CHECK-NEXT:[[ARRAYIDX2:%.*]] = getelementptr inbounds float, ptr [[

[flang] [clang] [openmp] [mlir] [libc] [lldb] [lld] [clang-tools-extra] [llvm] [libcxx] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -3930,30 +4065,68 @@ static LoadsState canVectorizeLoads(ArrayRef VL, const Value *VL0, std::optional Diff = getPointersDiff(ScalarTy, Ptr0, ScalarTy, PtrN, DL, SE); // Check that the sorted loads are consecutive. - if (static_cast(*Diff) == VL.si

[mlir] [clang] [libc] [lldb] [lld] [openmp] [flang] [libcxx] [clang-tools-extra] [llvm] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
https://github.com/preames edited https://github.com/llvm/llvm-project/pull/80310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libc] [mlir] [clang-tools-extra] [openmp] [llvm] [lldb] [clang] [flang] [lld] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
@@ -7,7 +7,7 @@ define i32 @test(ptr noalias %p, ptr noalias %addr) { ; CHECK-NEXT: entry: ; CHECK-NEXT:[[TMP0:%.*]] = insertelement <8 x ptr> poison, ptr [[ADDR:%.*]], i32 0 ; CHECK-NEXT:[[TMP1:%.*]] = shufflevector <8 x ptr> [[TMP0]], <8 x ptr> poison, <8 x i32> ze

[clang] [llvm] [RISCV] Add -march support for many of the S extensions mentioned in the profile specification. (PR #79399)

2024-02-01 Thread Craig Topper via cfe-commits
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/79399 >From 1d29443b30f6d6db2dbba0f78e8347ea126321e7 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 24 Jan 2024 18:39:07 -0800 Subject: [PATCH 1/8] [RISCV] Add many of the S extensions mentioned in the profile

[clang] [clang][dataflow] Add new `join` API and replace existing `merge` implementations. (PR #80361)

2024-02-01 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/80361 >From 660d1afbda79416beb6f373e6252670f912a5181 Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Tue, 30 Jan 2024 16:02:21 + Subject: [PATCH] Add new `join` API and replace existing `merge` implementation

[clang] [clang][dataflow] Add new `join` API and replace existing `merge` implementations. (PR #80361)

2024-02-01 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 5d228eaf0f5d9c873ba12fc439609148f3f88733 cff131eb78e77605265586c181ad9b43bf529609 --

[clang] [clang][dataflow] Add new `join` API and replace existing `merge` implementations. (PR #80361)

2024-02-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yitzhak Mandelbaum (ymand) Changes This patch adds a new interface for the join operation, now properly called `join`. Originally, the framework offered a single `merge` operation, which could serve either as a join or a widening. In prac

[clang] [clang][dataflow] Add new `join` API and replace existing `merge` implementations. (PR #80361)

2024-02-01 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand created https://github.com/llvm/llvm-project/pull/80361 This patch adds a new interface for the join operation, now properly called `join`. Originally, the framework offered a single `merge` operation, which could serve either as a join or a widening. In practice, thoug

[clang] [llvm] [RISCV] Add -march support for many of the S extensions mentioned in the profile specification. (PR #79399)

2024-02-01 Thread Craig Topper via cfe-commits
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/79399 >From 1d29443b30f6d6db2dbba0f78e8347ea126321e7 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 24 Jan 2024 18:39:07 -0800 Subject: [PATCH 1/7] [RISCV] Add many of the S extensions mentioned in the profile

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/80359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/80359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libc] [mlir] [clang-tools-extra] [openmp] [llvm] [lldb] [clang] [flang] [lld] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Philip Reames via cfe-commits
preames wrote: FYI - https://github.com/llvm/llvm-project/pull/80360 adds testing infrastructure to exercise the TTI hooks. https://github.com/llvm/llvm-project/pull/80310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Still need to add a release note, but this should otherwise complete https://github.com/llvm/llvm-project/pull/80359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes Consider the following: ```cpp namespace N0 { namespace N1 { template int x1 = 0; } using namespace N1; } template<> int N0::x1; ``` According to [[dcl.meaning.general

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/80359 Consider the following: ```cpp namespace N0 { namespace N1 { template int x1 = 0; } using namespace N1; } template<> int N0::x1; ``` According to [[dcl.meaning.general] p3.3](http://eel.is/c++dr

[clang] [-Wunsafe-buffer-usage] Fixits for unsafe arguments of function pointer calls (PR #80358)

2024-02-01 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 86cd2fbdfe67d70a7fe061ed5d3a644f50f070f5 8788dc6e7501033b51ed6fa8e7078809c5c1daec --

[clang] [-Wunsafe-buffer-usage] Fixits for unsafe arguments of function pointer calls (PR #80358)

2024-02-01 Thread via cfe-commits
https://github.com/jkorous-apple created https://github.com/llvm/llvm-project/pull/80358 depends on https://github.com/llvm/llvm-project/pull/80347 >From 463a9904c1ae85fbdc0bd6029c6effea3fb16ea6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 23 Jan 2024 16:16:10 -0800 Subject: [PATCH 01/

[clang] [-Wunsafe-buffer-usage] Fixits for array decayed to pointer (PR #80347)

2024-02-01 Thread via cfe-commits
https://github.com/jkorous-apple updated https://github.com/llvm/llvm-project/pull/80347 >From 463a9904c1ae85fbdc0bd6029c6effea3fb16ea6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 23 Jan 2024 16:16:10 -0800 Subject: [PATCH 01/15] [-Wunsafe-buffer-usage] Move Strategy class to the head

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-01 Thread Richard Smith via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-01 Thread Richard Smith via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -346,6 +348,15 @@ class CGDebugInfo { const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI, llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD); + // A cache that maps artificial inlined function names used for + // __builtin_verbose_trap to

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot closed https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] bfc6eaa - [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (#80292)

2024-02-01 Thread via cfe-commits
Author: Hana Dusíková Date: 2024-02-01T23:31:32+01:00 New Revision: bfc6eaa26326e4d0d20d1f4a1f0064c6df0135bd URL: https://github.com/llvm/llvm-project/commit/bfc6eaa26326e4d0d20d1f4a1f0064c6df0135bd DIFF: https://github.com/llvm/llvm-project/commit/bfc6eaa26326e4d0d20d1f4a1f0064c6df0135bd.diff

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 886cd32ef022fcb7c5a4604c5238074a54f78b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] New calling convention preserve_none (PR #76868)

2024-02-01 Thread via cfe-commits
https://github.com/weiguozhi updated https://github.com/llvm/llvm-project/pull/76868 >From 90e14918a0eb13e2187f8548416ac72491d966c1 Mon Sep 17 00:00:00 2001 From: Guozhi Wei Date: Thu, 21 Dec 2023 19:04:44 + Subject: [PATCH 1/7] New calling convention preserve_none The new calling conventi

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #80288)

2024-02-01 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/80288 >From 88c382b0af1ebc76e5d80d36ddb5345e0bc9f676 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Thu, 1 Feb 2024 20:54:46 +0800 Subject: [PATCH] [Clang][Sema] fix outline member function template with default align cr

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3416,6 +3437,27 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor( +llvm::DebugLoc TrapLocation, StringRef Prefix,

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread Artem Dergachev via cfe-commits
@@ -61,6 +61,7 @@ void testArraySubscripts(int *p, int **pp) { ); int a[10]; // expected-warning{{'a' is an unsafe buffer that does not perform bounds checks}} +// expected-note@-1{{change type of 'a' to 'std::array' to harden it}}

[clang-tools-extra] [clang-tidy] Remove check-specific HeaderFileExtensions and Implement… (PR #80333)

2024-02-01 Thread via cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?= Message-ID: In-Reply-To: https://github.com/EugeneZelenko approved this pull request. https://github.com/llvm/llvm-project/pull/80333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
@@ -2495,10 +2470,113 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext &Ctx, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s + +// CHECK-LABEL: define void @_Z2f0v() +// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]] + +// CHECK-LABEL: define void @_Z2f1v() +// CHECK: ca

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3424,6 +3443,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation * +CGDebugInfo::CreateTrapFailureMessageFor(llvm::DebugLoc TrapLocation, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
https://github.com/delcypher requested changes to this pull request. Looks pretty good. I have a few minor comments. Some things I suggest we may want to do in a follow up patch. https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fcxx-exceptions -verify %s + +#if !__has_builtin(__builtin_verbose_trap) +#error +#endif + +constexpr char const* constMsg1 = "hello"; +char cons

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s + +#if !__has_builtin(__builtin_verbose_trap) +#error +#endif + +constexpr char const* constMsg1 = "hello"; +char const* const constMsg2 = "hello"; +char const constMsg3[] = "hello"; + +templ

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3379,6 +3379,57 @@ Query for this feature with ``__has_builtin(__builtin_debugtrap)``. Query for this feature with ``__has_builtin(__builtin_trap)``. +``__builtin_verbose_trap`` +-- + +``__builtin_verbose_trap`` causes the program to stop its exec

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -3452,6 +3452,18 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_trap: EmitTrapCall(Intrinsic::trap); return RValue::get(nullptr); + case Builtin::BI__builtin_verbose_trap: { +llvm::DILocation *Tra

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s delcypher wrote: Could we add a separate test that tests the trap merging behavior in optimized code? https://github.com/llvm/llv

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s + +// CHECK-LABEL: define void @_Z2f0v() +// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]] + +// CHECK-LABEL: define void @_Z2f1v() +// CHECK: ca

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s + +// CHECK-LABEL: define void @_Z2f0v() +// CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]] + +// CHECK-LABEL: define void @_Z2f1v() +// CHECK: ca

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -775,6 +775,11 @@ class Expr : public ValueStmt { const Expr *PtrExpression, ASTContext &Ctx, EvalResult &Status) const; + /// If the current Expr can be evaluated to a pointer to a null-terminated + /// co

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
@@ -1628,6 +1628,25 @@ llvm::DIType *CGDebugInfo::createFieldType( offsetInBits, flags, debugType, Annotations); } +llvm::DISubprogram * +CGDebugInfo::createInlinedTrapSubprogram(StringRef FuncName, +

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Dan Liew via cfe-commits
https://github.com/delcypher edited https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
@@ -58,6 +95,8 @@ class UnsafeBufferUsageHandler { #endif public: + enum class TargetType { Span, Array }; jkorous-apple wrote: Totally. Removed. Thanks! https://github.com/llvm/llvm-project/pull/80084 ___ cfe-com

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
https://github.com/jkorous-apple updated https://github.com/llvm/llvm-project/pull/80084 >From 463a9904c1ae85fbdc0bd6029c6effea3fb16ea6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 23 Jan 2024 16:16:10 -0800 Subject: [PATCH 01/13] [-Wunsafe-buffer-usage] Move Strategy class to the head

[clang] [llvm] [lld] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-02-01 Thread Rahman Lavaee via cfe-commits
rlavaee wrote: Thank everyone for reviewing. I will probably merge this today. I want to save myself and others the trouble of merge conflicts over 38 files. https://github.com/llvm/llvm-project/pull/74128 ___ cfe-commits mailing list cfe-commits@list

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-01 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 7cb9e7b604a16414f31309b59747abbd7d3c0025 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH] [clangd] Add fix-all CodeActions --- clang-tools-extra/clang

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
https://github.com/jkorous-apple updated https://github.com/llvm/llvm-project/pull/80084 >From 463a9904c1ae85fbdc0bd6029c6effea3fb16ea6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 23 Jan 2024 16:16:10 -0800 Subject: [PATCH 01/12] [-Wunsafe-buffer-usage] Move Strategy class to the head

[clang] [clang-tools-extra] [clangd] Add support to rename Objective-C selectors (PR #78872)

2024-02-01 Thread Alex Hoppen via cfe-commits
https://github.com/ahoppen updated https://github.com/llvm/llvm-project/pull/78872 >From 26d9d1a5a342df34cde921f7d9921e7b94dadd87 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Tue, 19 Dec 2023 15:54:40 -0800 Subject: [PATCH 1/5] [Refactoring] Add capabilities to `SymbolName` to represent Ob

[libc] [compiler-rt] [llvm] [clang] [flang] [libcxx] [clang-tools-extra] [SLP]Improve minbitwidth analysis. (PR #78976)

2024-02-01 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev updated https://github.com/llvm/llvm-project/pull/78976 >From 391145a2d04873ef84c4f1083fe9b9fcdbb3b940 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 22 Jan 2024 14:13:51 + Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From af3118a1bbc071ec5d3a9d5b43cce66b0fe828e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] [-Wunsafe-buffer-usage] Fixits for array decayed to pointer (PR #80347)

2024-02-01 Thread via cfe-commits
https://github.com/jkorous-apple created https://github.com/llvm/llvm-project/pull/80347 depends on https://github.com/llvm/llvm-project/pull/80084 >From 463a9904c1ae85fbdc0bd6029c6effea3fb16ea6 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Tue, 23 Jan 2024 16:16:10 -0800 Subject: [PATCH 01

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
@@ -61,6 +61,7 @@ void testArraySubscripts(int *p, int **pp) { ); int a[10]; // expected-warning{{'a' is an unsafe buffer that does not perform bounds checks}} +// expected-note@-1{{change type of 'a' to 'std::array' to harden it}}

[llvm] [mlir] [clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 4b2d3b7b8f04510f791e4d3cc68b2de5a273c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread via cfe-commits
@@ -2495,10 +2470,113 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext &Ctx, +

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Changes LGTM, but please add a release note to > > `clang/docs/ReleaseNotes.rst` so users know about the fix. > > Thank you for the fix! > > FYI this is a regression in 18 affecting users so we should backport Btw, instructions on how to do that can be found here: http

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Changes LGTM, but please add a release note to > > `clang/docs/ReleaseNotes.rst` so users know about the fix. > > Thank you for the fix! > > Even if it's a fix for recent PR I did few days ago? Oh, I had missed that, sorry! Then no, a release note isn't needed. https:/

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread Artem Dergachev via cfe-commits
@@ -2495,10 +2470,113 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext &Ctx, +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread Artem Dergachev via cfe-commits
@@ -2495,10 +2470,113 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext &Ctx, +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread Artem Dergachev via cfe-commits
@@ -58,6 +95,8 @@ class UnsafeBufferUsageHandler { #endif public: + enum class TargetType { Span, Array }; haoNoQ wrote: Looks like a bit of dead code? https://github.com/llvm/llvm-project/pull/80084 ___ cfe-commi

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-01 Thread Artem Dergachev via cfe-commits
@@ -61,6 +61,7 @@ void testArraySubscripts(int *p, int **pp) { ); int a[10]; // expected-warning{{'a' is an unsafe buffer that does not perform bounds checks}} +// expected-note@-1{{change type of 'a' to 'std::array' to harden it}}

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread via cfe-commits
cor3ntin wrote: > Changes LGTM, but please add a release note to `clang/docs/ReleaseNotes.rst` > so users know about the fix. > > Thank you for the fix! FYI this is a regression in 18 affecting users so we should backport https://github.com/llvm/llvm-project/pull/80292 __

[llvm] [mlir] [clang] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Akash Banerjee (TIFitis) Changes This patch migrates the CGOpenMPRuntimeGPU::emitReduction and related functions to the OpenMPIRBUilder. In future patches MLIR OpenMP translation would be making use of these functions. Co-authore

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
@@ -234,6 +234,35 @@ constexpr int check_macro_consteval_if_skipped(int i) { // CHECK-NEXT: [[@LINE return i; } +struct false_value { + constexpr operator bool() { +return false; + } +}; + +template struct dependable_false_value { + constexpr operator bool() { +

[clang] [flang] [openmp] [libcxx] [clang-tools-extra] [mlir] [lldb] [llvm] [lld] [libc] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/80310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [libc] [clang-tools-extra] [mlir] [lld] [lldb] [openmp] [clang] [flang] [SLP]Add support for strided loads. (PR #80310)

2024-02-01 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/80310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [libc] [clang-tools-extra] [mlir] [lld] [lldb] [openmp] [clang] [flang] [SLP][TTI]Add support for strided loads. (PR #80310)

2024-02-01 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev updated https://github.com/llvm/llvm-project/pull/80310 >From 92950afd39034c0184a3c807f8062e0053eead5c Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 1 Feb 2024 17:22:34 + Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 4b2d3b7b8f04510f791e4d3cc68b2de5a273c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Fangrui Song via cfe-commits
@@ -234,6 +234,35 @@ constexpr int check_macro_consteval_if_skipped(int i) { // CHECK-NEXT: [[@LINE return i; } +struct false_value { + constexpr operator bool() { +return false; + } +}; + +template struct dependable_false_value { + constexpr operator bool() { +

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
hanickadot wrote: > Changes LGTM, but please add a release note to `clang/docs/ReleaseNotes.rst` > so users know about the fix. > > Thank you for the fix! Even if it's a fix for recent PR I did few days ago? Also, how do I get this into release branch (the previous change is there)? https://

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Changes LGTM, but please add a release note to `clang/docs/ReleaseNotes.rst` so users know about the fix. Thank you for the fix! https://github.com/llvm/llvm-project/pull/80292 ___ cfe-commits mailing list c

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80327 >From afcf464812bdb0a167023e7930b0be2ed29a3b3e Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 1 Feb 2024 11:19:14 -0800 Subject: [PATCH] [Clang][Sema] Fix crash with const qualified member operator new

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From f1dfd7fb2713f879de3532c903217b911b81db34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] [coverage] fix crash in code coverage

[openmp] [clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
@@ -1808,12 +1808,24 @@ struct CounterCoverageMappingBuilder } } +private: + static bool evaluateConstantCondition(const Expr *Condition) { +if (const auto *Expr = dyn_cast(Condition)) + return Expr->getResultAsAPSInt().getExtValue(); + +if (const auto *Exp

[openmp] [clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
@@ -1808,12 +1808,24 @@ struct CounterCoverageMappingBuilder } } +private: + static bool evaluateConstantCondition(const Expr *Condition) { +if (const auto *Expr = dyn_cast(Condition)) + return Expr->getResultAsAPSInt().getExtValue(); + +if (const auto *Exp

[openmp] [clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot updated https://github.com/llvm/llvm-project/pull/80292 From 84817eb419dfe0a66e8b4b1d21cf67cbc6b20199 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea <37383324+aga...@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:14:05 -0500 Subject: [PATCH] [coverage] fix crash

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread via cfe-commits
@@ -1808,12 +1808,24 @@ struct CounterCoverageMappingBuilder } } +private: + static bool evaluateConstantCondition(const Expr *Condition) { +if (const auto *Expr = dyn_cast(Condition)) + return Expr->getResultAsAPSInt().getExtValue(); + +if (const auto *Exp

[clang] [analyzer][HTMLRewriter] Cache partial rewrite results. (PR #80220)

2024-02-01 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ closed https://github.com/llvm/llvm-project/pull/80220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 243bfed - [analyzer][HTMLRewriter] Cache partial rewrite results. (#80220)

2024-02-01 Thread via cfe-commits
Author: Artem Dergachev Date: 2024-02-01T13:07:21-08:00 New Revision: 243bfed68367263cfc3fb3f396660acf60051fbf URL: https://github.com/llvm/llvm-project/commit/243bfed68367263cfc3fb3f396660acf60051fbf DIFF: https://github.com/llvm/llvm-project/commit/243bfed68367263cfc3fb3f396660acf60051fbf.dif

[clang-tools-extra] [libcxx] [lldb] [lld] [llvm] [compiler-rt] [libc] [libcxxabi] [flang] [clang] [TTI][RISCV]Improve costs for fixed vector whole reg extract/insert. (PR #80164)

2024-02-01 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev updated https://github.com/llvm/llvm-project/pull/80164 >From cfd0dcfa1f5fabd12cf4d7bf8d5a10bd324ace0a Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 31 Jan 2024 16:47:49 + Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)

2024-02-01 Thread Hana Dusíková via cfe-commits
@@ -1808,12 +1808,24 @@ struct CounterCoverageMappingBuilder } } +private: + static bool evaluateConstantCondition(const Expr *Condition) { +if (const auto *Expr = dyn_cast(Condition)) + return Expr->getResultAsAPSInt().getExtValue(); + +if (const auto *Exp

[clang] [clang] Add some CodeGen tests for CWG 1xx issues (PR #80338)

2024-02-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes Covers CWG issues [185](https://cplusplus.github.io/CWG/issues/185.html), [193](https://cplusplus.github.io/CWG/issues/193.html), [199](https://cplusplus.github.io/CWG/issues/199.html). I also looked at

[clang] [clang] Add some CodeGen tests for CWG 1xx issues (PR #80338)

2024-02-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/80338 Covers CWG issues [185](https://cplusplus.github.io/CWG/issues/185.html), [193](https://cplusplus.github.io/CWG/issues/193.html), [199](https://cplusplus.github.io/CWG/issues/199.html). I also looked at [190](htt

[clang] [AMDGPU] Diagnose unaligned atomic (PR #80322)

2024-02-01 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/80322 >From 8cc0ecfe6723b7eb363a5eef2cd4b8630e6a2ac8 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 1 Feb 2024 13:44:03 -0500 Subject: [PATCH] [AMDGPU] Diagnose unaligned atomic for amdgpu AMDGPU does no

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Adrian Prantl via cfe-commits
@@ -346,6 +348,15 @@ class CGDebugInfo { const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI, llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD); + // A cache that maps artificial inlined function names used for + // __builtin_verbose_trap to

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-02-01 Thread Adrian Prantl via cfe-commits
@@ -346,6 +348,15 @@ class CGDebugInfo { const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI, llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD); + // A cache that maps artificial inlined function names used for + // __builtin_verbose_trap to

<    1   2   3   4   5   6   >