[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @wenju-he https://github.com/llvm/llvm-project/pull/137183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137183 This commit provides definitions of builtins with the generic address space. It is assumed that all current libclc targets can support the generic address space. One concept to consider is the difference b

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -6496,6 +6496,17 @@ static bool canPerformArrayCopy(const InitializedEntity &Entity) { return false; } +static const FieldDecl *GetConstField(const RecordDecl *RD) { AaronBallman wrote: C has no base classes, so nope! https://github.com/llvm/llvm-proje

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-04-24 Thread Fangyi Zhou via cfe-commits
@@ -2463,19 +2473,19 @@ void CStringChecker::evalStrsep(CheckerContext &C, // character to NUL. // As the replacement never overflows, do not invalidate its super region. State = invalidateDestinationBufferNeverOverflows( -C, State, SearchStrPtr.Expression,

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -6496,6 +6496,17 @@ static bool canPerformArrayCopy(const InitializedEntity &Entity) { return false; } +static const FieldDecl *GetConstField(const RecordDecl *RD) { erichkeane wrote: ```suggestion static const FieldDecl *getConstField(const RecordDecl

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 1f7205615f8d11c1b58e2a2760f85663f97767c5 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/3] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -760,8 +787,10 @@ std::unique_ptr Interpreter::GenModule() { return nullptr; } -CodeGenerator *Interpreter::getCodeGen() const { - FrontendAction *WrappedAct = Act->getWrapped(); +CodeGenerator *Interpreter::getCodeGen(IncrementalAction *Action) const { + if (!Action) +

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/118480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Younan Zhang via cfe-commits
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +if (FunctionDecl *FD = +dyn_cast_if_present(FnD->getPreviousDecl())) { + if (isa(FD->getLexicalDeclContext()) || + Actions.getDefaultedFunctionKind

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -560,6 +576,16 @@ Interpreter::Parse(llvm::StringRef Code) { llvm::Expected DeviceTU = DeviceParser->Parse(Code); if (auto E = DeviceTU.takeError()) return std::move(E); + +RegisterPTU(*DeviceTU, nullptr, DeviceAct.get()); + +llvm::Expected PTX = Device

[clang] [ARM] enable FENV_ACCESS pragma support for hard-float targets (PR #137101)

2025-04-24 Thread David Green via cfe-commits
davemgreen wrote: I believe the backend would still need work to make sure this is supported, which has not been done yet. I was expecting it to fail more noisily, but it appears the strict nodes are lowered to generic nodes. That doesn't mean that strict-fp is supported by the Arm backend, as

[clang] [flang] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-24 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: There is precedent for changing the clang source in order to share code or to augment it for use with flang. For what needs to be done here, I think it should be fine. We will have to request reviews from the clang developers as well. https://github.com/llvm/llvm-project/pu

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -609,8 +609,8 @@ def ConditionOp : CIR_Op<"condition", [ //===--===// def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator, - ParentOneOf<["IfOp", "ScopeOp", "WhileOp", -

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -3489,6 +3489,11 @@ class CompoundLiteralExpr : public Expr { /// The int part of the pair stores whether this expr is file scope. llvm::PointerIntPair TInfoAndScope; Stmt *Init; + + /// Value of constant literals with static storage duration. Used only for + /// con

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Vassil Vassilev via cfe-commits
@@ -760,8 +787,10 @@ std::unique_ptr Interpreter::GenModule() { return nullptr; } -CodeGenerator *Interpreter::getCodeGen() const { - FrontendAction *WrappedAct = Act->getWrapped(); +CodeGenerator *Interpreter::getCodeGen(IncrementalAction *Action) const { + if (!Action) +

[clang] [llvm] [RISCV] Add support for Ziccamoc (PR #136694)

2025-04-24 Thread via cfe-commits
https://github.com/T-Tie updated https://github.com/llvm/llvm-project/pull/136694 >From e98beadf0009fa05339b964780e4dfe7c444fdd9 Mon Sep 17 00:00:00 2001 From: Tie Date: Tue, 22 Apr 2025 12:25:32 + Subject: [PATCH 1/2] Add Support for Ziccamoc --- clang/test/Preprocessor/riscv-target-feat

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Vassil Vassilev via cfe-commits
@@ -50,25 +50,6 @@ IncrementalCUDADeviceParser::Parse(llvm::StringRef Input) { if (!PTU) return PTU.takeError(); - auto PTX = GeneratePTX(); vgvassilev wrote: If this code moved, can't we rely on the base class implementation of `Parse` here? https:/

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Alex Voicu via cfe-commits
@@ -1217,11 +1217,13 @@ void CGOpenMPRuntimeGPU::emitParallelCall(CodeGenFunction &CGF, CGBuilderTy &Bld = CGF.Builder; llvm::Value *NumThreadsVal = NumThreads; llvm::Function *WFn = WrapperFunctionsMap[OutlinedFn]; +llvm::FunctionCallee RuntimeFn = OMPBuilder.

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-04-24 Thread Balazs Benics via cfe-commits
@@ -2556,10 +2556,19 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, const Stmt *Term = nodeBuilder.getContext().getBlock()->getTerminatorStmt(); if (!isa_and_nonnull(Term)) return; + +// FIXME: steakhal wrote: Now thinking

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Morris Hafner via cfe-commits
@@ -609,8 +609,8 @@ def ConditionOp : CIR_Op<"condition", [ //===--===// def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator, - ParentOneOf<["IfOp", "ScopeOp", "WhileOp", -

[clang] 9ae7aa7 - [clang][bytecode] Diagnose comparing pointers to fields... (#137159)

2025-04-24 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-24T17:04:36+02:00 New Revision: 9ae7aa79b1e151c3af12b9ffec0e2fdeacde5cc9 URL: https://github.com/llvm/llvm-project/commit/9ae7aa79b1e151c3af12b9ffec0e2fdeacde5cc9 DIFF: https://github.com/llvm/llvm-project/commit/9ae7aa79b1e151c3af12b9ffec0e2fdeacde5cc9.diff L

[clang] [clang][bytecode] Diagnose comparing pointers to fields... (PR #137159)

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

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Morris Hafner via cfe-commits
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure, }]; } +//===--===// +// TernaryOp +//===--===// + +def TernaryOp : CIR_Op<"te

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread Balazs Benics via cfe-commits
@@ -209,6 +209,12 @@ class SValBuilder { const LocationContext *LCtx, QualType type, unsigned visitCount); + DefinedOrUnknownSVal conjureSymbolVal(const Call

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Nick Sarnie via cfe-commits
@@ -1217,11 +1217,13 @@ void CGOpenMPRuntimeGPU::emitParallelCall(CodeGenFunction &CGF, CGBuilderTy &Bld = CGF.Builder; llvm::Value *NumThreadsVal = NumThreads; llvm::Function *WFn = WrapperFunctionsMap[OutlinedFn]; +llvm::FunctionCallee RuntimeFn = OMPBuilder.

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread Balazs Benics via cfe-commits
@@ -209,6 +209,12 @@ class SValBuilder { const LocationContext *LCtx, QualType type, unsigned visitCount); + DefinedOrUnknownSVal conjureSymbolVal(const Call

[clang] [CIR] Upstream TernaryOp (PR #137184)

2025-04-24 Thread Erich Keane via cfe-commits
@@ -1246,6 +1246,59 @@ def SelectOp : CIR_Op<"select", [Pure, }]; } +//===--===// +// TernaryOp +//===--===// + +def TernaryOp : CIR_Op<"te

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-04-24 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > A naive question from someone who is not familiar with this area: Is any of > this stuff usable with anything but a matching version of clang? If no, can > we place these things in the clang resource directory, where the other > version-bound runtimes live? It's not intended,

[clang] Remove duplicate API (PR #132776)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/132776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 87ca1f6992d1413d1d2b2e0d230b4f41e1979fef Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH] Fix cuda flag with clang-repl --- clang/include/clang/Interpre

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +if (FunctionDecl *FD = +dyn_cast_if_present(FnD->getPreviousDecl())) { + if (isa(FD->getLexicalDeclContext()) || + Actions.getDefaultedFunctionKind

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Alex Voicu via cfe-commits
@@ -1217,11 +1217,13 @@ void CGOpenMPRuntimeGPU::emitParallelCall(CodeGenFunction &CGF, CGBuilderTy &Bld = CGF.Builder; llvm::Value *NumThreadsVal = NumThreads; llvm::Function *WFn = WrapperFunctionsMap[OutlinedFn]; +llvm::FunctionCallee RuntimeFn = OMPBuilder.

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix AS of globals and set the default AS to 4 (PR #135251)

2025-04-24 Thread Alex Voicu via cfe-commits
AlexVlx wrote: Overall this seems a bit AS cast heavy in the OMP parts, I wonder if we have a chance to figure out if we cannot just emit things in the right ASes from the get-go? This is the path we took when cleaning up some of this stuff in Clang for C/C++, and whilst it was definitely more

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -28,20 +28,21 @@ IncrementalCUDADeviceParser::IncrementalCUDADeviceParser( std::unique_ptr DeviceInstance, CompilerInstance &HostInstance, llvm::IntrusiveRefCntPtr FS, -llvm::Error &Err, const std::list &PTUs) +llvm::Error &Err, std::list &PTUs) : In

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Balázs Benics via cfe-commits
@@ -0,0 +1,198 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify=expected,default %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config legacy-inlining-prevention=false -verify=expected,disabled %s + +int get

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/137166 Unlike C++, C allows the definition of an uninitialized `const` object. If the object has static or thread storage duration, it is still zero-initialized, otherwise, the object is left uninitialized. In ei

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in { // The CIRCallOpInterface must be used instead of CallOpInterface when looking // at arguments and other bits of CallOp. This creates a level of abstraction // that's useful for handling indirect calls and other details.

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -28,20 +28,21 @@ IncrementalCUDADeviceParser::IncrementalCUDADeviceParser( std::unique_ptr DeviceInstance, CompilerInstance &HostInstance, llvm::IntrusiveRefCntPtr FS, -llvm::Error &Err, const std::list &PTUs) anutosh491 wrote: Thanks for po

[clang] [clang][SPIR-V] Addrspace of opencl_global should always be 1 (PR #136753)

2025-04-24 Thread Dmitry Sidorov via cfe-commits
https://github.com/MrSidims approved this pull request. https://github.com/llvm/llvm-project/pull/136753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM] enable FENV_ACCESS pragma support for hard-float targets (PR #137101)

2025-04-24 Thread John Brawn via cfe-commits
john-brawn-arm wrote: It's been several years since I looked at this, but from my notes what's needed before setting HasStrictFP=true is: - Instruction selection patterns for strict fp ops. This is probably just changing e.g. "fadd" to "any_fadd" as I expect for most or all of the instruction

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Vassil Vassilev via cfe-commits
@@ -28,20 +28,21 @@ IncrementalCUDADeviceParser::IncrementalCUDADeviceParser( std::unique_ptr DeviceInstance, CompilerInstance &HostInstance, llvm::IntrusiveRefCntPtr FS, -llvm::Error &Err, const std::list &PTUs) +llvm::Error &Err, std::list &PTUs) : In

[clang] [clang] Enable making the module build stack thread-safe (PR #137059)

2025-04-24 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida approved this pull request. https://github.com/llvm/llvm-project/pull/137059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
@@ -28,20 +28,21 @@ IncrementalCUDADeviceParser::IncrementalCUDADeviceParser( std::unique_ptr DeviceInstance, CompilerInstance &HostInstance, llvm::IntrusiveRefCntPtr FS, -llvm::Error &Err, const std::list &PTUs) +llvm::Error &Err, std::list &PTUs) : In

[clang] [clang-repl] : Fix clang-repl crash with --cuda flag (PR #136404)

2025-04-24 Thread Anutosh Bhat via cfe-commits
https://github.com/anutosh491 updated https://github.com/llvm/llvm-project/pull/136404 >From 6c64e64c4a3b56f50808cae244b29da1231525f1 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Fri, 18 Apr 2025 18:45:00 +0530 Subject: [PATCH 1/2] Fix cuda flag with clang-repl --- clang/include/clang/Inte

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -753,6 +755,225 @@ def ScopeOp : CIR_Op<"scope", [ ]; } +//===--===// +// SwitchOp +//===--===// + +def CaseOpKind_DT : I32EnumAttrCase<

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. Also avoids typed pointer IR https://github.com/llvm/llvm-project/pull/137181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)

2025-04-24 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I tested the impact of this commit on various open source projects and the changes in the result counts are surprisingly small: | Project | New Reports | Resolved Reports | |-|-|--| | memcached | 0 new reports | 0 resolved reports | tmux | 2

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

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

[clang] Upstream enum support (PR #136807)

2025-04-24 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I would also want to see tests that show uses of an enum, as well as fixed > > underlying type, scoped enums/etc. > > Going to wait to confirm I did the "fixed underlying type" part first. > > If you have more specific enum use cases that we should test for, please let >

[libclc] 139e30e - [libclc] Remove (vload|vstore)_half helpers (#137181)

2025-04-24 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-04-24T15:08:05+01:00 New Revision: 139e30e2158dcb83db82e59df6ec48894eac0129 URL: https://github.com/llvm/llvm-project/commit/139e30e2158dcb83db82e59df6ec48894eac0129 DIFF: https://github.com/llvm/llvm-project/commit/139e30e2158dcb83db82e59df6ec48894eac0129.diff

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-04-24 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet updated https://github.com/llvm/llvm-project/pull/118480 From 9a3ddb6ca0805f238042f0b795de93066f386e08 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Tue, 3 Dec 2024 11:21:44 +0100 Subject: [PATCH] [clang] Fix a use-after-free in expression evaluation followin

[clang] Reland [clang] Handle instantiated members to determine visibility (#136128) (PR #136689)

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

[clang] [ARM] enable FENV_ACCESS pragma support for hard-float targets (PR #137101)

2025-04-24 Thread John Brawn via cfe-commits
john-brawn-arm wrote: Simple example where setting HasStrictFP=true without doing the above gives wrong results: ``` int fetestexcept( int excepts ); #define FE_DIVBYZERO 0x04 int fn(float x) { #pragma STDC FENV_ACCESS ON x / 0; return fetestexcept(FE_DIVBYZERO); } ``` With --target=aarch64

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +if (FunctionDecl *FD = +dyn_cast_if_present(FnD->getPreviousDecl())) { + if (isa(FD->getLexicalDeclContext()) || + Actions.getDefaultedFunctionKind

[clang] [CIR] Upstream support for name mangling (PR #137094)

2025-04-24 Thread Andy Kaylor via cfe-commits
@@ -639,13 +674,82 @@ cir::FuncOp CIRGenModule::getAddrOfFunction(clang::GlobalDecl gd, funcType = convertType(fd->getType()); } - assert(!cir::MissingFeatures::mangledNames()); - cir::FuncOp func = getOrCreateCIRFunction( - cast(gd.getDecl())->getIdentifier()->g

[clang] [OpenACC][CIR] Implement 'num_gangs' lowering (PR #137216)

2025-04-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/137216 >From f24d90d1f5882d008a19a8f48da8f25e4bae1d21 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 24 Apr 2025 10:10:43 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Implement 'num_gangs' lowering This is simil

[clang] clang/HIP: Add tests that shows fpmath metadata ends up on sqrt calls (PR #136413)

2025-04-24 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/136413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement address sanitizer on AIX (1/n) (PR #129925)

2025-04-24 Thread Jake Egan via cfe-commits
https://github.com/jakeegan updated https://github.com/llvm/llvm-project/pull/129925 >From 072f4eca3825729d69d423d774c8a3298cb624a8 Mon Sep 17 00:00:00 2001 From: Jake Egan Date: Wed, 5 Mar 2025 01:57:38 -0500 Subject: [PATCH 1/3] [clang] Implement address sanitizer on AIX (1/3) The PR include

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137181 These were only being used when compiling with versions of clang older than clang 6. As such they were essentially unsuppored and untested. This somewhat simplifies the codebase, producing fewer helper func

[clang] clang/HIP: Add tests that shows fpmath metadata ends up on sqrt calls (PR #136413)

2025-04-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/136413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure correct copying of records with authenticated fields (PR #136783)

2025-04-24 Thread Oliver Hunt via cfe-commits
@@ -103,3 +103,46 @@ static_assert(_Generic(typeof(overload_func(&ptr0)), int : 1, default : 0)); static_assert(_Generic(typeof(overload_func(&valid0)), float : 1, default : 0)); void func(int array[__ptrauth(VALID_DATA_KEY) 10]); // expected-error {{'__ptrauth' qualifier o

[clang] [clang][analyzer][NFC] Add a helper for conjuring symbols at call events (PR #137182)

2025-04-24 Thread Fangyi Zhou via cfe-commits
https://github.com/fangyi-zhou updated https://github.com/llvm/llvm-project/pull/137182 >From 79e5875e75d46edcf15c5df536ac8f1d93e13a16 Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Thu, 24 Apr 2025 15:12:12 +0100 Subject: [PATCH 1/2] [clang][analyzer][NFC] Add a helper for conjuring symbols

[clang] [CIR] Upstream support for Variable length Array (PR #137233)

2025-04-24 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: This is a WIP patch for VLA support. When I moved the emitting StackOps to be before lowering and created `OpRewritePattern` for `AllocaOp`, that means that Dead code elimination will be performed for each AllocaOp and in our test files, We can't test unused variables and

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137234 >From 56a3f3cd282e9bd5ef9014e4125380e0d9685121 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 24 Apr 2025 14:17:42 -0400 Subject: [PATCH 1/3] [C] Diagnose use of C++ keywords in C This adds a new

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes This adds a new diagnostic group, -Widentifier-is-c++-keyword, which is off by default and grouped under -Wc++-compat. The diagnostic catches use of C++ keywords in C code. This change additionally fi

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 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 HEAD~1 HEAD --extensions cpp,c,h -- clang/test/Sema/c++-keyword-in-c.c clang/include/

[clang] [clang][ARM][AArch64] Don't require arm_acle header for universally defined intrinsics (PR #136742)

2025-04-24 Thread Nick Sarnie via cfe-commits
sarnex wrote: Thanks, let me know what you find! I'll probably revert the original patch tomorrow to fix the regression and then rework it with the fix. https://github.com/llvm/llvm-project/pull/136742 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-24 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/135878 >From 115b4f8e6276c4dd19e66136a5ad01b6b22f7586 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Mon, 7 Apr 2025 14:46:07 -0700 Subject: [PATCH 1/5] create int_spv_faceforward intrinsic, create faceforward lowering &

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-24 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/135878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/137234 This adds a new diagnostic group, -Widentifier-is-c++-keyword, which is off by default and grouped under -Wc++-compat. The diagnostic catches use of C++ keywords in C code. This change additionally fixes

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-24 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/135878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

2025-04-24 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/135878 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-04-24 Thread Fangyi Zhou via cfe-commits
@@ -2556,10 +2556,19 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, const Stmt *Term = nodeBuilder.getContext().getBlock()->getTerminatorStmt(); if (!isa_and_nonnull(Term)) return; + +// FIXME: fangyi-zhou wrote: Fair enoug

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2025-04-24 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > This change makes Clang produce warnings when building Clang itself; warnings > looking like this: > That was the entire point of this warning. As far as I know clang+llvm is the only project to use preferred_type (instead of just using enum typed bitfields), but as a result

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Note, I'm running this one through llvm-compile-time-tracker because of the lookup happening on every identifier. I'm not convinced that the "is this identifier a keyword in other language modes" code has good performance and wanted to double-check. https://github.com/llvm

[clang] [clang][ARM][AArch64] Don't require arm_acle header for universally defined intrinsics (PR #136742)

2025-04-24 Thread Reid Kleckner via cfe-commits
rnk wrote: Sure, but winnt.h declares and uses tons of x86 intrinsics already, and we have a way to make this work. Let me go look at what we did for `_m_prefetchw` and see if we can apply that here. We want to do something similar to a default-error-warning, where system headers like winnt.h

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Maybe `-Wkeyword-in-c++` or `-Wc++-keyword` would be a more concise name for the group? https://github.com/llvm/llvm-project/pull/137234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137234 >From 56a3f3cd282e9bd5ef9014e4125380e0d9685121 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 24 Apr 2025 14:17:42 -0400 Subject: [PATCH 1/4] [C] Diagnose use of C++ keywords in C This adds a new

[clang] [Driver][CFI] Allow CFI with minimal runtime (PR #137103)

2025-04-24 Thread Florian Mayer via cfe-commits
https://github.com/fmayer approved this pull request. https://github.com/llvm/llvm-project/pull/137103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Maybe `-Wkeyword-in-c++` or `-Wc++-keyword` would be a more concise name for > the group? I'm not tied to the name I picked, so either of these is fine by me. GCC doesn't split this into its own warning group, so we've got some latitude. Any strong preferences? https://

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
arsenm wrote: > It is actually [supported in the Itanium > mangler](https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/ItaniumMangle.cpp#L2786): I don't remember this part of the hack. There was a recent fix to always use the correct mapping values for AMDGPU when generic address spa

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
@@ -420,12 +420,37 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) -D${CLC_TARGET_DEFINE} # All libclc builtin libraries see CLC headers -I${CMAKE_CURRENT_SOURCE_DIR}/clc/include + # Error on undefined macros + -Werror=undef ) if( NOT "${cpu}"

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-24 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > Maybe `-Wkeyword-in-c++` or `-Wc++-keyword` would be a more concise name > > for the group? > > I'm not tied to the name I picked, so either of these is fine by me. GCC > doesn't split this into its own warning group, so we've got some latitude. > > Any strong preference

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
@@ -23,4 +23,20 @@ #define _CLC_DEF __attribute__((always_inline)) #endif +#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 || \ +(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ + defined(__opencl_c_generic_addr

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Matt Arsenault via cfe-commits
@@ -12,3 +12,7 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, local __CLC_INTN *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
@@ -6496,6 +6496,17 @@ static bool canPerformArrayCopy(const InitializedEntity &Entity) { return false; } +static const FieldDecl *GetConstField(const RecordDecl *RD) { AaronBallman wrote: No assertion is possible, `CXXRecordDecl` has bases, `RecordDecl` d

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137166 >From bb184fc38d13126f244615425cfefe7368ca71b8 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 23 Apr 2025 13:40:44 -0400 Subject: [PATCH 1/7] Add -Wdefault-const-init --- clang/docs/ReleaseNotes.

[clang] [C] Warn on uninitialized const objects (PR #137166)

2025-04-24 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/137166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for name mangling (PR #137094)

2025-04-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/137094 >From 8268f7f56d522af6d6f4d1becc8c12b4c049b235 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 23 Apr 2025 17:10:05 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for name mangling We have been usin

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-24 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu closed https://github.com/llvm/llvm-project/pull/136773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Adding an API to create a `CXStringSet` from a Vector of `StringRef`s (PR #136773)

2025-04-24 Thread Qiongsi Wu via cfe-commits
qiongsiwu wrote: Closing this PR since we will have the changes in https://github.com/swiftlang/llvm-project/pull/10524. https://github.com/llvm/llvm-project/pull/136773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [CIR] Upstream enum support (PR #136807)

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

[clang] [OpenACC][CIR] Implement 'num_gangs' lowering (PR #137216)

2025-04-24 Thread Andy Kaylor via cfe-commits
@@ -95,19 +95,41 @@ class OpenACCClauseCIREmitter final .CaseLower("radeon", mlir::acc::DeviceType::Radeon); } - // Handle a clause affected by the 'device-type' to the point that they need - // to have the attributes added in the correct/corresponding order, such

[clang] [NFC][CFI] Add tests for different reporting settings (PR #137225)

2025-04-24 Thread Thurston Dang via cfe-commits
@@ -0,0 +1,188 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o

[clang] 5b16941 - [clang] Ensure correct copying of records with authenticated fields (#136783)

2025-04-24 Thread via cfe-commits
Author: Oliver Hunt Date: 2025-04-24T16:22:50-07:00 New Revision: 5b16941f5707c3a326b688e0954f8882d8a36951 URL: https://github.com/llvm/llvm-project/commit/5b16941f5707c3a326b688e0954f8882d8a36951 DIFF: https://github.com/llvm/llvm-project/commit/5b16941f5707c3a326b688e0954f8882d8a36951.diff L

[clang] [clang] Ensure correct copying of records with authenticated fields (PR #136783)

2025-04-24 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt closed https://github.com/llvm/llvm-project/pull/136783 ___ 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   >