[clang] b5f6689 - [clang-format] Annotate ::operator as FunctionDeclarationName (#111115)

2024-10-04 Thread via cfe-commits
Author: Owen Pan Date: 2024-10-04T18:20:21-07:00 New Revision: b5f6689dc93216f9272e790e787548cf29250566 URL: https://github.com/llvm/llvm-project/commit/b5f6689dc93216f9272e790e787548cf29250566 DIFF: https://github.com/llvm/llvm-project/commit/b5f6689dc93216f9272e790e787548cf29250566.diff LOG:

[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-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 f74879cf0cf3e6d1f4c510627a7343ab09485e98 f545a14e11556c91d10b14617e3588fe5eae6d42 --e

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Steven Perron via cfe-commits
@@ -0,0 +1,37 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} s-perron wrote: If you look at FindSMsb and FindU

[clang] [clang-tools-extra] [flang] [lld] [lldb] [llvm] [NFC] Rename Option parsing related files from OptXYZ -> OptionXYZ (PR #110692)

2024-10-04 Thread Jonas Devlieghere via cfe-commits
JDevlieghere wrote: The change itself seems fine but I'm not super convinced that the motivation is worth the churn. All these files live under the "Option" library and therefore it's (IMHO) clear that Opt is short for Option. Is this addressing code review feedback or a real issue where the

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Steven Perron via cfe-commits
@@ -0,0 +1,37 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK: OpMemoryModel Logical GLSL450 + +define noundef i32 @fi

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Adds fields to `HLSLResourceBindingAttr` to store processed binding information. This will be used by CodeGen or Sema for resource initialization or overlapping mapping diagnostic. Moves binding checks for us

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/111203 Adds fields to `HLSLResourceBindingAttr` to store processed binding information. This will be used by CodeGen or Sema for resource initialization or overlapping mapping diagnostic. Moves binding checks for user

[clang] [HLSL] Collect explicit resource binding information (part 1) (PR #111203)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes Adds fields to `HLSLResourceBindingAttr` to store processed binding information. This will be used by CodeGen or Sema for resource initialization or overlapping mapping diagnostic. Moves binding checks for u

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -82,5 +82,6 @@ let TargetPrefix = "spv" in { [llvm_anyint_ty, LLVMScalarOrSameVectorWidth<0, LLVMVectorElementType<0>>], [IntrNoMem, Commutative] >; def int_spv_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], [IntrConvergent]>; + def int_spv_wave_rea

[clang] [Clang] Fix 'counted_by' for nested struct pointers (PR #110497)

2024-10-04 Thread Jan Hendrik Farr via cfe-commits
Cydox wrote: > > Yeah so the problem is if you do `__builtin_dynamic_object_size(v, 0)` > > In that case it's a `DeclRefExpr`, a pointer, and an `LValue`. > > Can you give a more complete example? I just tried the following, and I see > an lvaluetorvalue cast. > > ``` > int f(const void *p) {

[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

2024-10-04 Thread Erich Keane via cfe-commits
@@ -15609,6 +15609,14 @@ TreeTransform::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, tr

[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic (PR #111010)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,28 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-vulkan-unknown %s -o - -filetype=obj | spirv-val %} + +; Test lowering to spir-v backend + +; CHECK-DAG: %[[#uint

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-10-04 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: ah there's a stack trace in an asserts build of clang ``` F 00:00:1728077756.9778713296 logging.cc:62] assert.h assertion failed at third_party/llvm/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp:4602 in llvm::PointerUnion *clang::LocalInstantiationScope::find

[clang] [llvm] Implement operand bundles for floating-point operations (PR #109798)

2024-10-04 Thread Kevin P. Neal via cfe-commits
kpneal wrote: > It does not look as a good base for safety. Many users want the code in > non-default FP modes to be more efficient, Now any any deviation from the > default mode requires use of constrained intrinsics in the entire function, > but now such solution exhibits poor performance, u

[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

2024-10-04 Thread Oleksandr T. via cfe-commits
@@ -15609,6 +15609,14 @@ TreeTransform::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, tr

[clang] [clang][HLSL] Add radians intrinsic (PR #110802)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall approved this pull request. LGTM but I didn't look too closely at the tests. https://github.com/llvm/llvm-project/pull/110802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
@@ -1643,6 +1646,23 @@ bool SPIRVInstructionSelector::selectLength(Register ResVReg, .constrainAllUses(TII, TRI, RBI); } +bool SPIRVInstructionSelector::selectDegrees(Register ResVReg, + const SPIRVType *ResType, +

[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

2024-10-04 Thread Kees Cook via cfe-commits
kees wrote: > This is why I believe the gcc behavior is correct. When it knows the size > given to `malloc` it uses that. When it doesn't know that it simply returns > INT_MAX. When you ask gcc for the `__bdos` of the FAM it will use the `count` > to calculate the size. (nit: `SIZE_MAX`, not

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
@@ -2625,6 +2645,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectFmix(ResVReg, ResType, I); case Intrinsic::spv_length: return selectLength(ResVReg, ResType, I); + case Intrinsic::spv_degrees: +return selectDegrees(ResVReg, Res

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Farzon Lotfi via cfe-commits
@@ -84,4 +84,6 @@ let TargetPrefix = "spv" in { [IntrNoMem, Commutative] >; def int_spv_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], [IntrConvergent]>; def int_spv_sign : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>], [llvm_any_ty

[clang] [Clang][Parser] Remove the concept from the DeclContext if the definition is invalid (PR #111179)

2024-10-04 Thread Younan Zhang via cfe-commits
@@ -337,6 +343,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo, ExprResult ConstraintExprResult = Actions.CorrectDelayedTyposInExpr(ParseConstraintExpression()); if (ConstraintExprResult.isInvalid()) { +if (AddedToScope) ---

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-10-04 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: this has also caused the following issue to pop up in our modules build ``` error: variable 'param' cannot be implicitly captured in a lambda with no capture-default specified ``` hopefully the error provides some guidance for where to look, but I can try to get a reduced repr

[clang] [Clang][Parser] Remove the concept from the DeclContext if the definition is invalid (PR #111179)

2024-10-04 Thread Younan Zhang via cfe-commits
@@ -337,6 +343,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo, ExprResult ConstraintExprResult = Actions.CorrectDelayedTyposInExpr(ParseConstraintExpression()); if (ConstraintExprResult.isInvalid()) { +if (AddedToScope) ---

[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

2024-10-04 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111082 >From e9ed9f9a0415544781f8334b305eb3916fc0862c Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 23 Sep 2024 22:10:59 + Subject: [PATCH 1/3] implement firstbithigh hlsl builtin --- clang/include/clang/Ba

[clang-tools-extra] Add checks to convert std library iterator algorithms into c++20 or boost ranges (PR #97764)

2024-10-04 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: FYI, the new `boost-use-ranges` check is pretty crashy in clangd (https://github.com/llvm/llvm-project/issues/109037, https://github.com/llvm/llvm-project/issues/109367, https://github.com/clangd/clangd/issues/2173, https://github.com/clangd/clangd/issues/2151). https:/

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
@@ -2625,6 +2645,8 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg, return selectFmix(ResVReg, ResType, I); case Intrinsic::spv_length: return selectLength(ResVReg, ResType, I); + case Intrinsic::spv_degrees: +return selectDegrees(ResVReg, Res

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Sarah Spall via cfe-commits
@@ -1643,6 +1646,23 @@ bool SPIRVInstructionSelector::selectLength(Register ResVReg, .constrainAllUses(TII, TRI, RBI); } +bool SPIRVInstructionSelector::selectDegrees(Register ResVReg, + const SPIRVType *ResType, +

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111225.diff 1 Files Affected: - (modified) clang/lib/Driver/Driver.cpp (+9-8) ``diff diff --git a/clang/lib/Driver/Driver.cpp b/cl

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111225.diff 1 Files Affected: - (modified) clang/lib/Driver/Driver.cpp (+9-8) ``diff diff --git a/clang/lib/Driver/Driver.c

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #111227)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111227 None >From 364f8e5778d8dd587ee8b58104edd931c4b9d336 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 07:59:14 -0700 Subject: [PATCH] [Sema] Avoid repeated hash lookups (NFC) --- clang/l

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #111227)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111227.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaOpenMP.cpp (+6-12) ``diff diff --git a/clang/lib/Sema/SemaOpenMP.cpp

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111225 None >From bd591d56e72a252b5dfa2304c8b719c60cfb1808 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 08:00:49 -0700 Subject: [PATCH] [Driver] Avoid repeated hash lookups (NFC) --- clang

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

2024-10-04 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/111228 None >From 2e3d116613a7441b31036cf603d581db6e0afe9b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 4 Oct 2024 08:00:11 -0700 Subject: [PATCH] [Basic] Avoid repeated hash lookups (NFC) --- clang/

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/111228.diff 1 Files Affected: - (modified) clang/lib/Basic/TargetID.cpp (+6-7) ``diff diff --git a/clang/lib/Basic/TargetID.cpp b/

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/111209 >From 461d5133ea1ae1fcdffd036a926243ee3dce5abb Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Wed, 2 Oct 2024 13:30:33 -0700 Subject: [PATCH] [HLSL] Implementation the `degrees` intrinsic - add degrees b

[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

2024-10-04 Thread Finn Plummer via cfe-commits
inbelic wrote: Rebasing onto commit that allows the use of `selectExtInst` with both `CL::degrees` and `GL::Degrees`. Adding additional testcase for this as well. https://github.com/llvm/llvm-project/pull/111209 ___ cfe-commits mailing list cfe-commit

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -914,6 +918,9 @@ bool GCOVProfiler::emitProfileNotes( GlobalVariable *Counters = new GlobalVariable( *M, CounterTy, false, GlobalValue::InternalLinkage, Constant::getNullValue(CounterTy), "__llvm_gcov_ctr"); +const llvm::Triple &Triple

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
https://github.com/hubert-reinterpretcast edited https://github.com/llvm/llvm-project/pull/108570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,129 @@ +; Tests if the __llvm_gcov_ctr section contains a .ref pseudo-op +; referring to the __llvm_covinit section. +; RUN: llc < %s | FileCheck --check-prefixes=CHECK,CHECK-RW %s +; RUN: llc -mxcoff-roptr < %s | FileCheck --check-prefixes=CHECK,CHECK-RO %s + +target d

[clang] [compiler-rt] [llvm] [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (PR #108570)

2024-10-04 Thread Hubert Tong via cfe-commits
@@ -0,0 +1,129 @@ +; Tests if the __llvm_gcov_ctr section contains a .ref pseudo-op +; referring to the __llvm_covinit section. +; RUN: llc < %s | FileCheck --check-prefixes=CHECK,CHECK-RW %s +; RUN: llc -mxcoff-roptr < %s | FileCheck --check-prefixes=CHECK,CHECK-RO %s + +target d

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-04 Thread Keith Packard via cfe-commits
https://github.com/keith-packard created https://github.com/llvm/llvm-project/pull/111235 These two libraries don't build for `-march=armv8-a+nofp -mabi=aapcs-soft` as a couple of uses of floating point instructions and registers have crept in. >From 6201bc34f1213e9f8c477421757509c9c4e678ce Mo

[compiler-rt] [libunwind] [AArch64] Fix nofp regressions in compiler-rt and libunwind (PR #111235)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: Keith Packard (keith-packard) Changes These two libraries don't build for `-march=armv8-a+nofp -mabi=aapcs-soft` as a couple of uses of floating point instructions and registers have crept in. --- Full diff: https://github.com/llvm/ll

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-04 Thread Fangrui Song via cfe-commits
@@ -27,6 +27,14 @@ namespace Fortran::common { class LangOptionsBase { public: + enum SignedOverflowBehaviorTy { +// -fno-wrapv (default behavior in Flang) +SOB_Undefined, MaskRay wrote: unused? Not sure that this definition is useful https://github

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-04 Thread Fangrui Song via cfe-commits
@@ -6921,16 +6921,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_ftrap_function_EQ); - // -fno-strict-overflow implies -fwrapv if it isn't disabled, but - // -fstrict-overflow won't turn off an explicitly enabled

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -32,7 +33,8 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { const auto FindCall = cxxMemberCallExpr( - argumentCountIs(1), + anyOf(argumentCountIs(1), +allOf(argumentCountIs(2), hasArgument(1, cxxDefaultArg

[clang-tools-extra] Add checks to convert std library iterator algorithms into c++20 or boost ranges (PR #97764)

2024-10-04 Thread via cfe-commits
hia3 wrote: It crashes most likely because a local variable is captured in the static lambda. https://github.com/llvm/llvm-project/blob/bf895c714e1f8a51c1e565a75acf60bf7197be51/clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp#L208 https://github.com/llvm/llvm-project/pull/97764 __

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/111229 …ptions Fixes #54848. >From 8849f09458363a96dc3dd080b9e87aa785f6958f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 4 Oct 2024 21:21:43 -0700 Subject: [PATCH] [clang-format] Don't insert spaces after keywor

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
https://github.com/dl8sd11 updated https://github.com/llvm/llvm-project/pull/110351 >From b98e9a4d50d74c298096d2bd2d70ff4c0ef5c4a4 Mon Sep 17 00:00:00 2001 From: dl8sd11 Date: Sat, 28 Sep 2024 07:37:50 + Subject: [PATCH 1/4] [clang-tidy] support string::contains --- .../readability/Contai

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes …ptions Fixes #54848. --- Full diff: https://github.com/llvm/llvm-project/pull/111229.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+14-12) - (modified) clang/unittests/Forma

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
https://github.com/dl8sd11 updated https://github.com/llvm/llvm-project/pull/110351 >From b98e9a4d50d74c298096d2bd2d70ff4c0ef5c4a4 Mon Sep 17 00:00:00 2001 From: dl8sd11 Date: Sat, 28 Sep 2024 07:37:50 + Subject: [PATCH 1/5] [clang-tidy] support string::contains --- .../readability/Contai

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -29,6 +29,43 @@ struct multimap { bool contains(const Key &K) const; }; +using size_t = decltype(sizeof(int)); + +// Lightweight standin for std::string_view. +template +class basic_string_view { +public: + basic_string_view(); + basic_string_view(const basic_string_vi

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -94,12 +102,14 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { binaryOperator(hasLHS(Literal1), hasOperatorName(">"), hasRHS(CountCall)) .bind("negativeComparison")); - // Find membership tests based on `find() == end()`. + // Find

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -453,3 +490,15 @@ void testOperandPermutations(std::map& Map) { // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check for membership [readability-container-contains] // CHECK-FIXES: if (!Map.contains(0)) {}; } + +void testStringNops(std::string St

[clang-tools-extra] [clang-tidy] support string::contains (PR #110351)

2024-10-04 Thread Tommy Chen via cfe-commits
@@ -51,6 +53,12 @@ void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { const auto Literal0 = integerLiteral(equals(0)); const auto Literal1 = integerLiteral(equals(1)); + const auto StringLikeClass = cxxRecordDecl( + hasAnyName("::std::basic_string"

[clang] Multilib error fixes (PR #110804)

2024-10-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. Thanks for making the change! https://github.com/llvm/llvm-project/pull/110804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DependencyScanning] Avoid repeated hash lookups (NFC) (PR #111088)

2024-10-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TableGen] Avoid repeated hash lookups (NFC) (PR #111089)

2024-10-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Avoid repeated hash lookups (NFC) (PR #111087)

2024-10-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Finish implementation of P0522 (PR #96023)

2024-10-04 Thread via cfe-commits
zmodem wrote: We're hitting a new error after this change. I'm not familiar with P0522, can you confirm whether `foo(bad)` is supposed to work or not? ``` template typename H, typename T, typename... Ms> void foo(H h) {} template class Good {}; template class Bad {}; void bar() { // Th

[clang] [Clang][Sema] fix noexecpt mismatch of friend declaration (PR #102267)

2024-10-04 Thread Younan Zhang via cfe-commits
@@ -4698,7 +4698,22 @@ void Sema::InstantiateExceptionSpec(SourceLocation PointOfInstantiation, // Enter the scope of this instantiation. We don't use // PushDeclContext because we don't have a scope. Sema::ContextRAII savedContext(*this, Decl); + + FunctionDecl *Source

[clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

2024-10-04 Thread Tarun Prabhu via cfe-commits
@@ -866,6 +866,17 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, } } + // -fno-strict-overflow implies -fwrapv if it isn't disabled, but + // -fstrict-overflow won't turn off an explicitly enabled -fwrapv. + if (Arg *A = Args.getLastArg(options::OPT

[clang] [Clang] Automatically enable `-fconvergent-functions` on GPU targets (PR #111076)

2024-10-04 Thread Joseph Huber via cfe-commits
@@ -4106,9 +4106,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL && Opts.OpenCLVersion == 200); - Opts.ConvergentFunctions = Args.hasArg(OPT_fconvergent_functions) || -

[clang] [clang-format] Handle template closer followed by braces (PR #110971)

2024-10-04 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. https://github.com/llvm/llvm-project/pull/110971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-04 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. https://github.com/llvm/llvm-project/pull/110381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-04 Thread via cfe-commits
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) { " int foo;\n" "};", Style); - verifyFormat("export {\n" - " int foo;\n" - "};", - Style); + verifyFormat("export { int f

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-04 Thread via cfe-commits
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) { " int foo;\n" "};", Style); - verifyFormat("export {\n" - " int foo;\n" - "};", - Style); + verifyFormat("export { int f

[clang] [clang][bytecode] Change isArrayElement() for narrowed composite arrays (PR #111110)

2024-10-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/10 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 800b073 - [clang][bytecode] Change isArrayElement() for narrowed composite arrays (#111110)

2024-10-04 Thread via cfe-commits
Author: Timm Baeder Date: 2024-10-04T14:19:32+02:00 New Revision: 800b07396ff54b037fa9b73bb15586456656fb79 URL: https://github.com/llvm/llvm-project/commit/800b07396ff54b037fa9b73bb15586456656fb79 DIFF: https://github.com/llvm/llvm-project/commit/800b07396ff54b037fa9b73bb15586456656fb79.diff L

[clang] [Clang] Automatically enable `-fconvergent-functions` on GPU targets (PR #111076)

2024-10-04 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/111076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023)

2024-10-04 Thread Tom Eccles via cfe-commits
@@ -787,6 +787,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fopenmp_force_usm)) CmdArgs.push_back("-fopenmp-force-usm"); + // TODO: OpenMP support isn't "done" yet, so for now we warn that it + // is e

[clang] [clang] Catch missing format attributes (PR #105479)

2024-10-04 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec updated https://github.com/llvm/llvm-project/pull/105479 From f2a8d63ccb5e3e7a748532944c31c4935a9b6115 Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 5 Apr 2024 15:20:37 +0200 Subject: [PATCH] [clang] Catch missing format attribute

[clang] [clang] Catch missing format attributes (PR #105479)

2024-10-04 Thread Budimir Aranđelović via cfe-commits
@@ -0,0 +1,176 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,beforeCxx2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2b -Wmissing-format-attribute %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++23 -Wmissing-format-attribute %s +

[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fix #111011 --- Full diff: https://github.com/llvm/llvm-project/pull/15.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+7) - (modified) clang/unittests/Format/TokenAnnotato

[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

2024-10-04 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
https://github.com/bd1976bris updated https://github.com/llvm/llvm-project/pull/110986 >From 2579ce88f4e757e068621e1763d3aabb5352a223 Mon Sep 17 00:00:00 2001 From: bd1976bris Date: Thu, 3 Oct 2024 12:33:18 +0100 Subject: [PATCH 1/3] [MSVC] work-around for compile time issue 102513 Disable opt

[clang] ef8d506 - [AArch64]Fix FEAT_SME_LUTv2 to have FEAT_SME2 implemented. (#110474)

2024-10-04 Thread via cfe-commits
Author: CarolineConcatto Date: 2024-10-04T10:24:02+01:00 New Revision: ef8d5069e1b8d322cd6905c03bef1b42e2e86515 URL: https://github.com/llvm/llvm-project/commit/ef8d5069e1b8d322cd6905c03bef1b42e2e86515 DIFF: https://github.com/llvm/llvm-project/commit/ef8d5069e1b8d322cd6905c03bef1b42e2e86515.di

[clang] [llvm] [AArch64]Fix FEAT_SME_LUTv2 to have FEAT_SME2 implemented. (PR #110474)

2024-10-04 Thread via cfe-commits
https://github.com/CarolineConcatto closed https://github.com/llvm/llvm-project/pull/110474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] bba3849 - [clang][docs] Add documentation for APValue constructors (#109994)

2024-10-04 Thread via cfe-commits
Author: Timm Baeder Date: 2024-10-04T09:54:08+02:00 New Revision: bba3849b81c8fc5343e22e767e4c5ab415b4b1d4 URL: https://github.com/llvm/llvm-project/commit/bba3849b81c8fc5343e22e767e4c5ab415b4b1d4 DIFF: https://github.com/llvm/llvm-project/commit/bba3849b81c8fc5343e22e767e4c5ab415b4b1d4.diff L

[clang] [clang][docs] Add documentation for APValue constructors (PR #109994)

2024-10-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/109994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Use dynamic type when invalidating by a member function call (PR #111138)

2024-10-04 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/38 When instantiating "callable", the "class CallableType" nested type will only have a declaration in the copy for the instantiation - because it's not refereed to directly by any other code that would need a co

[clang] [analyzer] Use dynamic type when invalidating by a member function call (PR #111138)

2024-10-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balazs Benics (steakhal) Changes When instantiating "callable", the "class CallableType" nested type will only have a declaration in the copy for the instantiation - because it's not refereed to directly by any other

[clang] [analyzer] Use dynamic type when invalidating by a member function call (PR #111138)

2024-10-04 Thread Balazs Benics via cfe-commits
steakhal wrote: I haven't checked this change internally. Only on the LIT tests. https://github.com/llvm/llvm-project/pull/38 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

2024-10-04 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. https://github.com/llvm/llvm-project/pull/15 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-10-04 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > IIRC, you discussed once to have GPU-agnostic intrinsics in LLVM-IR. The > backends then have to handle the details. There's three approaches basically, wrapper header, builtins, and intrinsics. We could make some generic intrinsics but it would be a lot more work and duplica

[clang] [clang][RISC-V] fixed fp calling convention for fpcc eligible structs for risc-v (PR #110690)

2024-10-04 Thread Kamran Yousafzai via cfe-commits
https://github.com/KamranYousafzai updated https://github.com/llvm/llvm-project/pull/110690 >From 2a41d57df06316007868e9c9ffb2e247f02ddeb6 Mon Sep 17 00:00:00 2001 From: "muhammad.kamran4" Date: Tue, 1 Oct 2024 17:21:21 +0200 Subject: [PATCH] fixed fp calling convention for fpcc eligible struct

[clang] [clang-format] Fix a bug in annotating angles containing FatArrow (PR #108671)

2024-10-04 Thread via cfe-commits
@@ -243,14 +244,16 @@ class AnnotatingParser { // operator that was misinterpreted because we are parsing template // parameters. // FIXME: This is getting out of hand, write a decent parser. - if (InExpr && !Line.startsWith(tok::kw_template) && + if

[clang] [clang][bytecode] Change isArrayElement() for narrowed composite arrays (PR #111110)

2024-10-04 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/10 >From 42942dae406eb795c2fdc5db0db536099a224686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 4 Oct 2024 08:37:16 +0200 Subject: [PATCH] [clang][bytecode] Change isArrayElement() for na

[clang] [flang] [llvm] [openmp] [flang][driver] rename flang-new to flang (PR #110023)

2024-10-04 Thread Brad Richardson via cfe-commits
https://github.com/everythingfunctional updated https://github.com/llvm/llvm-project/pull/110023 >From 649a73478c78389560042030a9717a05e8e338a8 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 25 Sep 2024 13:25:22 -0500 Subject: [PATCH 1/6] [flang][driver] rename flang-new to flang --

[clang] [Clang][Driver] Add option to provide path for multilib's YAML config file (PR #109640)

2024-10-04 Thread Lucas Duarte Prates via cfe-commits
https://github.com/pratlucas updated https://github.com/llvm/llvm-project/pull/109640 >From 45a02861ec0a8e50a57a733118e037cdd0bbafbc Mon Sep 17 00:00:00 2001 From: Lucas Prates Date: Mon, 23 Sep 2024 09:25:20 +0100 Subject: [PATCH 1/3] [Clang][Driver] Add option to provide path for multilib's

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
https://github.com/bd1976bris milestoned https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
bd1976bris wrote: /cherry-pick d205191 https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix overload resolution for object parameters with top-level cv-qualifiers in member functions (PR #110435)

2024-10-04 Thread Oleksandr T. via cfe-commits
@@ -1073,3 +1073,10 @@ int main() { return foo[]; // expected-error {{no viable overloaded operator[] for type 'Foo'}} } } + +namespace GH100394 { +struct C { + void f(this const C); + void f() const ; // ok +}; a-tarasyuk wrote: @cor3ntin thanks for

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
bd1976bris wrote: /cherry-pick d2051919bb42087ebde2a8bdcd5b2676ad16d8eb https://github.com/llvm/llvm-project/pull/110986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Infer nusw + nneg -> nuw for getelementptr (PR #111144)

2024-10-04 Thread via cfe-commits
@@ -3096,6 +3096,15 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) { } } + // nusw + nneg -> nuw + if (GEP.hasNoUnsignedSignedWrap() && !GEP.hasNoUnsignedWrap() && + all_of(GEP.indices(), [&](Value *Idx) { +return isKnown

[clang] [llvm] [InstCombine] Infer nusw + nneg -> nuw for getelementptr (PR #111144)

2024-10-04 Thread via cfe-commits
https://github.com/goldsteinn approved this pull request. LGTM although might be a bit more we do to reduce compile time impact. https://github.com/llvm/llvm-project/pull/44 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
llvmbot wrote: Failed to cherry-pick: d205191 https://github.com/llvm/llvm-project/actions/runs/11181614249 Please manually backport the fix and push it to your github fork. Once this is done, please create a [pull request](https://github.com/llvm/llvm-project/compare) https://github.com/l

[clang] [MSVC] work-around for compile time issue 102513 (PR #110986)

2024-10-04 Thread via cfe-commits
llvmbot wrote: Failed to cherry-pick: d2051919bb42087ebde2a8bdcd5b2676ad16d8eb https://github.com/llvm/llvm-project/actions/runs/11181632525 Please manually backport the fix and push it to your github fork. Once this is done, please create a [pull request](https://github.com/llvm/llvm-proje

<    1   2   3   4   >