[clang] [Clang] [NFC] Refactor more AST visitors (PR #116823)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -427,42 +423,53 @@ class ParentMapContext::ParentMap::ASTVisitor return Result; } - bool TraverseDecl(Decl *DeclNode) { + bool TraverseDecl(Decl *DeclNode) override { return TraverseNode( -DeclNode, DeclNode, [&] { return VisitorBase::TraverseDecl(DeclN

[clang] [analyzer] Retry UNDEF Z3 queries 2 times by default (PR #120239)

2025-01-06 Thread Balazs Benics via cfe-commits
steakhal wrote: I find this really unfortunate that I had to patch the other places where we initialize the AnalyzerOptions table. Just because the we can't assign the default value to the given option. This makes me reconsider my approach because it WILL break all downstream users. Any suggest

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: > Is this still worth adding here? I didn't see an equivalent in clang's -Wall. Indeed Clang is missing this check in -Wall. For parity with GCC it probably makes sense to add it to -Wall as well instead of being a clang-tidy check. What do you think @AaronBallman ? https

[clang] [clang] [NFC] explicitly check if ParentMap contains key (PR #121736)

2025-01-06 Thread Sameer Sahasrabuddhe via cfe-commits
@@ -78,7 +78,7 @@ static void BuildParentMap(MapTy& M, Stmt* S, // The right thing to do is to give the OpaqueValueExpr its syntactic // parent, then not reassign that when traversing the semantic expressions. OpaqueValueExpr *OVE = cast(S); -if (OVMode == OV_Tr

[clang] [clang] [NFC] explicitly check if ParentMap contains key (PR #121736)

2025-01-06 Thread Sameer Sahasrabuddhe via cfe-commits
@@ -34,13 +34,13 @@ static void BuildParentMap(MapTy& M, Stmt* S, case Stmt::PseudoObjectExprClass: { PseudoObjectExpr *POE = cast(S); -if (OVMode == OV_Opaque && M[POE->getSyntacticForm()]) +if (OVMode == OV_Opaque && M.contains(POE->getSyntacticForm())) ---

[clang] [clang] [NFC] explicitly check if ParentMap contains key (PR #121736)

2025-01-06 Thread Sameer Sahasrabuddhe via cfe-commits
https://github.com/ssahasra updated https://github.com/llvm/llvm-project/pull/121736 >From 2cae10eb0b1e94729c26299af018216e729607de Mon Sep 17 00:00:00 2001 From: Sameer Sahasrabuddhe Date: Thu, 2 Jan 2025 14:30:07 +0530 Subject: [PATCH 1/2] [clang] explicitly check if ParentMap contains key T

[clang] [clang] [NFC] explicitly check if ParentMap contains key (PR #121736)

2025-01-06 Thread Sameer Sahasrabuddhe via cfe-commits
https://github.com/ssahasra updated https://github.com/llvm/llvm-project/pull/121736 >From 2cae10eb0b1e94729c26299af018216e729607de Mon Sep 17 00:00:00 2001 From: Sameer Sahasrabuddhe Date: Thu, 2 Jan 2025 14:30:07 +0530 Subject: [PATCH 1/2] [clang] explicitly check if ParentMap contains key T

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2025-01-06 Thread via cfe-commits
https://github.com/amane-ame updated https://github.com/llvm/llvm-project/pull/119563 From 659eda3ec76b63418f8b621b004728d9d7bf26ad Mon Sep 17 00:00:00 2001 From: amane-ame Date: Wed, 11 Dec 2024 22:17:51 +0800 Subject: [PATCH 01/11] [clang] Fix crashes when passing VLA to va_arg --- clang/li

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

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

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2025-01-06 Thread via cfe-commits
https://github.com/amane-ame updated https://github.com/llvm/llvm-project/pull/119563 From 659eda3ec76b63418f8b621b004728d9d7bf26ad Mon Sep 17 00:00:00 2001 From: amane-ame Date: Wed, 11 Dec 2024 22:17:51 +0800 Subject: [PATCH 01/11] [clang] Fix crashes when passing VLA to va_arg --- clang/li

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

2025-01-06 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `fuchsia-x86_64-linux` running on `fuchsia-debian-64-us-central1-a-1` while building `clang,llvm` at step 4 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/10589 Here is the rele

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

2025-01-06 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder closed https://github.com/llvm/llvm-project/pull/120507 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 653a547 - [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)

2025-01-06 Thread via cfe-commits
Author: Ian Anderson Date: 2025-01-06T21:33:51-08:00 New Revision: 653a54727eaa18c43447ad686c987db67f1dda74 URL: https://github.com/llvm/llvm-project/commit/653a54727eaa18c43447ad686c987db67f1dda74 DIFF: https://github.com/llvm/llvm-project/commit/653a54727eaa18c43447ad686c987db67f1dda74.diff

[clang] [Clang] Remove 3-element vector load and store special handling (PR #104661)

2025-01-06 Thread Shilei Tian via cfe-commits
shiltian wrote: ping @arsenm @topperc https://github.com/llvm/llvm-project/pull/104661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Tristan Ross via cfe-commits
RossComputerGuy wrote: > That said, I tend to agree with the review at [#121123 > (comment)](https://github.com/llvm/llvm-project/pull/121123#discussion_r1900548165) > that this doesn't seem like the right approach. Yeah I agree too, I'm not sure what the right approach is but that's one of th

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -17893,4 +17996,441 @@ std::optional EvaluateBuiltinIsWithinLifetime(IntExprEvaluator &IEE, IsWithinLifetimeHandler handler{Info}; return findSubobject(Info, E, CO, Val.getLValueDesignator(), handler); } + } // namespace + +static bool EvaluateAtomicOrder(const AtomicE

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -1921,6 +1921,22 @@ static bool EvaluateFixedPointOrInteger(const Expr *E, APFixedPoint &Result, static bool EvaluateFixedPoint(const Expr *E, APFixedPoint &Result, EvalInfo &Info); +/// Support for atomic builtins +static bool EvaluateAtomic

[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

2025-01-06 Thread Timm Baeder via cfe-commits
@@ -1921,6 +1921,22 @@ static bool EvaluateFixedPointOrInteger(const Expr *E, APFixedPoint &Result, static bool EvaluateFixedPoint(const Expr *E, APFixedPoint &Result, EvalInfo &Info); +/// Support for atomic builtins tbaederr w

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Carlo Cabrera via cfe-commits
carlocab wrote: > Introducing a target triple has large ecosystem implication and should not be > taken lightly. To be fair this patch doesn't introduce a target triple, it only makes it more easily usable in Clang. That said, I tend to agree with the review at https://github.com/llvm/llvm-

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Chris Cotter via cfe-commits
ccotter wrote: Oh, you are entirely right. I completely missed that gcc had this check. All of my test cases are covered by gcc's check, and gcc's check is a bit smarter than mine (`sprintf(stp->buf, "%s", st1.buf)` is caught by gcc, but not my check). Is this still worth adding here? I didn't

[libunwind] [libunwind][cmake] Compile _Unwind* routines with -fexceptions (PR #121819)

2025-01-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. The second paragraph can mention `_Unwind_Resume` explicitly. https://github.com/llvm/llvm-project/pull/121819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder llvm::EnableSingleByteCoverage ? getRegionCounter(S->getCond()) : addCounters(ParentCount, BackedgeCount, BC.ContinueCount); +auto [ExecCount, ExitCount] = +(llvm::EnableSing

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Joseph Huber via cfe-commits
jhuber6 wrote: You can compile and run static C applications, I'm not sure what the threshold is before we can start adding support to make it usable in `clang`. https://github.com/llvm/llvm-project/pull/121123 ___ cfe-commits mailing list cfe-commits

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Tristan Ross via cfe-commits
RossComputerGuy wrote: Why close? LLVM libc is maturing and one of the goals I had was to try using it in Nixpkgs to build whatever I can. LLVM libc doesn't work well in an overlay mode so we have to use full builds. It's true that a lot of functions are still missing or not implemented but by

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + std::pair getBranchCounterPair(const Stmt *S, + Counter ParentCnt) { +Counter ExecCnt = getRegionCounter(S); +

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Tristan Ross via cfe-commits
@@ -1531,7 +1531,7 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Check if the environment version is valid except wasm case. llvm::Triple Triple = TC.getTriple(); - if (!Triple.isWasm()) { + if (!Triple.isWasm() && Triple.getEnvironment() != llvm::Tripl

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; +Counter Skipped; + }; + + BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) { +Co

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; +Counter Skipped; + }; + + BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) { ---

[clang] [clang] add llvm abi support (PR #121123)

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

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { ornata wrote: IIUC the point of this pair is given: ``` if (x) { // ... do something } else if (y) { // ... somethin

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Fangrui Song via cfe-commits
MaskRay wrote: NAK. While llvm libc can be used an overlay, it is not complete for standalone Linux server/desktop usage. Introducing a target triple has large ecosystem implication and should not be taken lightly. https://github.com/llvm/llvm-project/pull/121123 _

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { +Counter Executed; ornata wrote: Comments on member variables? E.g. ``` /// Counter tracking number of times the b

[clang] [Coverage] Introduce `getBranchCounterPair()`. NFC. (PR #112702)

2025-01-06 Thread Jessica Paquette via cfe-commits
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder return Counter::getCounter(CounterMap[S]); } + struct BranchCounterPair { ornata wrote: A doxygen comment here might be useful. https://github.com/llvm/llvm-project/pull/112702

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Jannick Kremer via cfe-commits
DeinAlptraum wrote: @efriedma-quic no idea, I would just rebase and hope that's it https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-06 Thread Ellis Hoag via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcicm (Conditional Move) extension (PR #121752)

2025-01-06 Thread Sudharsan Veeravalli via cfe-commits
https://github.com/svs-quic closed https://github.com/llvm/llvm-project/pull/121752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 737d6ca - [RISCV] Add Qualcomm uC Xqcicm (Conditional Move) extension (#121752)

2025-01-06 Thread via cfe-commits
Author: quic_hchandel Date: 2025-01-07T08:25:00+05:30 New Revision: 737d6ca44d383bcf33a0605a7d9014027296269a URL: https://github.com/llvm/llvm-project/commit/737d6ca44d383bcf33a0605a7d9014027296269a DIFF: https://github.com/llvm/llvm-project/commit/737d6ca44d383bcf33a0605a7d9014027296269a.diff

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -186,10 +188,24 @@ struct SanitizerSet { /// Returns a non-zero SanitizerMask, or \c 0 if \p Value is not known. SanitizerMask parseSanitizerValue(StringRef Value, bool AllowGroups); +/// Parse a single weighted value (e.g., 'undefined=0.05') from a -fsanitize= or +/// -fn

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2025-01-06 Thread Tom Honermann via cfe-commits
tahonermann wrote: I've been continuing to work on this, but have yet to get all of our internal tests to pass. I've reverted the PR to a draft pending successful internal testing. https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mail

[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

2025-01-06 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: @DeinAlptraum any idea why the Python tests are failing? https://github.com/llvm/llvm-project/pull/120494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2025-01-06 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann converted_to_draft https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crashes when passing VLA to va_arg (PR #119563)

2025-01-06 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/119563 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement a header only distance intrinsic (PR #117240)

2025-01-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/117240 >From 271141588db106f888dd6abb3ad7da41732a4f52 Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Thu, 21 Nov 2024 14:46:31 -0500 Subject: [PATCH] [HLSL] Implement a header only distance intrinsic Addressing RFC

[clang] [llvm] [HLSL] Implement a header only distance intrinsic (PR #117240)

2025-01-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/117240 >From 89507233b8b7ac859e1abbedb97e69574e54dfc8 Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Thu, 21 Nov 2024 14:46:31 -0500 Subject: [PATCH] [HLSL] Implement a header only distance intrinsic Addressing RFC

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-06 Thread A. Jiang via cfe-commits
@@ -0,0 +1,623 @@ +// -*- C++ -*- +//===--===// +// +// 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

[clang] [llvm] [NFC] fix up typos (PR #121842)

2025-01-06 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl closed https://github.com/llvm/llvm-project/pull/121842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 90b04bf - [NFC] fix up typos (#121842)

2025-01-06 Thread via cfe-commits
Author: Farzon Lotfi Date: 2025-01-06T19:57:30-05:00 New Revision: 90b04bf84ec3315f803a2ba846e3086ba5e3 URL: https://github.com/llvm/llvm-project/commit/90b04bf84ec3315f803a2ba846e3086ba5e3 DIFF: https://github.com/llvm/llvm-project/commit/90b04bf84ec3315f803a2ba846e3086ba5e3.diff

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -1463,17 +1504,18 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, } SanitizerMask parseArgValues(const Driver &D, const llvm::opt::Arg *A, vitalybuka wrote: Instead of extending this function, it would be cleaner to cre

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -186,10 +188,24 @@ struct SanitizerSet { /// Returns a non-zero SanitizerMask, or \c 0 if \p Value is not known. SanitizerMask parseSanitizerValue(StringRef Value, bool AllowGroups); +/// Parse a single weighted value (e.g., 'undefined=0.05') from a -fsanitize= or +/// -fn

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Eli Friedman via cfe-commits
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) { _2, _3, _4)); } +static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) { + // Don't promote integer types + if (QualType Ty = E->getType(); S.getASTContext().is

[clang] [clang] add llvm abi support (PR #121123)

2025-01-06 Thread Chris B via cfe-commits
@@ -1531,7 +1531,7 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Check if the environment version is valid except wasm case. llvm::Triple Triple = TC.getTriple(); - if (!Triple.isWasm()) { + if (!Triple.isWasm() && Triple.getEnvironment() != llvm::Tripl

[clang] [llvm] [NFC] fix up typos (PR #121842)

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

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -154,6 +154,8 @@ struct SanitizerKind { #include "clang/Basic/Sanitizers.def" }; // SanitizerKind +typedef double SanitizerMaskWeights[SanitizerKind::SO_Count]; thurstond wrote: Done https://github.com/llvm/llvm-project/pull/121619 ___

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Thurston Dang (thurstond) Changes This adds a function to parse weighted sanitizer flags (e.g., -fsanitize-blah=undefined=0.5,null=0.3) and adds the plumbing to apply that to a new flag, -fno-sanitize-top-hot, from the frontend to

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

2025-01-06 Thread Min-Yih Hsu via cfe-commits
https://github.com/mshockwave edited https://github.com/llvm/llvm-project/pull/120712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Thurston Dang (thurstond) Changes This adds a function to parse weighted sanitizer flags (e.g., -fsanitize-blah=undefined=0.5,null=0.3) and adds the plumbing to apply that to a new flag, -fno-sanitize-top-hot, from the frontend to backend

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
https://github.com/thurstond ready_for_review https://github.com/llvm/llvm-project/pull/121619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-06 Thread via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: apple-fcloutier wrote: As an update, I've been adding more tests and I found that I can make improvements with follow-up work. Since these aren't stability problems or false positives, and we think the change is

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -3602,6 +3602,7 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; + bool SanitizeGuardChecks = ClSanitizeGuardChecks; thurstond wrote: Noted for the next patch (this pat

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( thurstond wrote: Done https://github.com/llvm/llvm-project/pull/121619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -26,6 +26,8 @@ class SanitizerArgs { SanitizerSet RecoverableSanitizers; SanitizerSet TrapSanitizers; SanitizerSet MergeHandlers; + SanitizerSet TopHot; + SanitizerMaskWeights TopHotWeights = {0}; thurstond wrote: Renamed to Cutoff - is that ok inst

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -2649,6 +2649,11 @@ def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-unde HelpText<"Strip (or keep only, if negative) a given number of path components " "when emitting check metadata.">, MarshallingInfoInt, "0", "int">; +def fno_

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -2649,6 +2649,11 @@ def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-unde HelpText<"Strip (or keep only, if negative) a given number of path components " "when emitting check metadata.">, MarshallingInfoInt, "0", "int">; +def fno_

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -154,6 +154,8 @@ struct SanitizerKind { #include "clang/Basic/Sanitizers.def" }; // SanitizerKind +typedef double SanitizerMaskWeights[SanitizerKind::SO_Count]; thurstond wrote: Done https://github.com/llvm/llvm-project/pull/121619 ___

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/121619 >From ca1fabc5ea75af0acdd1969c0ad505e04103e1c9 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Sat, 4 Jan 2025 02:53:00 + Subject: [PATCH 1/9] [sanitizer] Parse weighted sanitizer args and -fno-sanitiz

[clang] [clang][CodeGen][SPIRV] Translate `amdgpu_flat_work_group_size` into `max_work_group_size`. (PR #116820)

2025-01-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/116820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen][SPIRV] Translate `amdgpu_flat_work_group_size` into `max_work_group_size`. (PR #116820)

2025-01-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/116820 >From c5efdd24c0c889e26e3b00865780970ca5ed1f4c Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 19 Nov 2024 14:55:25 + Subject: [PATCH 1/3] Translate `amdgpu_flat_work_group_size` into `reqd_work_group_

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Brian Foley (bpfoley) Changes Recently I had a scenario where I had: 1. A class C with many members m_1...m_n of the same type T 2. T's default constructor was deleted 3. I accidentally omitted an explicitly constructed member in the initia

[clang] [clang] fix uefi target for aarch64 & x86_64 (PR #120632)

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

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-01-06 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-01-06 Thread Brian Foley via cfe-commits
https://github.com/bpfoley created https://github.com/llvm/llvm-project/pull/121854 Recently I had a scenario where I had: 1. A class C with many members m_1...m_n of the same type T 2. T's default constructor was deleted 3. I accidentally omitted an explicitly constructed member in the initiali

[clang] Deprecate order file instrumentation (PR #121514)

2025-01-06 Thread Chris B via cfe-commits
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasArg(options::OPT_forder_file_instrumentation)) { - CmdArgs.push_back("-forder-file-instrumentation"); - // Enable order file instrumentation when ThinLTO is

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
macurtis-amd wrote: > Thanks for working on this. > > I have a couple of questions about inconsistent casing. Other than that, this > looks reasonable to me. But I don't have a great deal of experience with this > part of LLVM, so please wait for other reviewers. @tarunprabhu Thanks for takin

[clang] 1a435fe - [HLSL] Fix build warning after #116331 (#121852)

2025-01-06 Thread via cfe-commits
Author: Vitaly Buka Date: 2025-01-06T14:50:57-08:00 New Revision: 1a435feffcd85c1e7fe30daf1a3995e95860b300 URL: https://github.com/llvm/llvm-project/commit/1a435feffcd85c1e7fe30daf1a3995e95860b300 DIFF: https://github.com/llvm/llvm-project/commit/1a435feffcd85c1e7fe30daf1a3995e95860b300.diff L

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/121852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread via cfe-commits
https://github.com/joaosaffran approved this pull request. LGTM. Thanks for fixing this https://github.com/llvm/llvm-project/pull/121852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement parsing of `RootFlags` (PR #121799)

2025-01-06 Thread Finn Plummer via cfe-commits
inbelic wrote: I didn't implement the tokenizer because I found that the extra level of abstraction to be redundant/not beneficial with the StringRef operations. Looking at the DXC implementation, the usage of the Tokenizer is either GetAndMatchToken, or, getToken for an identifier with a swi

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
@@ -284,18 +250,22 @@ NamedRegionTimer::NamedRegionTimer(StringRef Name, StringRef Description, /// ctor/dtor and is protected by the TimerLock lock. static TimerGroup *TimerGroupList = nullptr; -TimerGroup::TimerGroup(StringRef Name, StringRef Description) - : Name(Name.beg

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
@@ -38,63 +38,40 @@ using namespace llvm; -// This ugly hack is brought to you courtesy of constructor/destructor ordering -// being unspecified by C++. Basically the problem is that a Statistic object -// gets destroyed, which ends up calling 'GetLibSupportInfoOutputFile()'

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) Changes After #116331 is always SpellingNotCalculated, so I assume doing nothing is expected. --- Full diff: https://github.com/llvm/llvm-project/pull/121852.diff 1 Files Affec

[clang] [HLSL] Fix build warning after #116331 (PR #121852)

2025-01-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/121852 After #116331 is always SpellingNotCalculated, so I assume doing nothing is expected. >From d5cedbc7b822671f5ac45e1f4d49ed91c13858e3 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 6 Jan 2025 14:48:15

[clang] [llvm] [llvm][NFC] Rework Timer.cpp globals to ensure valid lifetimes (PR #121663)

2025-01-06 Thread via cfe-commits
https://github.com/macurtis-amd updated https://github.com/llvm/llvm-project/pull/121663 >From 4500df21b2085dfb84228d399126eb65281297da Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Sat, 4 Jan 2025 13:38:57 -0600 Subject: [PATCH 1/2] [llvm][NFC] Rework Timer.cpp globals to ensure valid l

[clang-tools-extra] Add bugprone-sprintf-argument-overlap (PR #114244)

2025-01-06 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Sorry for the late review, but isn't this already covered by `-Wall` with GCC? At least the example from the check documentation: https://godbolt.org/z/es37ozqe9 ``` warning: 'sprintf' argument 3 overlaps destination object 'buf' ``` If this check is not redundant given t

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -132,6 +133,70 @@ template <> struct llvm::DenseMapInfo { return LHS == RHS; } }; +constexpr unsigned CXX23FloatRankToIndex(clang::BuiltinType::Kind Kind) { + switch (Kind) { + case clang::BuiltinType::Float16: +return 0; + case clang::BuiltinType::BFloat16: +

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -132,6 +133,70 @@ template <> struct llvm::DenseMapInfo { return LHS == RHS; } }; +constexpr unsigned CXX23FloatRankToIndex(clang::BuiltinType::Kind Kind) { + switch (Kind) { + case clang::BuiltinType::Float16: +return 0; + case clang::BuiltinType::BFloat16: +

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -470,8 +470,16 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, if (LangOpts.CPlusPlus26) // FIXME: Use correct value for C++26. Builder.defineMacro("__cplusplus", "202400L"); -else if (LangOpts.CPlusPlus23) +else if (LangOpts.

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -7670,27 +7739,68 @@ static FloatingRank getFloatingRank(QualType T) { } } +/// C++23 6.8.5 [conv.rank] /// getFloatingTypeOrder - Compare the rank of the two specified floating /// point types, ignoring the domain of the type (i.e. 'double' == -/// '_Complex double').

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
@@ -0,0 +1,563 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown -target-feature +fullbf16 -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK ---

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel commented: I haven't fully reviewed this, but here's some comments to start with: https://github.com/llvm/llvm-project/pull/78503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-01-06 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel edited https://github.com/llvm/llvm-project/pull/78503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Thurston Dang via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second)) NoMerge = true; + +if (!CGM.getCodeGenOpts().NoSanitizeTopHot.has(Checked[i].second)) + SanitizeGuardChecks = true; } - if (

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( vitalybuka wrote: maybe we can keep the patch Driver only, because we need: passing fractions array into LLVM passes: ubsan and hwasan https://github.com/llvm/llvm-project/pull/121619 ___

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -3602,6 +3602,7 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; + bool SanitizeGuardChecks = ClSanitizeGuardChecks; vitalybuka wrote: Usually we parse Cls as `if (ClSa

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-06 Thread Vitaly Buka via cfe-commits
@@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second)) NoMerge = true; + +if (!CGM.getCodeGenOpts().NoSanitizeTopHot.has(Checked[i].second)) + SanitizeGuardChecks = true; } - if (

[clang] [llvm] [Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (PR #120507)

2025-01-06 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/120507 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [z/OS][SystemZ] Clang dependency files are text files (PR #121849)

2025-01-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Kai Nacke (redstar) Changes The dependency file and the P1689 file are text files, but the open call misses the OF_Text flag. This PR adds the flag. Fixes regressions in test cases ClangScanDeps/modules-extern-unrelated.m and ClangScanDeps/

[clang] [z/OS][SystemZ] Clang dependency files are text files (PR #121849)

2025-01-06 Thread Kai Nacke via cfe-commits
https://github.com/redstar created https://github.com/llvm/llvm-project/pull/121849 The dependency file and the P1689 file are text files, but the open call misses the OF_Text flag. This PR adds the flag. Fixes regressions in test cases ClangScanDeps/modules-extern-unrelated.m and ClangScanDeps/

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #118580)

2025-01-06 Thread Adam Yang via cfe-commits
@@ -9272,6 +9272,8 @@ def err_typecheck_expect_scalar_or_vector : Error< "a vector of such type is required">; def err_typecheck_expect_any_scalar_or_vector : Error< "invalid operand of type %0 where a scalar or vector is required">; +def err_typecheck_expect_scalar_or_vect

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-06 Thread David Pagan via cfe-commits
ddpagan wrote: > Update OpenMPSupport.rst New 'align' modifier added to implemented features list. https://github.com/llvm/llvm-project/pull/121814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #118580)

2025-01-06 Thread Adam Yang via cfe-commits
https://github.com/adam-yang updated https://github.com/llvm/llvm-project/pull/118580 >From d435e26eb327b4d6c1e3530586b97372292ce214 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Fri, 18 Oct 2024 10:49:18 -0700 Subject: [PATCH 1/5] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic -

  1   2   3   4   5   6   >