[clang] [clang][bytecode] Consider unknown-size arrays in memcpy/memcmp (PR #121462)

2025-01-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121462 When emitting diagnostics for the number of elements. >From 26b2225c92cf30d75e91a1a43bdf55e6e624da5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 10:27:30 +0100 Subject: [

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -7331,18 +7332,33 @@ void Parser::ParseDecompositionDeclarator(Declarator &D) { Diag(Tok, diag::err_expected_comma_or_rsquare); } -SkipUntil(tok::r_square, tok::comma, tok::identifier, - StopAtSemi | StopBeforeMatch); +//

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcicli (Conditional Load Immediate) extension (PR #121292)

2025-01-02 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/121292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -verify + +class A { }; + +typedef const A A_Const; +class B : public A_Const { }; // expected-warning {{'const' qualifier on base class type 'A_Const' (aka 'const A') have no effect}} \ +

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -2655,6 +2655,15 @@ CXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class, return nullptr; } +if (BaseType.hasQualifiers() && !isa(BaseType)) { erichkeane wrote: I think the cutout done by the `isa` is way less careful than we int

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread LLVM Continuous Integration via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `ope

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 %s -std=c++11 -Wignored-qualifiers -verify + +class A { }; + +typedef const A A_Const; +class B : public A_Const { }; // expected-warning {{'const' qualifier on base class type 'A_Const' (aka 'const A') have no effect}} \ +

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-02 Thread Erich Keane via cfe-commits
erichkeane wrote: I was/still am OK with this, but wanted @cor3ntin to take a final pass. https://github.com/llvm/llvm-project/pull/117732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: I created a [PR](https://github.com/llvm/llvm-project/pull/121484) to fix the issue. @nico could you please try it? thanks https://github.com/llvm/llvm-project/pull/120159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2025-01-02 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Erich Keane via cfe-commits
erichkeane wrote: As a quick note, the best way to check serialization/deserialization is a PCH /restore test. I did a bunch in `SemaOpenACC` that you can use as an example (see a bunch ending with `-ast` in the name). Basically, you just do the right command-line incantation, plus a #ifdef

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang created https://github.com/llvm/llvm-project/pull/121484 …DIR=OFF The problem is because libclang_rt.builtins-{arch}.a for all the arches will be installed into the same folder with old compiler rt layout (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF) and OHOS driver will

[clang] [clang] Allow generating module interfaces with parsing errors (PR #121485)

2025-01-02 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/121485 Fixes a regression introduced in commit da00c60dae0040185dc45039c4397f6e746548e9 This functionality was originally added in commit 5834996fefc937d6211dc8c8a5b200068753391a From dcdc88688d

[clang] [clang] Allow generating module interfaces with parsing errors (PR #121485)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Alejandro Álvarez Ayllón (alejandro-alvarez-sonarsource) Changes Fixes a regression introduced in commit da00c60dae0040185dc45039c4397f6e746548e9 This functionality was originally added in commit 5834996

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Peng Huang (phuang) Changes …DIR=OFF The problem is because libclang_rt.builtins-{arch}.a for all the arches will be installed into the same folder with old compiler rt layout (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF) and OHOS driv

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Peng Huang (phuang) Changes …DIR=OFF The problem is because libclang_rt.builtins-{arch}.a for all the arches will be installed into the same folder with old compiler rt layout (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF) and OHOS driver will

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2025-01-02 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIR-V] implement SV_GroupID semantic lowering (PR #121521)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Zhengxing li (lizhengxing) Changes The HLSL SV_GroupID semantic attribute is lowered into @llvm.spv.group.id intrinsic in LLVM IR for SPIR-V target. In the SPIR-V backend, this is now translated to a `WorkgroupId` builtin variable. Fixes

[clang] [llvm] [HLSL][SPIR-V] implement SV_GroupID semantic lowering (PR #121521)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-backend-spir-v Author: Zhengxing li (lizhengxing) Changes The HLSL SV_GroupID semantic attribute is lowered into @llvm.spv.group.id intrinsic in LLVM IR for SPIR-V target. In the SPIR-V backend, this is now translated

[clang] [llvm] [HLSL][SPIR-V] implement SV_GroupID semantic lowering (PR #121521)

2025-01-02 Thread Zhengxing li via cfe-commits
https://github.com/lizhengxing created https://github.com/llvm/llvm-project/pull/121521 The HLSL SV_GroupID semantic attribute is lowered into @llvm.spv.group.id intrinsic in LLVM IR for SPIR-V target. In the SPIR-V backend, this is now translated to a `WorkgroupId` builtin variable. Fixes #

[clang] [llvm] [AMDGPU][True16][MC] true16 for v_alignbyte_b32 (PR #119750)

2025-01-02 Thread Brox Chen via cfe-commits
@@ -2353,8 +2353,8 @@ def int_amdgcn_writelane : [IntrNoMem, IntrConvergent, IntrWillReturn, IntrNoCallback, IntrNoFree] >; -def int_amdgcn_alignbyte : ClangBuiltin<"__builtin_amdgcn_alignbyte">, - DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty]

[clang] [clang-format] Add CompoundRequirementLBrace for better annotation (PR #121539)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Also, add ST_CompoundRequirement so that */&/&& in compound requirement expressions are annotated as PointerOrReference. Fixes #121471. --- Full diff: https://github.com/llvm/llvm-project/pull/121539.diff

[clang] [clang-format] Add CompoundRequirementLBrace for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121539 Also, add ST_CompoundRequirement so that */&/&& in compound requirement expressions are annotated as PointerOrReference. Fixes #121471. >From 17c784954e9352738368adb29f85788b06e66b4d Mon Sep 17 00:00:00 2001 Fr

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][ASTMatcher] Add `dependentTemplateSpecializationType` AST mat… (PR #121435)

2025-01-02 Thread kefan cao via cfe-commits
https://github.com/caokefan updated https://github.com/llvm/llvm-project/pull/121435 >From 698464e3a2d30c15f7055449faa6ad58d0db6ac7 Mon Sep 17 00:00:00 2001 From: Kefan Cao <45958009+caoke...@users.noreply.github.com> Date: Tue, 31 Dec 2024 09:17:18 + Subject: [PATCH] [Clang][ASTMatcher] Add

[clang] Add -fuse-lipo option (PR #121231)

2025-01-02 Thread Ashley Hauck via cfe-commits
khyperia wrote: (For what it's worth, just confirming that the current code doesn't work with a full path - it surprisingly kind of almost does, but not quite, due to quirks of `GetProgramPath`) https://github.com/llvm/llvm-project/pull/121231 ___ cf

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2025-01-02 Thread via cfe-commits
@@ -5965,6 +5967,269 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

2025-01-02 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/121467 None >From 64b56760ef4d701f36204588ea82c0ecc24579f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 2 Jan 2025 12:08:17 +0100 Subject: [PATCH] [clang][bytecode] Always return false for

[clang] [clang][Interp] Implement __builtin_bit_cast (PR #68288)

2025-01-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= ,

[clang] [clang-tools-extra] [clang] Avoid re-evaluating field bitwidth (PR #117732)

2025-01-02 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/117732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement __builtin_bit_cast (PR #68288)

2025-01-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/121467.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+2-1) - (modified) clang/test/AST/ByteCode/builtin-constant-p

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/121419 >From 3f6b1d68978857035a972f49b1cfd9d9d0151be9 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Wed, 1 Jan 2025 01:47:17 +0200 Subject: [PATCH 1/2] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualifi

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Oleksandr T. via cfe-commits
@@ -2655,6 +2655,15 @@ CXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class, return nullptr; } +if (BaseType.hasQualifiers() && !isa(BaseType)) { + auto Quals = a-tarasyuk wrote: thanks for the feedback. I've updated it to use

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +namespace { +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +bool CheckBindingsCount(Sema

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -757,23 +780,42 @@ bool Sema::CheckParameterPacksForExpansion( bool HaveFirstPack = false; std::optional NumPartialExpansions; SourceLocation PartiallySubstitutedPackLoc; + typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack; for (UnexpandedParamet

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -210,6 +229,10 @@ class CollectUnexpandedParameterPacksVisitor bool TraversePackIndexingTypeLoc(PackIndexingTypeLoc TL) override { return DynamicRecursiveASTVisitor::TraverseStmt(TL.getIndexExpr()); } +bool +TraverseResolvedUnexpandedPackExpr(ResolvedUn

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -422,8 +445,8 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc, if (const TemplateTypeParmType *TTP = Unexpanded[I].first.dyn_cast()) Name = TTP->getIdentifier(); -else - Name = cast(Unexpanded[I].first)->getIdentifier(); +else if

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -50,16 +51,28 @@ class CollectUnexpandedParameterPacksVisitor auto *FTD = FD ? FD->getDescribedFunctionTemplate() : nullptr; if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit) return; - } else if (getDepthAndIndex(ND).first >= D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
@@ -15991,6 +15991,13 @@ TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) { return E; } +template +ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr( +ResolvedUnexpandedPackExpr *E) { + // Default behavior is to do nothing with this tr

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for working on this. I left some comments, and I think we need more tests for contexts e.g. templated member functions/nested dependent lambdas to test the state machine in TreeTransform, apart from @cor3ntin's request. Moreover, you may need to bui

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add GCC's __builtin_stack_address() to Clang. (PR #121332)

2025-01-02 Thread via cfe-commits
@@ -4782,6 +4782,30 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Function *F = CGM.getIntrinsic(Intrinsic::frameaddress, AllocaInt8PtrTy); return RValue::get(Builder.CreateCall(F, Depth)); } + case Builtin::BI__builtin_stack_ad

[clang] [clang] Fix #embed "fast path" (PR #121479)

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

[clang] Bulk port 64-bit x86 builtins to TableGen (PR #121043)

2025-01-02 Thread Erich Keane via cfe-commits
erichkeane wrote: I unfortunately dont' know enough about the x86 builtins(I think @phoebewang is the owner here who needs to look at them). But my limited-knowledge look through has no concerns. https://github.com/llvm/llvm-project/pull/121043 ___

[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2025-01-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/121044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

2025-01-02 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-bootstrap-asan` running on `sanitizer-buildbot2` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/4927 Here is the relevan

[clang] [Clang] emit -Wignored-qualifiers diagnostic for cv-qualified base classes (PR #121419)

2025-01-02 Thread Mariya Podchishchaeva via cfe-commits
@@ -2655,6 +2655,15 @@ CXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class, return nullptr; } +if (BaseType.hasQualifiers() && !isa(BaseType)) { + auto Quals = Fznamznon wrote: NIT: could you please spell out the type here? It

[clang] [llvm] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2025-01-02 Thread Erich Keane via cfe-commits
erichkeane wrote: I saw this got updates over break. Did LWG make its decision already? Are you expecting re-review? I didn't see anything go across my emails about LWG, but I could definitely have missed it. https://github.com/llvm/llvm-project/pull/106036 __

[clang] [Clang] handle [[warn_unused]] attribute for unused private fields (PR #120734)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -3307,6 +3307,29 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc, } } +template +inline static bool HasAttribute(const QualType &T) { erichkeane wrote: I would say that it should, if 'i' is. I guess I'm not seeing how this is contr

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/9] [analyzer] Don't assume third iteration in

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > My bad. I thought I already approved this one. No problem, I didn't intend to merge this during the Christmas period (when I was on vacation and didn't want to monitor the effects of the change). > Please mention this in the release notes. I added a paragraph to the release

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal appr

[clang] bb27d5e - [analyzer] Don't assume third iteration in loops (#119388)

2025-01-02 Thread via cfe-commits
Author: Donát Nagy Date: 2025-01-02T15:51:03+01:00 New Revision: bb27d5e5c6b194a1440b8ac4e5ace68d0ee2a849 URL: https://github.com/llvm/llvm-project/commit/bb27d5e5c6b194a1440b8ac4e5ace68d0ee2a849 DIFF: https://github.com/llvm/llvm-project/commit/bb27d5e5c6b194a1440b8ac4e5ace68d0ee2a849.diff LO

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/119388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add -fuse-lipo option (PR #121231)

2025-01-02 Thread Steven Wu via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 -fuse-lipo=llvm-lipo 2>&1 | FileCheck -check-prefix=TEST1 %s cachemeifyoucan wrote: Nit: Add a test case to check when the flag is not supplied. https://github.com/llv

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121484 >From 14d95fba0e0142be90d8c72dc8baed7cefc2268d Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 10:21:00 -0500 Subject: [PATCH 1/3] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUN

[clang] Add -fuse-lipo option (PR #121231)

2025-01-02 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan commented: LGTM in general with a comment in test. For discussion. Is it better if the option supplies the full path to lipo or just the name? Full path seems to be easy to use, but might deserve a warning if the tool doesn't exist. If just the name, it might

[clang] Add -fuse-lipo option (PR #121231)

2025-01-02 Thread Steven Wu via cfe-commits
https://github.com/cachemeifyoucan edited https://github.com/llvm/llvm-project/pull/121231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
https://github.com/phuang updated https://github.com/llvm/llvm-project/pull/121484 >From 14d95fba0e0142be90d8c72dc8baed7cefc2268d Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 2 Jan 2025 10:21:00 -0500 Subject: [PATCH 1/2] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUN

[clang] 02b3012 - [clang][bytecode] Always return false for invalid bcp results (#121467)

2025-01-02 Thread via cfe-commits
Author: Timm Baeder Date: 2025-01-02T13:44:45+01:00 New Revision: 02b30128e8e87795b9262035a48990648cbec586 URL: https://github.com/llvm/llvm-project/commit/02b30128e8e87795b9262035a48990648cbec586 DIFF: https://github.com/llvm/llvm-project/commit/02b30128e8e87795b9262035a48990648cbec586.diff L

[clang] [clang][bytecode] Always return false for invalid bcp results (PR #121467)

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

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Michael Buch via cfe-commits
@@ -20099,73 +20179,13 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange, BestPromotionType = BestType; BestWidth = Context.getIntWidth(BestType); - } - else if (NumNegativeBits) { -// If there is a negative value, figure out the small

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/120965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Looks fine to me, thanks! I'll defer approval to one of the maintainers (lets mark the commit as `[NFC]` so it's clear that this doesn't change behaviour) https://github.com/llvm/llvm-project/pull/120965 ___ c

[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)

2025-01-02 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/118566 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. > If I understand correctly, I handled every review suggestion. >

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/119388 _

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -910,38 +910,51 @@ void pr6302(id x, Class y) { //===-

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: steakhal wrote: One more thing. Please mention this in the release notes. https://github.c

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Nico Weber via cfe-commits
nico wrote: I did remove the contents of out/gn/lib/clang/20/lib/linux, but `./lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a` just reappeared on the next build. I'm guessing this might break tests in cmake builds that use `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF` (?) http://45.33.8.2

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-01-02 Thread Richard Li via cfe-commits
https://github.com/chomosuke updated https://github.com/llvm/llvm-project/pull/118568 >From b43a2602025bdacea06ced5171904fb5d765de9f Mon Sep 17 00:00:00 2001 From: chomosuke Date: Tue, 3 Dec 2024 07:10:33 + Subject: [PATCH 1/3] fixed removeFunctionArgs don't remove comma --- .../clang-tid

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-01-02 Thread Richard Li via cfe-commits
https://github.com/chomosuke updated https://github.com/llvm/llvm-project/pull/118568 >From b43a2602025bdacea06ced5171904fb5d765de9f Mon Sep 17 00:00:00 2001 From: chomosuke Date: Tue, 3 Dec 2024 07:10:33 + Subject: [PATCH 1/3] fixed removeFunctionArgs don't remove comma --- .../clang-tid

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2025-01-02 Thread Richard Li via cfe-commits
@@ -164,6 +164,33 @@ void UseRangesCheck::registerMatchers(MatchFinder *Finder) { static void removeFunctionArgs(DiagnosticBuilder &Diag, const CallExpr &Call, ArrayRef Indexes, const ASTContext &Ctx) { + auto GetC

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Nico Weber via cfe-commits
nico wrote: Here's a command you can use to reproduce this: ``` cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS='clang;lld;compiler-rt' -DLLVM_APPEND_VC_REV=NO -DLLVM_TARGETS_TO_BUILD='X86' -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF ../llvm-project/ll

[clang] a4deb80 - Revert "Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (#120159)"

2025-01-02 Thread Nico Weber via cfe-commits
Author: Nico Weber Date: 2025-01-02T09:13:40-05:00 New Revision: a4deb809be8f5ec3adec3626e9d700f6168d0e9f URL: https://github.com/llvm/llvm-project/commit/a4deb809be8f5ec3adec3626e9d700f6168d0e9f DIFF: https://github.com/llvm/llvm-project/commit/a4deb809be8f5ec3adec3626e9d700f6168d0e9f.diff LO

[clang] Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (PR #120159)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: In that case, probably we have to add `-ohos` suffix in [ToolChain::buildCompilerRTBasename()](https://github.com/phuang/llvm-project/blob/main/clang/lib/Driver/ToolChain.cpp#L748) to fix this confliction. WDYT? https://github.com/llvm/llvm-project/pull/120159 __

[clang] [analyzer] Don't assume third iteration in loops (PR #119388)

2025-01-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/119388 From cb9b5ef4d8b0ed8e67276947525d327c547424fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Nov 2024 17:22:58 +0100 Subject: [PATCH 1/8] [analyzer] Don't assume third iteration in

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Mariya Podchishchaeva via cfe-commits
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val, return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val)); } +bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum, +

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -6548,7 +6548,8 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, ? (unsigned)diag::err_keyword_not_supported_on_target : AL.isDeclspecAttribute() ? (unsigned)diag::warn_unhandled_ms_attribute_ignored -

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -179,6 +179,8 @@ def err_opencl_unknown_type_specifier : Error< def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup; +def ext_unknown_attribute_ignored : Extension< + "unknown attribute %0 ignored">, InGroup; erichkeane

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-01-02 Thread Erich Keane via cfe-commits
@@ -12,5 +12,5 @@ [[using clang:]] extern int n; // ok [[using blah: clang::optnone]] extern int n; // expected-error {{attribute with scope specifier cannot follow}} expected-warning {{only applies to functions}} -[[using clang: unknown_attr]] extern int n; // expected-warn

[clang] [clang] Fix #embed "fast path" (PR #121479)

2025-01-02 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/121479 When a single #embed directive is used to initialize a char array, the case is optimized via swap of EmbedExpr to underlying StringLiteral, resulting in better performance in AST consumers. While browsing thr

[clang] [clang] Fix #embed "fast path" (PR #121479)

2025-01-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes When a single #embed directive is used to initialize a char array, the case is optimized via swap of EmbedExpr to underlying StringLiteral, resulting in better performance in AST consumers. While

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Carlo Cabrera via cfe-commits
carlocab wrote: > And one question: will llvm deprecate the old layout? There was some desire to, but it seems to have fizzled out: https://discourse.llvm.org/t/rfc-time-to-drop-legacy-runtime-paths/64628 I imagine it'll happen eventually, but it will probably take a while. > should we consid

[clang] ohos: fix ohos.c test case error with LLVM_ENABLE_PER_TARGET_RUNTIME_… (PR #121484)

2025-01-02 Thread Peng Huang via cfe-commits
phuang wrote: To add this cmake configure error, where should I look at? any hint? https://github.com/llvm/llvm-project/pull/121484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/84591 >From c95d92ebfafa55ef7ded7464457776131bdd59d2 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 9 Mar 2024 02:14:36 +0100 Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Sorry it took me so long to respond. I completely missed your review. https://github.com/llvm/llvm-project/pull/84591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/84591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
@@ -433,6 +433,117 @@ __datasizeof ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of the type ignoring tail padding. +_BitInt, _ExtInt + + +Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes +and in C++. T

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
@@ -433,6 +433,117 @@ __datasizeof ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of the type ignoring tail padding. +_BitInt, _ExtInt + + +Clang supports the C23 ``_BitInt(N)`` feature as an extension in older C modes +and in C++. T

[clang] [libclang] Add API to query more information about base classes. (PR #120300)

2025-01-02 Thread Trevor Laughlin via cfe-commits
trelau wrote: Just referencing https://github.com/llvm/llvm-project/issues/121502 since this PR seem somewhat related (making it easier to iterate over things and pointed out it doesn't work for template instantiations, which might be the underlying problem I encountered). I'd like to keep us

[clang] [llvm] [RISCV] Add a generic OOO CPU (PR #120712)

2025-01-02 Thread Min-Yih Hsu via cfe-commits
@@ -0,0 +1,601 @@ +# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py +# RUN: llvm-mca -mtriple=riscv64 -mattr=+rva23u64,+zabha -mcpu=generic-ooo --all-stats -iterations=1 < %s | FileCheck %s mshockwave wrote: nit: `--all-stats` shows

[clang] [llvm] [RISCV] Add a generic OOO CPU (PR #120712)

2025-01-02 Thread Min-Yih Hsu via cfe-commits
@@ -0,0 +1,494 @@ +//===-- RISCVSchedGenericOOO.td - Generic O3 Processor -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW

[clang] [Clang] Document some of the implementation-defined keywords (PR #84591)

2025-01-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/84591 >From 56167d0e07c0d676aaae796f18af6f7f1f1c1076 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 9 Mar 2024 02:14:36 +0100 Subject: [PATCH] [Clang] Document some of the implementation-defined keywords

[clang-tools-extra] [clang-tidy] Fix modernize-use-integer-sign-comparison comparison (PR #121506)

2025-01-02 Thread via cfe-commits
https://github.com/qt-tatiana created https://github.com/llvm/llvm-project/pull/121506 - modernize-use-integer-sign-comparison should ignore a comparison between the signed wide type and the unsigned narrow type, see #120867 >From 0591e8b7be49299e2b73634a6ad4f2330557b37a Mon Sep 17 00:00:00 20

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW

<    1   2   3   >