[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
@@ -314,53 +316,69 @@ class APValue { DataType Data; public: - APValue() : Kind(None) {} - explicit APValue(APSInt I) : Kind(None) { + bool allowConstexprUnknown() const { return AllowConstexprUnknown; } + + void setConstexprUnknown() { AllowConstexprUnknown = true; } +

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
@@ -3300,6 +3308,11 @@ static bool HandleLValueComplexElement(EvalInfo &Info, const Expr *E, static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Versio

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
@@ -8595,7 +8643,10 @@ bool LValueExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) { bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) { - + // P2280R4 if we are in C++23 track if we have an unknown reference or + // pointer. + bool AllowConste

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread via cfe-commits
@@ -314,53 +316,69 @@ class APValue { DataType Data; public: - APValue() : Kind(None) {} - explicit APValue(APSInt I) : Kind(None) { + bool allowConstexprUnknown() const { return AllowConstexprUnknown; } + + void setConstexprUnknown() { AllowConstexprUnknown = true; } --

[clang] [AArch64] Extend SVE diagnostics. (PR #94976)

2024-06-14 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm approved this pull request. Thanks for fixing this, Clang shouldn't trigger an assertion failure. I also agree that changing the diagnostic location is an improvement. https://github.com/llvm/llvm-project/pull/94976 __

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -60,9 +60,14 @@ #include "llvm/Support/ScopedPrinter.h" #include "llvm/TargetParser/AArch64TargetParser.h" #include "llvm/TargetParser/X86TargetParser.h" +#include #include #include + + +#include huixie90 wrote: changing it to llvm::dbgs() now. will

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
https://github.com/huixie90 edited https://github.com/llvm/llvm-project/pull/75371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm edited https://github.com/llvm/llvm-project/pull/95519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Tomas Matheson via cfe-commits
@@ -13725,12 +13725,10 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, // Make a copy of the features as passed on the command line into the // beginning of the additional features from the function to override. -// AArch64 handles command l

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Tomas Matheson via cfe-commits
https://github.com/tmatheson-arm requested changes to this pull request. https://github.com/llvm/llvm-project/pull/95519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2456,6 +2461,139 @@ static RValue EmitHipStdParUnsupportedBuiltin(CodeGenFunction *CGF, return RValue::get(CGF->Builder.CreateCall(UBF, Args)); } +template +void RecursivelyClearPaddingImpl(CodeGenFunction &CGF, Value *Ptr, QualType Ty, size_t CurrentStartOffset, size

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2327,6 +2327,25 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, } case Builtin::BI__builtin_launder: return SemaBuiltinLaunder(*this, TheCall); + case Builtin::BI__builtin_clear_padding: { +const Expr *PtrArg = TheCall->getArg(0)->Ig

[clang] [Clang] Remove preprocessor guards and global feature checks for NEON (PR #95224)

2024-06-14 Thread Maciej Gabka via cfe-commits
@@ -1,7 +1,8 @@ -// RUN: %clang_cc1 %s -triple armv7 -fsyntax-only -verify -// RUN: %clang_cc1 %s -triple aarch64 -fsyntax-only -verify -// RUN: %clang_cc1 %s -triple aarch64 -target-feature -fp-armv8 -target-abi aapcs-soft -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple arm

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/95519 >From 66b4dcd6d074c700346b405c48c7ff608122ae8d Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Fri, 14 Jun 2024 08:46:12 +0100 Subject: [PATCH 1/3] Reland "[AArch64] Decouple feature dependency expans

[clang] [llvm] Parse target attribute (PR #95519)

2024-06-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea edited https://github.com/llvm/llvm-project/pull/95519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[AArch64] Decouple feature dependency expansion. (#94279)" (PR #95519)

2024-06-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea edited https://github.com/llvm/llvm-project/pull/95519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reland "[AArch64] Decouple feature dependency expansion. (#94279)" (PR #95519)

2024-06-14 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/95519 >From 66b4dcd6d074c700346b405c48c7ff608122ae8d Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Fri, 14 Jun 2024 08:46:12 +0100 Subject: [PATCH 1/4] Reland "[AArch64] Decouple feature dependency expans

[clang] ad702e0 - [AArch64] Extend SVE diagnostics. (#94976)

2024-06-14 Thread via cfe-commits
Author: Harald van Dijk Date: 2024-06-14T12:56:11+01:00 New Revision: ad702e057cf7fc1ffdc0f78f563b416170ea7d57 URL: https://github.com/llvm/llvm-project/commit/ad702e057cf7fc1ffdc0f78f563b416170ea7d57 DIFF: https://github.com/llvm/llvm-project/commit/ad702e057cf7fc1ffdc0f78f563b416170ea7d57.dif

[clang] [AArch64] Extend SVE diagnostics. (PR #94976)

2024-06-14 Thread Harald van Dijk via cfe-commits
https://github.com/hvdijk closed https://github.com/llvm/llvm-project/pull/94976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][HeaderSearch] Fix handling of relative file-paths in suggestPathToFileForDiagnostics (PR #95121)

2024-06-14 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/95121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [include-cleaner] Pass WorkingDir to suggestPathToFileForDiagnostics (PR #95114)

2024-06-14 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/95114 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Skip auto-init on scalar vars that have a non-constant Init and no self-ref (PR #94642)

2024-06-14 Thread Jan Voung via cfe-commits
@@ -0,0 +1,110 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s -check-prefix=UNINIT +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefix=PATTERN +// RUN: %clang

[clang] [llvm] Fix silent truncation of inline ASM `srcloc` cookie when going through a `DiagnosticInfoSrcMgr` (PR #84559)

2024-06-14 Thread Simon Tatham via cfe-commits
https://github.com/statham-arm approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/84559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix silent truncation of inline ASM `srcloc` cookie when going through a `DiagnosticInfoSrcMgr` (PR #84559)

2024-06-14 Thread via cfe-commits
beetrees wrote: (FYI I don't have commit access) https://github.com/llvm/llvm-project/pull/84559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/95479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Aaron Ballman via cfe-commits
@@ -847,6 +847,7 @@ Bug Fixes to C++ Support - Fixed several bugs in capturing variables within unevaluated contexts. (#GH63845), (#GH67260), (#GH69307), (#GH88081), (#GH89496), (#GH90669) and (#GH91633). - Fixed handling of brace ellison when building deduction guides. (#GH

[clang] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
@@ -2327,6 +2327,25 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, } case Builtin::BI__builtin_launder: return SemaBuiltinLaunder(*this, TheCall); + case Builtin::BI__builtin_clear_padding: { +const Expr *PtrArg = TheCall->getArg(0)->Ig

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-14 Thread David Truby via cfe-commits
@@ -39,6 +39,7 @@ ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate ENUM_CODEGENOPT(VecLib, llvm::driver::

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

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

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-14 Thread David Truby via cfe-commits
@@ -39,6 +39,7 @@ ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate ENUM_CODEGENOPT(VecLib, llvm::driver::

[clang] [llvm] [RISCV] Add scheduling model for Syntacore SCR3 (PR #95427)

2024-06-14 Thread Anton Sidorenko via cfe-commits
https://github.com/asi-sc updated https://github.com/llvm/llvm-project/pull/95427 >From 1449d6ba48779051f19dcf9160aaa40599e2750e Mon Sep 17 00:00:00 2001 From: Anton Sidorenko Date: Fri, 31 May 2024 16:10:28 +0300 Subject: [PATCH 1/2] [RISCV] Add scheduling model for Syntacore SCR3 Syntacore S

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

2024-06-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/93647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/95509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Dump Auto Type Inference (PR #95509)

2024-06-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. I agree with @Endilll regarding the chattiness of this approach. AST dumping is a better way to do this until reflection support comes to C++ (at that point, I expect we'll have more nuanced tools for inspecting the deduced

[clang] [libcxx] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
https://github.com/huixie90 updated https://github.com/llvm/llvm-project/pull/75371 >From cb64639669286e5f48421ae8f569208e1e9717be Mon Sep 17 00:00:00 2001 From: zoecarver Date: Sat, 2 Dec 2023 20:00:30 + Subject: [PATCH] [Builtin] Add __builtin_clear_padding Adds `__builtin_clear_padding`

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Changes generally LGTM though I had some suggestions to consider. https://github.com/llvm/llvm-project/pull/95479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Aaron Ballman via cfe-commits
@@ -9325,6 +9325,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) { Result.IsNullPtr = false; return true; } else { + if (!Value.isLValue()) AaronBallman wrote: I think it's worth adding a comment here explaining under wha

[clang] [clang-interp] Use -fno-sized-deallocation in two tests (PR #95546)

2024-06-14 Thread Nico Weber via cfe-commits
https://github.com/nico created https://github.com/llvm/llvm-project/pull/95546 At least on my Windows machine, these two tests fail due to not being able to look up `??3@YAXPEAX_K@Z` (which is `void __cdecl operator delete(void *, unsigned __int64)` in demangled) after 130e93cc26ca. Since they

[clang-tools-extra] d5297b7 - [include-cleaner] Pass WorkingDir to suggestPathToFileForDiagnostics (#95114)

2024-06-14 Thread via cfe-commits
Author: kadir çetinkaya Date: 2024-06-14T15:45:04+02:00 New Revision: d5297b72aa32ad3a69563a1fcc61294282f0b379 URL: https://github.com/llvm/llvm-project/commit/d5297b72aa32ad3a69563a1fcc61294282f0b379 DIFF: https://github.com/llvm/llvm-project/commit/d5297b72aa32ad3a69563a1fcc61294282f0b379.dif

[clang] [clang-interp] Use -fno-sized-deallocation in two tests (PR #95546)

2024-06-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nico Weber (nico) Changes At least on my Windows machine, these two tests fail due to not being able to look up `??3@YAXPEAX_K@Z` (which is `void __cdecl operator delete(void *, unsigned __int64)` in demangled) after 130e93cc26ca. Since t

[clang] [clang-tools-extra] [include-cleaner] Pass WorkingDir to suggestPathToFileForDiagnostics (PR #95114)

2024-06-14 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/95114 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

2024-06-14 Thread Vlad Serebrennikov via cfe-commits
@@ -738,16 +738,47 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration( return nullptr; } -if (!Tok.is(tok::identifier)) { +Decl *UED = nullptr; + +if (Tok.is(tok::identifier)) { Endilll wrote: 1) You're correct that `ParseOptionalCX

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-14 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: I got to the bottom of it. The problem is that our hash function for 64 bit ints is [not very good](https://github.com/llvm/llvm-project/blob/d5297b72aa32ad3a69563a1fcc61294282f0b379/llvm/include/llvm/ADT/DenseMapInfo.h#L140). It will have a lot of collision when lower 32

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-14 Thread Pierre d'Herbemont via cfe-commits
https://github.com/pdherbemont updated https://github.com/llvm/llvm-project/pull/95455 >From 783a6b58367d99eb4b2be3ee1d7177419138885b Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Wed, 12 Jun 2024 20:20:05 +0200 Subject: [PATCH] Support `guarded_by` attribute and related attributes in

[clang] [clang][HeaderSearch] Fix handling of relative file-paths in suggestPathToFileForDiagnostics (PR #95121)

2024-06-14 Thread kadir çetinkaya via cfe-commits
https://github.com/kadircet closed https://github.com/llvm/llvm-project/pull/95121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix silent truncation of inline ASM `srcloc` cookie when going through a `DiagnosticInfoSrcMgr` (PR #84559)

2024-06-14 Thread Simon Tatham via cfe-commits
https://github.com/statham-arm closed https://github.com/llvm/llvm-project/pull/84559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Fix silent truncation of inline ASM `srcloc` cookie when going through a `DiagnosticInfoSrcMgr` (PR #84559)

2024-06-14 Thread via cfe-commits
github-actions[bot] wrote: @beetrees Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build

[clang] db3a47c - Fix silent truncation of inline ASM `srcloc` cookie when going through a `DiagnosticInfoSrcMgr` (#84559)

2024-06-14 Thread via cfe-commits
Author: beetrees Date: 2024-06-14T15:05:57+01:00 New Revision: db3a47c810639388c80ed173dda3623dac00ce0a URL: https://github.com/llvm/llvm-project/commit/db3a47c810639388c80ed173dda3623dac00ce0a DIFF: https://github.com/llvm/llvm-project/commit/db3a47c810639388c80ed173dda3623dac00ce0a.diff LOG:

[clang] [llvm] [mlir] [polly] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-06-14 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/91724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8e0ba08 - [clang][HeaderSearch] Fix handling of relative file-paths in suggestPathToFileForDiagnostics (#95121)

2024-06-14 Thread via cfe-commits
Author: kadir çetinkaya Date: 2024-06-14T16:07:42+02:00 New Revision: 8e0ba08448d5935281e5afd007664d528dd672c4 URL: https://github.com/llvm/llvm-project/commit/8e0ba08448d5935281e5afd007664d528dd672c4 DIFF: https://github.com/llvm/llvm-project/commit/8e0ba08448d5935281e5afd007664d528dd672c4.dif

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Donát Nagy (NagyDonat) Changes ...becasue they were strangely worded and in a few cases outright incorrect. --- Patch is 33.92 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/95550.d

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-14 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Small recommendation that the [patch](https://github.com/llvm/llvm-project/pull/91724) @pogo59 mentioned above has now landed, so before merging this you should rebase and update the test accordingly. https://github.com/llvm/llvm-project/pull/95298 _

[clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

2024-06-14 Thread Tom Eccles via cfe-commits
@@ -39,6 +39,7 @@ ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate ENUM_CODEGENOPT(VecLib, llvm::driver::

[clang] [libcxx] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread via cfe-commits
BukeBeyond wrote: We have fast AVX256 scanners that detect data change and generate a hash in a united pass. When this code is inlined, it further optimizes to just a few instructions with constant size structures. There is a lot of optimization potential for these flat data structures. We

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread Donát Nagy via cfe-commits
NagyDonat wrote: This commit is motivated by the discussion on https://github.com/llvm/llvm-project/pull/94356 . Feel free to bikeshed the messages, I'm not too attached to the new choices, I'm just unsatisfied with the old ones. https://github.com/llvm/llvm-project/pull/95550 ___

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/95550 ...becasue they were strangely worded and in a few cases outright incorrect. From 06adc063c2388ea534537f5a417751fdf64b22cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Fri, 14 Jun 2024 15

[clang] [llvm] [clang] Reland Add tanf16 builtin and support for tan constrained intrinsic (PR #94559)

2024-06-14 Thread Farzon Lotfi via cfe-commits
farzonl wrote: PR https://github.com/llvm/llvm-project/pull/95518/files should address all backends. Also SLPVectorizer was disabled for tan so I put out PR https://github.com/llvm/llvm-project/pull/95517 https://github.com/llvm/llvm-project/pull/94559

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-14 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95112 >From e53dfbc9b2c6b7f30c1378731d7de284fa99d568 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 11 Jun 2024 14:26:38 +0100 Subject: [PATCH 1/4] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

[clang] [serialization] no transitive decl change (PR #92083)

2024-06-14 Thread via cfe-commits
alexfh wrote: Thank you for the analysis, Ilya! Re: a possible resolution, I wonder why `llvm::hash_value` from llvm/ADT/Hashing.h is not used in `DenseSet`? In any case, if this can't be resolved quickly and needs a design discussion, it would be appropriate to revert the patch first. https

[clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/95479 >From d66fdcbe0a56e17dbd25e6d2ed5bdcce1970fdea Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 14 Jun 2024 01:26:34 +0300 Subject: [PATCH 1/4] fix(95366): enhance cast operation safety with LValue valid

[clang] [Clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/95479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-14 Thread Pierre d'Herbemont via cfe-commits
https://github.com/pdherbemont updated https://github.com/llvm/llvm-project/pull/95455 >From 8bfc79e42062e1343dbf96faadcd48cb55134079 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Wed, 12 Jun 2024 20:20:05 +0200 Subject: [PATCH] Support `guarded_by` attribute and related attributes in

[clang] [Clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Oleksandr T. via cfe-commits
@@ -9325,6 +9325,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) { Result.IsNullPtr = false; return true; } else { + if (!Value.isLValue()) a-tarasyuk wrote: @AaronBallman Thanks for the feedback 👍. I've added all the req

[clang] [Clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 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 0a57a20aa506c5a5a8b0a8eb45446d0747493d7c 5347a0d44580167df364faf6b7a5dd60a52b9e88 --

[clang-tools-extra] [clang-tidy] Clarify diagnostics of bugprone-sizeof-expression (PR #95550)

2024-06-14 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Consider replacing ":" separator with "," https://github.com/llvm/llvm-project/pull/95550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AArch64] Generalise streaming mode checks for builtins. (PR #93802)

2024-06-14 Thread Paul Walker via cfe-commits
@@ -559,31 +559,76 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, -

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-14 Thread Pierre d'Herbemont via cfe-commits
https://github.com/pdherbemont updated https://github.com/llvm/llvm-project/pull/95455 >From db251415e4e8c110d8842b1242d51d6ec5e839e5 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Wed, 12 Jun 2024 20:20:05 +0200 Subject: [PATCH] Support `guarded_by` attribute and related attributes in

[clang] Support `guarded_by` attribute and related attributes inside C structs and support late parsing them (PR #95455)

2024-06-14 Thread Pierre d'Herbemont via cfe-commits
@@ -3330,6 +3340,118 @@ void Parser::DistributeCLateParsedAttrs(Decl *Dcl, } } +/// GuardedBy attributes (e.g., guarded_by): +/// AttrName '(' expression ')' +void Parser::ParseGuardedByAttribute( +IdentifierInfo &AttrName, SourceLocation AttrNameLoc, +ParsedAttrib

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Jon Roelofs via cfe-commits
@@ -521,7 +521,14 @@ inline constexpr CpuInfo CpuInfos[] = { AArch64::ExtensionBitset({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3, AArch64::AEK_FP16, AArch64::AEK_FP16FML})}, - +// Technically ap

[clang] [Clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/95479 >From af6ba760826467a3ce7b7a41c18f194528a1cede Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 14 Jun 2024 01:26:34 +0300 Subject: [PATCH 1/4] [Clang] fix(95366): enhance cast operation safety with LVal

[clang] [libcxx] [libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread Louis Dionne via cfe-commits
@@ -0,0 +1,807 @@ +//===--===// +// +// 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: Apa

[clang] [libcxx] [clang] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2024-06-14 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/75371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Jon Roelofs via cfe-commits
@@ -1010,6 +1034,9 @@ def : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16, [TuneAppleA16]>; def : ProcessorModel<"apple-a17", CycloneModel, ProcessorFeatures.AppleA17, [TuneAppleA17]>; +def : ProcessorModel<"appl

[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -325,14 +325,19 @@ Address SparcV9ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, break; case ABIArgInfo::Ignore: -return Address(llvm::UndefValue::get(ArgPtrTy), ArgTy, TypeInfo.Align); +return CGF.EmitLoadOfAnyValue( +CGF.MakeAddrLValue

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Jon Roelofs via cfe-commits
@@ -1010,6 +1034,9 @@ def : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16, [TuneAppleA16]>; def : ProcessorModel<"apple-a17", CycloneModel, ProcessorFeatures.AppleA17, [TuneAppleA17]>; +def : ProcessorModel<"appl

[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

2024-06-14 Thread Mariya Podchishchaeva via cfe-commits
@@ -834,5 +834,4 @@ typedef struct {} empty; empty empty_record_test(void) { // CHECK-LABEL: define{{.*}} void @empty_record_test() return va_arg(the_list, empty); -// CHECK: [[GR_OFFS:%[a-z_0-9]+]] = load ptr, ptr @the_list Fznamznon wrote: Well, there is n

[clang-tools-extra] [clang-tidy] avoid false positive when overload for bugprone-return-const-ref-from-parameter (PR #95434)

2024-06-14 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/95434 >From ecbd726bb937361b243ea4433e8c597c8d30f857 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 14 Jun 2024 00:50:04 +0800 Subject: [PATCH 1/2] [clang-tidy] avoid false positive when overload for bugpr

[clang] [HLSL] Use hlsl vector template in type printer (PR #95489)

2024-06-14 Thread David Peixotto via cfe-commits
https://github.com/dmpots approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/95489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc][cmake] Copy assets to build directory (PR #95187)

2024-06-14 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/95187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][AArch64] Support -mcpu=apple-m4 (PR #95478)

2024-06-14 Thread Martin Storsjö via cfe-commits
@@ -1010,6 +1034,9 @@ def : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16, [TuneAppleA16]>; def : ProcessorModel<"apple-a17", CycloneModel, ProcessorFeatures.AppleA17, [TuneAppleA17]>; +def : ProcessorModel<"appl

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Vikram Hegde via cfe-commits
@@ -0,0 +1,65 @@ +; RUN: llc -stop-after=amdgpu-isel -mtriple=amdgcn-- -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=CHECK,ISEL %s + +; CHECK-LABEL: name:basic_readfirstlane_i64 +; CHECK:[[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL

[clang] [Clang] fix(95366): enhance cast operation safety with LValue validation (PR #95479)

2024-06-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/95479 >From af6ba760826467a3ce7b7a41c18f194528a1cede Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 14 Jun 2024 01:26:34 +0300 Subject: [PATCH 1/4] [Clang] fix(95366): enhance cast operation safety with LVal

[clang] [clang-format] Handle AttributeMacro before access modifiers (PR #95503)

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

[clang] [clang][modules] HeaderSearch::MarkFileModuleHeader sets textual headers' HeaderFileInfo non-external when it shouldn't (PR #89005)

2024-06-14 Thread Jan Svoboda via cfe-commits
@@ -1313,11 +1313,19 @@ OptionalFileEntryRef HeaderSearch::LookupSubframeworkHeader( // File Info Management. //===--===// +static bool moduleMembershipNeedsMerge(const HeaderFileInfo *HFI, +

[clang] [clang][modules] HeaderSearch::MarkFileModuleHeader sets textual headers' HeaderFileInfo non-external when it shouldn't (PR #89005)

2024-06-14 Thread Jan Svoboda via cfe-commits
@@ -308,5 +308,73 @@ TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) { EXPECT_EQ(Search.getIncludeNameForHeader(FE), "Foo/Foo.h"); } +TEST_F(HeaderSearchTest, HeaderFileInfoMerge) { + auto AddHeader = [&](std::string HeaderPath) -> FileEntryRef { +VFS->addFile(Header

[clang] [HLSL] Use hlsl vector template in type printer (PR #95489)

2024-06-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/95489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,65 @@ +; RUN: llc -stop-after=amdgpu-isel -mtriple=amdgcn-- -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=CHECK,ISEL %s + +; CHECK-LABEL: name:basic_readfirstlane_i64 +; CHECK:[[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL

[clang] Make warning pragma override -Werror=foo and DefaultError warnings (PR #93647)

2024-06-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/93647 >From 9770644e7db88cff2c16109ceb8cb446741d53ea Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 28 May 2024 21:33:55 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF

[clang] Make diagnostic pragma override -Werror=foo and DefaultError warnings (PR #93647)

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

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Vikram Hegde via cfe-commits
@@ -0,0 +1,65 @@ +; RUN: llc -stop-after=amdgpu-isel -mtriple=amdgcn-- -mcpu=gfx1100 -verify-machineinstrs -o - %s | FileCheck --check-prefixes=CHECK,ISEL %s + +; CHECK-LABEL: name:basic_readfirstlane_i64 +; CHECK:[[TOKEN:%[0-9]+]]{{[^ ]*}} = CONVERGENCECTRL

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-06-14 Thread Vikram Hegde via cfe-commits
https://github.com/vikramRH edited https://github.com/llvm/llvm-project/pull/89217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Check the correct first and last elements in cstring.UninitializedRead (PR #95408)

2024-06-14 Thread Balázs Kéri via cfe-commits
@@ -393,6 +401,173 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, return stateNonNull; } +static std::optional getIndex(ProgramStateRef State, + const ElementRegion *ER, CharKind CK) { + SValBuilder &SValBuilder = St

[clang] 9a92f2f - Make diagnostic pragma override -Werror=foo and DefaultError warnings

2024-06-14 Thread via cfe-commits
Author: Fangrui Song Date: 2024-06-14T09:57:21-07:00 New Revision: 9a92f2f742347d9b31470349f3b777ecab580ac1 URL: https://github.com/llvm/llvm-project/commit/9a92f2f742347d9b31470349f3b777ecab580ac1 DIFF: https://github.com/llvm/llvm-project/commit/9a92f2f742347d9b31470349f3b777ecab580ac1.diff

[clang] Make diagnostic pragma override -Werror=foo and DefaultError warnings (PR #93647)

2024-06-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/93647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

2024-06-14 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/94830 >From baa19285069854598437694cb2094283598cf8c2 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Fri, 14 Jun 2024 12:58:08 -0400 Subject: [PATCH] [Clang][AMDGPU] Add a new builtin type for buffer rsrc --- clang

<    1   2   3   4   >