[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa closed https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -759,6 +761,84 @@ def BrCondOp : CIR_Op<"brcond", }]; } +//===--===// +// While & DoWhileOp +//===--===// + +class WhileOpBase : CIR_Op

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-26 Thread Matheus Izvekov via cfe-commits
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint { // We do not actually substitute the parameter mappings into the // constraint expressions, therefore the constraint expressions are // the originals, and comparing them will suffice. -if

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
@@ -708,6 +712,34 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D, options::OPT_m_amdgpu_Features_Group); } +static unsigned GetFullLTOPartitions(const Driver &D, const ArgList &Args) { + const Arg *A = Args.getLastArg(options::OPT_flto_par

[clang] [CIR][NFC] Fix warnings in ClangIR code (PR #133134)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -1366,8 +1366,7 @@ mlir::Value ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( const mlir::Location loc = cgf.getLoc(e->getSourceRange()); if (auto kind = e->getKind(); kind == UETT_SizeOf || kind == UETT_DataSizeOf) { -if (const VariableArrayType *variableA

[clang] 304454f - [clang-cl] Accept the --warning-suppression-mappings= option (#133092)

2025-03-26 Thread via cfe-commits
Author: Hans Wennborg Date: 2025-03-26T15:31:10-04:00 New Revision: 304454f9e71ddbbb6c25e1b5d406131ded2417d0 URL: https://github.com/llvm/llvm-project/commit/304454f9e71ddbbb6c25e1b5d406131ded2417d0 DIFF: https://github.com/llvm/llvm-project/commit/304454f9e71ddbbb6c25e1b5d406131ded2417d0.diff

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -223,6 +223,16 @@ class CIRGenFunction : public CIRGenTypeCache { void emitDecl(const clang::Decl &d); + /// Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to + /// detect undefined behavior when the pointer overflow sanitizer is enabled. + /// \

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

2025-03-26 Thread Daniel Chen via cfe-commits
DanielCChen wrote: @ldionne I have checked that on AIX, clang uses the configuration from the system include as `-internal-isystem /opt/IBM/openxlCSDK/include/c++/v1`. There is already a test in `aix-toolchain-include.cpp` for that. https://github.com/llvm/llvm-project/pull/132821

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Thinking on this, might just be a very poor interaction between `-lto-partitions` and `-lto-emit-llvm`. Since it splits it up. https://github.com/llvm/llvm-project/pull/128509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread Brian Bi via cfe-commits
@@ -177,3 +177,50 @@ namespace extern_reference_used_as_unknown { int y; constinit int& g = (x,y); // expected-warning {{left operand of comma operator has no effect}} } + +namespace uninit_reference_used { + int y; + constexpr int &r = r; // expected-error {{must be ini

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-26 Thread Baranov Victor via cfe-commits
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() { v2.push_back(NonTrivialWithVector{{0}}); v2.push_back({{0}}); v2.push_back(NonTrivialWithVector{std::vector{0}}); + // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead of push_back

[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

2025-03-26 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor deleted https://github.com/llvm/llvm-project/pull/131969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ARM] Adding diagnostics for mcmodel=tiny when used in invalid targets (PR #125643)

2025-03-26 Thread via cfe-commits
https://github.com/ShashwathiNavada updated https://github.com/llvm/llvm-project/pull/125643 >From 0aebcd7119fbcd51154c5d9706752e8ff3f041bc Mon Sep 17 00:00:00 2001 From: ShashwathiNavada Date: Tue, 4 Feb 2025 00:16:09 -0600 Subject: [PATCH 1/7] Adding diagnostics for unsupported option --- c

[libclc] [libclc] Skip opt command if opt_flags is empty (PR #130882)

2025-03-26 Thread Fraser Cormack via cfe-commits
@@ -342,22 +342,32 @@ function(add_libclc_builtin_set) set( builtins_opt_lib_tgt builtins.opt.${ARG_ARCH_SUFFIX} ) - # Add opt target - add_custom_command( OUTPUT ${builtins_opt_lib_tgt}.bc -COMMAND ${opt_exe} ${ARG_OPT_FLAGS} -o ${builtins_opt_lib_tgt}.bc - ${bu

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

2025-03-26 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > > The codegen for each(virtual) directive should live on codegen. But(!) Sema > > should emit separate (specific) CapturedStmts for each such virtual region. > > Check, how the combined directives work. Sema defines multiple CapturedStmt > > for each combined directive,

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
https://github.com/QuietMisdreavus updated https://github.com/llvm/llvm-project/pull/132297 >From d83501ff207af0b7576e4297132fd8e702bae2c1 Mon Sep 17 00:00:00 2001 From: Vera Mitchell Date: Thu, 20 Mar 2025 10:22:12 -0600 Subject: [PATCH 1/4] collect template argument locs ahead of time to nul

[clang] [MS][clang] Add support for vector deleting destructors (PR #126240)

2025-03-26 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: I reduced main code to ``` #include "unicode/filteredbrk.h" #include using namespace icu; int main(int argc, const char** argv) { UErrorCode status = U_ZERO_ERROR; //BreakIterator* bi = BreakIterator::createWordInstance(root, status); // Any iterator will do, make sure fi

[clang] Fix complex long division with -mno-x87. (PR #133152)

2025-03-26 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam created https://github.com/llvm/llvm-project/pull/133152 None >From 56a000612da3f58928362229a46800c6f077cc71 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Wed, 26 Mar 2025 13:18:36 -0700 Subject: [PATCH] Fix complex long division with -mno-x87. --- clan

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread via cfe-commits
cor3ntin wrote: > > Do you intend to backport this change to 20? > > The weird behavior only shows up if you refer to a reference variable inside > its own initializer, as far as I can tell. Maybe not worth backporting, even > if it is a regression, because people shouldn't be writing code lik

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread Zixu Wang via cfe-commits
https://github.com/zixu-w approved this pull request. https://github.com/llvm/llvm-project/pull/132297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-26 Thread James Y Knight via cfe-commits
jyknight wrote: > We make a VariableArrayType whose element type is a VariableArrayType rather > than a ConstantArrayType of size 7 whose element type is a VariableArrayType. Yea. Up till now I think there was no observable difference between the outer array having a constant or variable boun

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'll clean up the option later as well. `--flto` with double dashes is wrong. https://github.com/llvm/llvm-project/pull/133164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-26 Thread James Y Knight via cfe-commits
https://github.com/jyknight approved this pull request. https://github.com/llvm/llvm-project/pull/133125 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-26 Thread James Y Knight via cfe-commits
@@ -0,0 +1,92 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -std=c2y -emit-llvm -o - %s | FileCheck %s + +// This tests the codegen behavior for _Countof. +// CHECK-LABEL: define dso_local i32 @test1( +

[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-26 Thread Nico Weber via cfe-commits
nico wrote: > Thanks, this will be fixed here: #133113 That also fixes an `Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.` we started seeing after this here landed (repro: https://issues.chromium.org/issues/406497227#comment3) It'd be good if we could either land that

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,61 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * + * Adds an operator to get the length of an array. Note that WG14 N3469 renamed + * this operator to _Countof. + */ + +int gl

[clang] [clang] fix deduction of member pointers with dependent named classes (PR #133113)

2025-03-26 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Note this was unrelated to another regression, as reported here: https://github.com/llvm/llvm-project/pull/132317#issuecomment-2755417893 Since this fixes a regression which recently landed, I am going to go ahead and merge, relying on post-commit review. https://github.com/ll

[clang] [clang] fix deduction of member pointers with dependent named classes (PR #133113)

2025-03-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/133113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
@@ -175,28 +175,30 @@ class ExtractAPIVisitorBase : public RecursiveASTVisitor { SmallVector getBases(const CXXRecordDecl *Decl) { // FIXME: store AccessSpecifier given by inheritance SmallVector Bases; -for (const auto &BaseSpecifier : Decl->bases()) { - //

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > Do you intend to backport this change to 20? The weird behavior only shows up if you refer to a reference variable inside its own initializer, as far as I can tell. Maybe not worth backporting, even if it is a regression, because people shouldn't be writing code like th

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-26 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp commented: LGTM, minor comment/question! https://github.com/llvm/llvm-project/pull/133018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-26 Thread Carlos Galvez via cfe-commits
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { const auto ConstReference = hasType(references(isConstQualified())); carlosgalvezp wrote: On line 86 it appears the author intended to handle "const arrays" in the "pointee

[clang-tools-extra] [clang-tidy][misc-const-correctness] fix fp when using const array type. (PR #133018)

2025-03-26 Thread Carlos Galvez via cfe-commits
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { const auto ConstReference = hasType(references(isConstQualified())); carlosgalvezp wrote: Alternatively we might want to correct/remove the comment https://github.com/llvm/

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Good catch on the VLA test cases @jyknight! It turns out we model VLAs very oddly in the type system. Given: ``` extern int n; int array[7][n]; ``` We make a VariableArrayType whose element type is a VariableArrayType rather than a ConstantArrayType of size 7 whose element t

[clang] [Clang][NFC] Code cleanup in CGBuiltin.cpp (PR #132060)

2025-03-26 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/132060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread Eli Friedman via cfe-commits
@@ -3629,17 +3644,17 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, Result = VD->getEvaluatedValue(); - // C++23 [expr.const]p8 - // ... For such an object that is not usable in constant expressions, the - // dynamic type of the object is constexpr-un

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

2025-03-26 Thread via cfe-commits
SunilKuravinakop wrote: > The codegen for each(virtual) directive should live on codegen. But(!) Sema > should emit separate (specific) CapturedStmts for each such virtual region. > Check, how the combined directives work. Sema defines multiple CapturedStmt > for each combined directive, and t

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-26 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/130755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
@@ -708,6 +711,33 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D, options::OPT_m_amdgpu_Features_Group); } +static unsigned getFullLTOPartitions(const Driver &D, const ArgList &Args) { + const Arg *A = Args.getLastArg(options::OPT_flto_par

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Reverting this patch locally also fixes one of the `libc` tests that was failing, so I'm going to assume they're related. https://github.com/llvm/llvm-project/pull/128509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread Eli Friedman via cfe-commits
@@ -177,3 +177,50 @@ namespace extern_reference_used_as_unknown { int y; constinit int& g = (x,y); // expected-warning {{left operand of comma operator has no effect}} } + +namespace uninit_reference_used { + int y; + constexpr int &r = r; // expected-error {{must be ini

[clang] [PATCH] [clang][frontend] Fix AllocKind retrieving for `CXXConstructorDecl` refs #132794 (PR #133077)

2025-03-26 Thread Paul Schwabauer via cfe-commits
https://github.com/koplas edited https://github.com/llvm/llvm-project/pull/133077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
jhuber6 wrote: I'm thinking this should be default only for HIP (maybe OpenMP later) because the option is HIP only and it confounds attempts to override it by inserting a linker option otherwise. https://github.com/llvm/llvm-project/pull/128509 ___

[clang] Optimize Module Dependency Handling for Efficient Memory Usage (PR #132294)

2025-03-26 Thread Ayush Pareek via cfe-commits
https://github.com/ayushpareek2003 updated https://github.com/llvm/llvm-project/pull/132294 >From 53a31ec6ed3d9ace8e7d822c2b2de4f6f58ece8d Mon Sep 17 00:00:00 2001 From: Ayush Pareek Date: Fri, 21 Mar 2025 03:44:05 +0530 Subject: [PATCH] Optimize Module Dependency Handling for Efficient Memory

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
https://github.com/QuietMisdreavus closed https://github.com/llvm/llvm-project/pull/132297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Add support for NoVirtualDestructorBase. (PR #132497)

2025-03-26 Thread Rashmi Mudduluru via cfe-commits
https://github.com/t-rasmud approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/132497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 49f0607 - [clang][bytecode] Fix union copy/move operator active check (#132238)

2025-03-26 Thread via cfe-commits
Author: Timm Baeder Date: 2025-03-20T19:08:55+01:00 New Revision: 49f06075a6d298bd13564c9bffcf51281bed4962 URL: https://github.com/llvm/llvm-project/commit/49f06075a6d298bd13564c9bffcf51281bed4962 DIFF: https://github.com/llvm/llvm-project/commit/49f06075a6d298bd13564c9bffcf51281bed4962.diff L

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/133100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-26 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/133164 >From 8c8885d486ac72145d7fd7ba003db7ea9ab17a1f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 26 Mar 2025 16:03:20 -0500 Subject: [PATCH 1/3] [Clang] Make `--lto-partitions` only default for HIP Summary

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR] Upstream CmpOp (PR #133159)

2025-03-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. I don't have anything to add on top of Andy's review. LGTM once those comments are addressed. https://github.com/llvm/llvm-project/pull/133159 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-26 Thread Matheus Izvekov via cfe-commits
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint { // We do not actually substitute the parameter mappings into the // constraint expressions, therefore the constraint expressions are // the originals, and comparing them will suffice. -if

[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)

2025-03-26 Thread via cfe-commits
QuietMisdreavus wrote: I rebased the PR to squash the review commits into their respective patches, but then i noticed that i can't do a merge that preserves the individual commits without pushing to `main` directly. 😅 Thanks for the review! https://github.com/llvm/llvm-project/pull/132297 ___

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -52,6 +56,7 @@ else() check_include_file(mach/mach.h HAVE_MACH_MACH_H) check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H) check_include_file(pthread.h HAVE_PTHREAD_H) + check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) rnk wrote: Do we nee

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,115 @@ +//===--- RunOnNewStack.cpp - Crash Recovery ---===// +// +// 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] [alpha.webkit.RawPtrRefMemberChecker] The checker doesn't warn Objective-C types in ivars. (PR #132833)

2025-03-26 Thread Ryosuke Niwa via cfe-commits
@@ -58,3 +59,11 @@ void forceTmplToInstantiate(FooTmpl) {} void forceTmplToInstantiate(RefPtr) {} } + +@interface AnotherObject : NSObject { + NSString *ns_string; + // expected-warning@-1{{Instance variable 'ns_string' in 'AnotherObject' is a raw pointer to retainable ty

[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)

2025-03-26 Thread Alexey Bader via cfe-commits
@@ -229,6 +229,12 @@ class CodeGenTypes { const CGFunctionInfo &arrangeBuiltinFunctionCall(QualType resultType, const CallArgList &args); + /// A SYCL device kernel function is a free standing function with + /// spir_kern

[clang] [RFC][clang] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

2025-03-26 Thread Matheus Izvekov via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)

2025-03-26 Thread Alexey Bader via cfe-commits
https://github.com/bader approved this pull request. https://github.com/llvm/llvm-project/pull/133030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -1117,6 +1118,122 @@ mlir::LogicalResult CIRToLLVMBinOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +mlir::LogicalResult CIRToLLVMBinOpOverflowOpLowering::matchAndRewrite( +cir::BinOpOverflowOp op, OpAdaptor adaptor, +mlir::ConversionPatter

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext, const Expr *e) { static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf, const BinOpInfo &op, bool isSubtraction)

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: I don't see the value of this PR right now. The pointer arithmetic isn't performing the correct arithmetic, and nothing generates the binop.overflow op. It would be more useful to remove the binop.overflow part and add PtrDiffOp. https://github.com/llvm

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext, const Expr *e) { static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf, const BinOpInfo &op, bool isSubtraction)

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext, const Expr *e) { static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf, const BinOpInfo &op, bool isSubtraction)

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/133118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (PR #132821)

2025-03-26 Thread David Tenty via cfe-commits
daltenty wrote: > @ldionne I have checked that on AIX, clang uses the configuration from the > system include as `-internal-isystem /opt/IBM/openxlCSDK/include/c++/v1`. > There is already a test in `aix-toolchain-include.cpp` for that. Yeah, I don't think we implemented the resource directory

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-26 Thread Shilei Tian via cfe-commits
@@ -38,17 +38,3 @@ // RUN: %clang -target amdgcn-amd-amdhsa -march=gfx90a -stdlib -startfiles \ // RUN: -nogpulib -nogpuinc -### %s 2>&1 | FileCheck -check-prefix=STARTUP %s // STARTUP: ld.lld{{.*}}"-lc" "-lm" "{{.*}}crt1.o" - -// Check --flto-partitions - -// RUN: %clang -##

[clang] [libc] [Clang] Make `--lto-partitions` only default for HIP (PR #133164)

2025-03-26 Thread Shilei Tian via cfe-commits
@@ -33,14 +33,8 @@ function(add_startup_object name) set_target_properties(${fq_target_name}.exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR} RUNTIME_OUTPUT_NAME ${name}.o) -# FIXME: A bug in the AMDGPU LTO pass is incorrectly removing the kernels

[clang] [CIR] Add BinOpOverflowOp and basic pointer arithmetic support (PR #133118)

2025-03-26 Thread Andy Kaylor via cfe-commits
@@ -936,8 +936,107 @@ getUnwidenedIntegerType(const ASTContext &astContext, const Expr *e) { static mlir::Value emitPointerArithmetic(CIRGenFunction &cgf, const BinOpInfo &op, bool isSubtraction)

[clang] [clang-cl] Accept the --warning-suppression-mappings= option (PR #133092)

2025-03-26 Thread Nico Weber via cfe-commits
https://github.com/nico approved this pull request. https://github.com/llvm/llvm-project/pull/133092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Accept the --warning-suppression-mappings= option (PR #133092)

2025-03-26 Thread Nico Weber via cfe-commits
https://github.com/nico closed https://github.com/llvm/llvm-project/pull/133092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-03-26 Thread Joseph Huber via cfe-commits
@@ -1393,6 +1393,8 @@ def fhip_emit_relocatable : Flag<["-"], "fhip-emit-relocatable">, HelpText<"Compile HIP source to relocatable">; def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">, HelpText<"Do not override toolchain to compile HIP source to reloc

[clang-tools-extra] [llvm] clangd: Add a build option to disable building dexp (PR #133124)

2025-03-26 Thread Yoann Congal via cfe-commits
@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@" config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.." config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.." config.clangd_build_xpc = @CLANGD_BUILD_XPC@ +config.clangd_build_dexp = @CLANGD_BUILD_DEXP@

[clang-tools-extra] [llvm] clangd: Add a build option to disable building dexp (PR #133124)

2025-03-26 Thread Yoann Congal via cfe-commits
https://github.com/ycongal-smile converted_to_draft https://github.com/llvm/llvm-project/pull/133124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cuda clang: Add support for CUDA surfaces (PR #132883)

2025-03-26 Thread Artem Belevich via cfe-commits
Artem-B wrote: > > LGTM in principle, but it could use some tests. The change is surprisingly > > nicely compact. Thank you for filling in one of the long-standing gaps in > > clang's cuda support story. > > I might need some hints on where to start. How would you go about testing > this, or

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-26 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck should we check CMAKE_VERSION and use DEPENDS_EXPLICIT_ONLY if the version is 3.27 or higher? I suppose DEPENDS_EXPLICIT_ONLY would be more light-weighted. And we need to keep both DEPENDS_EXPLICIT_ONLY and adding new target path, until llvm uplifts cmake version t

[clang] [llvm] [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #133173)

2025-03-26 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 bfe85230e2dc27493b82ffba5a46c8f7449a6e10 bfd36727df42b6bc95468e84a74efbbff968e7aa --e

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-26 Thread Imad Aldij via cfe-commits
@@ -32,6 +32,26 @@ enum E2 : S::I { e }; #endif } // namespace cwg2516 +namespace cwg2517 { // cwg2517: 21 +#if __cplusplus >= 202302L imdj wrote: Ok, so it's often based on when the issue was first introduced. Thanks for clearing my misunderstanding. https

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-03-26 Thread Jonas Hahnfeld via cfe-commits
https://github.com/hahnjo created https://github.com/llvm/llvm-project/pull/133057 * Hash inner template arguments: The code is applied from `ODRHash::AddDecl` with the reasoning given in the comment, to reduce collisions. This was particularly visible with STL types templated on `std::pair`

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Ryotaro Kasuga via cfe-commits
@@ -227,36 +226,26 @@ void for_test_scalable_1(int *List, int Length) { // CHECK: ![[LOOP_5]] = distinct !{![[LOOP_5]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_1:.*]]} // CHECK: ![[WIDTH_1]] = !{!"llvm.loop.vectorize.width", i32 1} -// CHECK: ![[LOOP_6]]

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jonas Hahnfeld (hahnjo) Changes * Hash inner template arguments: The code is applied from `ODRHash::AddDecl` with the reasoning given in the comment, to reduce collisions. This was particularly visible with STL types templated on `std::p

[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

2025-03-26 Thread via cfe-commits
@@ -177,3 +177,50 @@ namespace extern_reference_used_as_unknown { int y; constinit int& g = (x,y); // expected-warning {{left operand of comma operator has no effect}} } + +namespace uninit_reference_used { + int y; + constexpr int &r = r; // expected-error {{must be ini

[clang] [Clang][Driver] Override complex number calculation method by -fno-fa… (PR #132680)

2025-03-26 Thread via cfe-commits
https://github.com/s-watanabe314 updated https://github.com/llvm/llvm-project/pull/132680 >From 9265cb96cc3129fada722d7195a1cf04e985ba33 Mon Sep 17 00:00:00 2001 From: s-watanabe314 Date: Fri, 14 Mar 2025 11:56:32 +0900 Subject: [PATCH 1/2] [Clang][Driver] Override complex number calculation m

[clang] [flang] [llvm] [Clang][AMDGPU] Expose buffer load lds as a clang builtin (PR #132048)

2025-03-26 Thread Juan Manuel Martinez Caamaño via cfe-commits
https://github.com/jmmartinez updated https://github.com/llvm/llvm-project/pull/132048 From eae04b28a010045bdd7fcd03f84c952abeed3ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Martinez=20Caama=C3=B1o?= Date: Thu, 20 Mar 2025 13:23:25 +0100 Subject: [PATCH 1/2] [AMDGPU] Add "lds-bu

[clang] [flang] [llvm] [AMDGPU] Add "lds-buffer-load-insts" attribute for all targets < gfx11 (PR #133055)

2025-03-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-clang Author: Juan Manuel Martinez Caamaño (jmmartinez) Changes This are used to restrict the availability of buffer_load_lds intrinsics to targets that actually have this instructions. --- Full diff: https://github.

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/132765 From f0ac1f6c223b3bfce25ba0183ba1aa2825c455ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Mon, 24 Mar 2025 16:58:31 +0100 Subject: [PATCH 1/3] [NFC][analyzer] Add testcase to highlight G

[clang] [analyzer] Fix format attribute handling in GenericTaintChecker (PR #132765)

2025-03-26 Thread Donát Nagy via cfe-commits
@@ -161,3 +161,45 @@ void top() { clang_analyzer_isTainted(A.data); // expected-warning {{YES}} } } // namespace gh114270 + + +namespace format_attribute { +__attribute__((__format__ (__printf__, 1, 2))) +void log_nonmethod(const char *fmt, ...); + +void test_format_attribute

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] 1a7402d - [NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via `--offload-arch` (#133024)

2025-03-26 Thread via cfe-commits
Author: Alex Voicu Date: 2025-03-26T10:06:21Z New Revision: 1a7402d3d831940fc04cc0fb5731239744ce5435 URL: https://github.com/llvm/llvm-project/commit/1a7402d3d831940fc04cc0fb5731239744ce5435 DIFF: https://github.com/llvm/llvm-project/commit/1a7402d3d831940fc04cc0fb5731239744ce5435.diff LOG: [N

[clang] [NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via `--offload-arch` (PR #133024)

2025-03-26 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx closed https://github.com/llvm/llvm-project/pull/133024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObjectChecker (PR #132427)

2025-03-26 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > > My proposal is to judge the current `FieldDecl` at the beginning of the > > loop, and if it's a UnamedBitField, just skip it, because at that point the > > UnamedBitField's static check should be passing. If it's a NamedBitField > > then it needs to be initialized to pass th

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-03-26 Thread Jonas Hahnfeld via cfe-commits
hahnjo wrote: ### Performance measurements with LLVM I tested these patches for building LLVM itself with modules (`LLVM_ENABLE_MODULES=ON`). To work around https://github.com/llvm/llvm-project/issues/130795, I apply https://github.com/llvm/llvm-project/pull/131354 before building Clang. In

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
@@ -620,6 +684,28 @@ mlir::LogicalResult CIRToLLVMStoreOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +/// Switches on the type of attribute and calls the appropriate conversion. +mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, +

[clang-tools-extra] [clang-doc] Avoid deref of invalid std::optional (PR #131939)

2025-03-26 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/131939 >From b1653a1167f9923d1266d2971773d585251109a1 Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 18 Mar 2025 23:38:09 + Subject: [PATCH] [clang-doc] Avoid deref of invalid std::optional Since our existin

[clang] 6ff3906 - [clang][bytecode] Print more info in Block::dump() (#133062)

2025-03-26 Thread via cfe-commits
Author: Timm Baeder Date: 2025-03-26T12:25:14+01:00 New Revision: 6ff3906936e036cb2a4c07baa61b3939fd57e846 URL: https://github.com/llvm/llvm-project/commit/6ff3906936e036cb2a4c07baa61b3939fd57e846 DIFF: https://github.com/llvm/llvm-project/commit/6ff3906936e036cb2a4c07baa61b3939fd57e846.diff L

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
@@ -0,0 +1,150 @@ +//- LoweringHelpers.cpp - Lowering helper functions ---===// +// +// 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][bytecode] Print more info in Block::dump() (PR #133062)

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

<    1   2   3   4   5   6   >