[clang] [clang-repl] Fix undefined lld::wasm::link symbol while building clangInterpreter for wasm (PR #113446)

2024-10-24 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-m68k-linux-cross` running on `suse-gary-m68k-cross` while building `clang` at step 5 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/1004 Here is the relevant piece o

[clang] [LoongArch] fix description of clang option -m[no-]lam-bh (PR #113632)

2024-10-24 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/113632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang]: enhance handling of [[deprecated]] attribute diagnostics for local variables (PR #113575)

2024-10-24 Thread via cfe-commits
@@ -424,6 +424,8 @@ Improvements to Clang's diagnostics name was a reserved name, which we improperly allowed to suppress the diagnostic. +- Clang now diagnoses [[deprecated]] attribute usage on local variables (#GH90073). Sirraide wrote: ```suggestion -

[clang] [llvm] [ci] New script to generate test reports as Buildkite Annotations (PR #113447)

2024-10-24 Thread David Spickett via cfe-commits
@@ -0,0 +1,328 @@ +# Script to parse many JUnit XML result files and send a report to the buildkite +# agent as an annotation. +# +# To run the unittests: +# python3 -m unittest discover -p generate_test_report.py + +import argparse +import unittest +from io import StringIO +from

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Ming-Yi Lai via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck -check-prefix=NOTIGNORELISTED %s +// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s | FileChec

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Ming-Yi Lai via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck -check-prefix=NOTIGNORELISTED %s +// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s | FileChec

[clang] [llvm] [ci] New script to generate test reports as Buildkite Annotations (PR #113447)

2024-10-24 Thread David Spickett via cfe-commits
@@ -0,0 +1,328 @@ +# Script to parse many JUnit XML result files and send a report to the buildkite +# agent as an annotation. +# +# To run the unittests: +# python3 -m unittest discover -p generate_test_report.py + +import argparse +import unittest +from io import StringIO +from

[clang] [HLSL][NFC] Cleanup - removed unused function, includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/113649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/113643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang]: enhance handling of [[deprecated]] attribute diagnostics for local variables (PR #113575)

2024-10-24 Thread via cfe-commits
@@ -182,6 +182,12 @@ static bool ShouldDiagnoseAvailabilityInContext( return false; } + if (K == AR_Deprecated) { +if (const auto *VD = dyn_cast(OffendingDecl)) + if (VD->isLocalVarDecl() && VD->isDeprecated()) Sirraide wrote: ```suggestion

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-24 Thread Owen Pan via cfe-commits
@@ -164,6 +164,40 @@ TEST_F(MatchFilePathTest, Path) { EXPECT_FALSE(match("foo\\", R"(foo*\)")); } +TEST_F(MatchFilePathTest, DoubleAsterisk) { + EXPECT_TRUE(match("a/b/c/d.cpp", "**b**")); + EXPECT_TRUE(match("a/b/c/d.cpp", "**/b/**")); + EXPECT_TRUE(match("a/b/c/d_e.cpp

[clang] [llvm] [RISCV] Add Supm extension to RVA23 profiles (PR #113619)

2024-10-24 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/113619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/113649.diff 4 Files Affected: - (modified) clang/lib/Sema/HLSLExternalSemaSource.cpp (+2-13) - (modified) clang/test/AST/HLSL/RWBuffer-AST.hlsl (+1

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/113649.diff 4 Files Affected: - (modified) clang/lib/Sema/HLSLExternalSemaSource.cpp (+2-13) - (modified) clang/test/AST/HLSL/RWBuffer-AST.hlsl (+1-

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/113649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Supm extension to RVA23 profiles (PR #113619)

2024-10-24 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. (And it's time to mask RV[A|B|M]23 as non-experimental now?) https://github.com/llvm/llvm-project/pull/113619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes Adds `RasterizerOrderedStructuredBuffer` definition to HLSLExternalSemaSource. Adds separate tests for the AST shape and element types. Adds constructor/handle.fromBinding and subscript test cases to shared t

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Helena Kotas (hekota) Changes Adds `AppendStructuredBuffer` and `ConsumeStructuredBuffer` definition to HLSLExternalSemaSource. Adds separate tests for the AST shape and element types, and adds constructor/handle.fromBinding test case to s

[clang] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/113648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add Append/ConsumeStructuredBuffer definitions to HLSLExternalSemaSource (PR #113643)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/113643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Mark pointer masking extensions as non-experimental (PR #113618)

2024-10-24 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/113618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Mark pointer masking extensions as non-experimental (PR #113618)

2024-10-24 Thread Pengcheng Wang via cfe-commits
@@ -26,5 +26,5 @@ entry: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(read) declare @llvm.masked.gather.nxv4i32.nxv4p0(, i32 immarg, , ) #1 -attributes #0 = { "target-features"="+64bit,+d,+f,+relax,+v,+xsifivecdiscarddlone,+zicsr,+zve32f,+zve32x,+zve

[clang] [llvm] [RISCV] Mark pointer masking extensions as non-experimental (PR #113618)

2024-10-24 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/113618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (PR #110222)

2024-10-24 Thread Ryosuke Niwa via cfe-commits
@@ -63,18 +63,29 @@ std::optional isUncounted(const clang::CXXRecordDecl* Class); /// class, false if not, std::nullopt if inconclusive. std::optional isUncountedPtr(const clang::QualType T); -/// \returns true if Name is a RefPtr, Ref, or its variant, false if not. -bool isR

[clang] [flang] [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (PR #110063)

2024-10-24 Thread Yusuke MINATO via cfe-commits
https://github.com/yus3710-fj closed https://github.com/llvm/llvm-project/pull/110063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 96bb375 - [flang] Integrate the option -flang-experimental-integer-overflow into -fno-wrapv (#110063)

2024-10-24 Thread via cfe-commits
Author: Yusuke MINATO Date: 2024-10-25T15:20:23+09:00 New Revision: 96bb375f5cedcfcc5dcd96296ba54ff933b39d4d URL: https://github.com/llvm/llvm-project/commit/96bb375f5cedcfcc5dcd96296ba54ff933b39d4d DIFF: https://github.com/llvm/llvm-project/commit/96bb375f5cedcfcc5dcd96296ba54ff933b39d4d.diff

[clang] [clang][dataflow] Add a lattice to help cache const accessor methods (PR #111006)

2024-10-24 Thread Jan Voung via cfe-commits
@@ -0,0 +1,218 @@ +//===-- CachedConstAccessorsLattice.h ---*- 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-Identifier: Ap

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes Currently, we store injected template arguments in `RedeclarableTemplateDecl::CommonBase`. This approach has a couple problems: 1. We can only access the injected template arguments of `Redeclarabl

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread Dan Liew via cfe-commits
@@ -3343,6 +3363,8 @@ class CountAttributedType final static bool classof(const Type *T) { return T->getTypeClass() == CountAttributed; } + + StringRef GetAttributeName(bool WithMacroPrefix) const; delcypher wrote: I filed #113585 to track fixing this

[clang] [flang] [flang] Support -mabi=vec-extabi and -mabi=vec-default on AIX (PR #113215)

2024-10-24 Thread Kelvin Li via cfe-commits
https://github.com/kkwli updated https://github.com/llvm/llvm-project/pull/113215 >From 3c57a70bf075d17bf9001bd6ec505170179ace9b Mon Sep 17 00:00:00 2001 From: Kelvin Li Date: Fri, 18 Oct 2024 23:25:27 -0400 Subject: [PATCH 1/3] [flang] Support -mabi=vec-extabi and -mabi=vec-default on AIX --

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -2445,6 +2445,26 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { return !isFunctionType(); } + /// \returns True if the type is incomplete and it is also a type that + /// cannot be completed by a later type definition. + /// + /// E.g. For

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113649 None >From 0dbe1b5888b93d6996e89351617e027d6828 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:27:07 -0700 Subject: [PATCH] [HLSL][NFC] Cleanup - removed unused includes and param, fix

[clang] [Driver] Use != instead of compare to compare strings (NFC) (PR #113651)

2024-10-24 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/113651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3a4cceb - [Driver] Use != instead of compare to compare strings (NFC) (#113651)

2024-10-24 Thread via cfe-commits
Author: Kazu Hirata Date: 2024-10-24T23:15:19-07:00 New Revision: 3a4ccebb5c5142c15fb6d72aedadb27205ef33d5 URL: https://github.com/llvm/llvm-project/commit/3a4ccebb5c5142c15fb6d72aedadb27205ef33d5 DIFF: https://github.com/llvm/llvm-project/commit/3a4ccebb5c5142c15fb6d72aedadb27205ef33d5.diff L

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Jesse Huang via cfe-commits
@@ -607,6 +607,9 @@ class RISCVTargetCodeGenInfo : public TargetCodeGenInfo { auto *Fn = cast(GV); Fn->addFnAttr("interrupt", Kind); + +if (CGM.getCodeGenOpts().CFProtectionReturn) jaidTw wrote: Fixed, thanks! https://github.com/llvm/llvm-project

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Jesse Huang via cfe-commits
jaidTw wrote: Addressed comments https://github.com/llvm/llvm-project/pull/112477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Jesse Huang via cfe-commits
https://github.com/jaidTw updated https://github.com/llvm/llvm-project/pull/112477 >From fe4a28fb691b69d9af384f1dc2f0667761adef44 Mon Sep 17 00:00:00 2001 From: Jesse Huang Date: Sun, 13 Oct 2024 15:11:06 +0800 Subject: [PATCH 1/4] [Clang][RISCV] Support -fcf-protection=return for RISC-V ---

[libcxx] [libcxxabi] [libunwind] [llvm] Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (PR #113653)

2024-10-24 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo closed https://github.com/llvm/llvm-project/pull/113653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix undefined lld::wasm::link symbol while building clangInterpreter for wasm (PR #113446)

2024-10-24 Thread via cfe-commits
github-actions[bot] wrote: @anutosh491 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 bui

[clang] 075581f - [clang-repl] Fix undefined lld::wasm::link symbol while building clangInterpreter for wasm (#113446)

2024-10-24 Thread via cfe-commits
Author: Anutosh Bhat Date: 2024-10-25T09:09:14+03:00 New Revision: 075581f34035c01659cc883d0d69336c279ef0d5 URL: https://github.com/llvm/llvm-project/commit/075581f34035c01659cc883d0d69336c279ef0d5 DIFF: https://github.com/llvm/llvm-project/commit/075581f34035c01659cc883d0d69336c279ef0d5.diff

[clang] [clang-repl] Fix undefined lld::wasm::link symbol while building clangInterpreter for wasm (PR #113446)

2024-10-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/113446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix undefined lld::wasm::link symbol while building clangInterpreter for wasm (PR #113446)

2024-10-24 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. Unfortunately this feature is only tested externally... LGTM! https://github.com/llvm/llvm-project/pull/113446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2024-10-24 Thread via cfe-commits
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) { " int foo;\n" "};", Style); - verifyFormat("export {\n" - " int foo;\n" - "};", - Style); + verifyFormat("export { int f

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/106321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -8207,6 +8207,14 @@ ExprResult InitializationSequence::Perform(Sema &S, Kind.getRange().getEnd()); } else { CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type); +// Note the return value isn't used to return early +// to pres

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { Sirraide wrote: > [#108631](https://github.com/llvm/llvm-

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -2440,6 +2440,26 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { return !isFunctionType(); } + /// \returns True if the type is incomplete and it is also a type that + /// cannot be completed by a later type definition. + /// + /// E.g. For

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,216 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // This is an approximation that's not quite right. This points to the +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { Sirraide wrote: I think this function can just be inlined

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread via cfe-commits
@@ -0,0 +1,584 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s + +#define __counted_by(f) __attribute__((counted_by(f))) + +// =

[clang] Update std symbols mapping (fixes #113494) (PR #113612)

2024-10-24 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] [llvm] [DXIL][SPIRV] Lower WaveActiveCountBits intrinsic (PR #113382)

2024-10-24 Thread Greg Roth via cfe-commits
@@ -1762,6 +1765,36 @@ bool SPIRVInstructionSelector::selectSign(Register ResVReg, return Result; } +bool SPIRVInstructionSelector::selectWaveActiveCountBits( +Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const { + assert(I.getNumOperands() == 3); + as

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2024-10-24 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/101350 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-10-24 Thread Dan Liew via cfe-commits
@@ -186,4 +218,370 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +SourceRange Sema::BoundsSafetySourceRangeFor(const CountAttributedType *CATy) { + // Note: This implementation relies on `CountAttributedType` being uniqu

[clang] [analyzer] Untangle subcheckers of CStringChecker (PR #113312)

2024-10-24 Thread Balazs Benics via cfe-commits
@@ -579,8 +579,14 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C, // These checks are either enabled by the CString out-of-bounds checker // explicitly or implicitly by the Malloc checker. // In the latter case we only do modeling but do not emi

[clang] [llvm] [AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (PR #94647)

2024-10-24 Thread Jun Wang via cfe-commits
@@ -683,6 +706,59 @@ struct AAAMDAttributesFunction : public AAAMDAttributes { return !A.checkForAllCallLikeInstructions(DoesNotRetrieve, *this, UsedAssumedInformation); } + + // Returns true if FlatScratchInit is needed, i.e

[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler (PR #108357)

2024-10-24 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: > Actually this PR is the case of > https://lab.llvm.org/buildbot/#/builders/164/builds/3908, not #113491 Sorry about that. Are you able to dig up any of the cmake configure logs from these builds, so that we can figure out how this ends up breaking things? Because as in most

[libcxx] [libcxxabi] [libunwind] [llvm] Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (PR #113653)

2024-10-24 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: Sure, if this is the one that is breaking things. Thanks for looking into it, and sorry for the breakage! https://github.com/llvm/llvm-project/pull/113653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (PR #110222)

2024-10-24 Thread Rashmi Mudduluru via cfe-commits
@@ -63,18 +63,29 @@ std::optional isUncounted(const clang::CXXRecordDecl* Class); /// class, false if not, std::nullopt if inconclusive. std::optional isUncountedPtr(const clang::QualType T); -/// \returns true if Name is a RefPtr, Ref, or its variant, false if not. -bool isR

[clang] [Driver] Use != instead of compare to compare strings (NFC) (PR #113651)

2024-10-24 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/113651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libcxxabi] [libunwind] [llvm] Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (PR #113653)

2024-10-24 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/113653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-24 Thread via cfe-commits
MichelleCDjunaidi wrote: Main history should be resolved now. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libcxxabi] [libunwind] [llvm] Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (PR #113653)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-libunwind Author: Vitaly Buka (vitalybuka) Changes Reverts llvm/llvm-project#108357 Breaks https://lab.llvm.org/buildbot/#/builders/164/builds/3908 and similar bots --- Full diff: https://github.com/llvm/llvm-project/pull/113653.diff 6 Files Affect

[libcxx] [libcxxabi] [libunwind] [llvm] Revert "[runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler" (PR #113653)

2024-10-24 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/113653 Reverts llvm/llvm-project#108357 Breaks https://lab.llvm.org/buildbot/#/builders/164/builds/3908 and similar bots >From bcc6c988acdd2e6fba38f373abc3e090b3b70581 Mon Sep 17 00:00:00 2001 From: Vitaly Buka

[clang] [WebKit Checkers] Make TrivialFunctionAnalysis recognize std::array::operator[] as trivial (PR #113377)

2024-10-24 Thread Ryosuke Niwa via cfe-commits
@@ -452,6 +454,10 @@ class RefCounted { unsigned nonTrivial23() { return DerivedNumber("123").value(); } SomeType nonTrivial24() { return SomeType("123"); } + void call_libcpp_verbose_abort() { + __libcpp_verbose_abort("%s", "aborting"); rniwa wrote:

[libcxx] [libcxxabi] [libunwind] [llvm] [runtimes] Probe for -nostdlib++ and -nostdinc++ with the C compiler (PR #108357)

2024-10-24 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Actually this PR is the case of https://lab.llvm.org/buildbot/#/builders/164/builds/3908, not https://github.com/llvm/llvm-project/pull/113491 https://github.com/llvm/llvm-project/pull/108357 ___ cfe-commits mailing list cfe-commits

[clang] [analyzer] Fix a crash from element region construction during `ArrayInitLoopExpr` analysis (PR #113570)

2024-10-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Could you please add `no-crash` comment in the test code where we would have crashed? Other than this, this looks good to me. Thabks for the prompt fix! https://github.com/llvm/llvm-project/pull/113570

[clang] [Driver] Use != instead of compare to compare strings (NFC) (PR #113651)

2024-10-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/113651.diff 1 Files Affected: - (modified) clang/lib/Driver/ToolChains/Clang.cpp (+5-5) ``diff diff --git a/clang/lib/Drive

[clang] [Driver] Use != instead of compare to compare strings (NFC) (PR #113651)

2024-10-24 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/113651 None >From 0e6ea5f32dc77ba2c81f45d6530e301da85e6e91 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 24 Oct 2024 15:59:14 -0700 Subject: [PATCH] [Driver] Use != instead of compare to compare strings

[clang] [compiler-rt] [llvm] [X86] Support MOVRS and AVX10.2 instructions. (PR #113274)

2024-10-24 Thread Mikael Holmén via cfe-commits
@@ -0,0 +1,98 @@ +// RUN: %clang_cc1 -ffreestanding %s -Wno-implicit-function-declaration -triple=i386-unknown-unknown -target-feature +movrs -target-feature +avx10.2-256 -emit-llvm -verify mikaelholmen wrote: Same thing here, can we remove "-emit-llvm" since w

[clang] [compiler-rt] [llvm] [X86] Support MOVRS and AVX10.2 instructions. (PR #113274)

2024-10-24 Thread Mikael Holmén via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %clang_cc1 -ffreestanding %s -Wno-implicit-function-declaration -triple=i386-- -target-feature +movrs -target-feature +avx10.2-512 -emit-llvm -verify mikaelholmen wrote: Since we don't care about the actual output, can we remove "-emit

[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

2024-10-24 Thread via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -verify + +void test_no_second_arg(double D) { + __builtin_hlsl_elementwise_splitdouble(D); + // expected-error@-1 {{too few arguments to function call, exp

[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Jesse Huang via cfe-commits
https://github.com/jaidTw updated https://github.com/llvm/llvm-project/pull/112477 >From fe4a28fb691b69d9af384f1dc2f0667761adef44 Mon Sep 17 00:00:00 2001 From: Jesse Huang Date: Sun, 13 Oct 2024 15:11:06 +0800 Subject: [PATCH 1/3] [Clang][RISCV] Support -fcf-protection=return for RISC-V ---

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-24 Thread Peilin Ye via cfe-commits
peilin-ye wrote: > So your change looks good. Once you get some kernel work in reasonable shape, > this patch can land. Thanks! Sure, thanks for reviewing this! https://github.com/llvm/llvm-project/pull/108636 ___ cfe-commits mailing list cfe-commits

[clang] Initial implementation of P2719 (PR #113510)

2024-10-24 Thread Chuanqi Xu via cfe-commits
@@ -1,6 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 \ // RUN:-Wno-coroutine-missing-unhandled-exception -emit-llvm %s -o - -disable-llvm-passes \ // RUN: | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 \ +

[clang] [llvm] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

2024-10-24 Thread Kito Cheng via cfe-commits
https://github.com/kito-cheng commented: Test? https://github.com/llvm/llvm-project/pull/112477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-24 Thread Peilin Ye via cfe-commits
@@ -67,6 +67,8 @@ void BPFTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__BPF_FEATURE_SDIV_SMOD"); Builder.defineMacro("__BPF_FEATURE_GOTOL"); Builder.defineMacro("__BPF_FEATURE_ST"); +Builder.defineMacro("__BPF_FEATURE_LOAD_ACQUIRE"

[clang] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (PR #110222)

2024-10-24 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/110222 >From 6e842a0135d097ffcb3c5991bc97543179972405 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 27 Sep 2024 02:05:25 -0700 Subject: [PATCH 1/6] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef This

[clang] [analyzer] Untangle subcheckers of CStringChecker (PR #113312)

2024-10-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I only reviewed this on my phone, but looks promising. I'll leave this PR for the others to finish. I agree with the direction. https://github.com/llvm/llvm-project/pull/113312 ___ cfe-commits mailing list cfe-co

[clang] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (PR #110222)

2024-10-24 Thread Ryosuke Niwa via cfe-commits
@@ -56,7 +60,8 @@ bool tryToFindPtrOrigin( if (StopAtFirstRefCountedObj) { if (auto *ConversionFunc = dyn_cast_or_null(cast->getConversionFunction())) { - if (isCtorOfRefCounted(ConversionFunc)) + if (isCtorOfRefCounted(Conversio

[clang] [HLSL][NFC] Cleanup - removed unused includes and param, fix typos (PR #113649)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/113649 >From 0dbe1b5888b93d6996e89351617e027d6828 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 24 Oct 2024 21:27:07 -0700 Subject: [PATCH 1/2] [HLSL][NFC] Cleanup - removed unused includes and param, fix

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-24 Thread via cfe-commits
MichelleCDjunaidi wrote: Will try to resolve after lunch. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions (PR #113255)

2024-10-24 Thread Chris Apple via cfe-commits
cjappl wrote: Thanks for the quick fix, working for me after I pulled latest main. https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

2024-10-24 Thread Peilin Ye via cfe-commits
@@ -48,6 +48,13 @@ def BPF_END : BPFArithOp<0xd>; def BPF_XCHG: BPFArithOp<0xe>; def BPF_CMPXCHG : BPFArithOp<0xf>; +class BPFAtomicLoadStoreOp val> { + bits<4> Value = val; +} + +def BPF_LOAD_ACQ : BPFAtomicLoadStoreOp<0x1>; +def BPF_STORE_REL : BPFAtomicLoadStoreOp<0xb

[clang] [HLSL] Add RasterizerOrderedStructuredBuffer definition to HLSLExternalSemaSource (PR #113648)

2024-10-24 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/113648 Adds `RasterizerOrderedStructuredBuffer` definition to HLSLExternalSemaSource. Adds separate tests for the AST shape and element types. Adds constructor/handle.fromBinding and subscript test cases to shared test

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-10-24 Thread via cfe-commits
EugeneZelenko wrote: As far as I see from branch's history, it's still outdated `main` (as of September 9). https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (PR #110222)

2024-10-24 Thread Rashmi Mudduluru via cfe-commits
@@ -56,7 +60,8 @@ bool tryToFindPtrOrigin( if (StopAtFirstRefCountedObj) { if (auto *ConversionFunc = dyn_cast_or_null(cast->getConversionFunction())) { - if (isCtorOfRefCounted(ConversionFunc)) + if (isCtorOfRefCounted(Conversio

[clang] [LoongArch] fix description of clang option -m[no-]lam-bh (PR #113632)

2024-10-24 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-ubuntu` running on `linaro-lldb-aarch64-ubuntu` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/7080 Here is the relevant piece of the b

[clang] Emit constrained atan2 intrinsic for clang builtin (PR #113636)

2024-10-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 c03d09ce3eed336fea4d9283232383f6d4d4057d b5a4c777280873e9827bb812b95cad32fbf6b7f4 --e

[clang] [analyzer] Fix a crash from element region construction during `ArrayInitLoopExpr` analysis (PR #113570)

2024-10-24 Thread Balazs Benics via cfe-commits
@@ -330,3 +330,47 @@ void no_crash() { } } // namespace crash + +namespace array_subscript_initializer { steakhal wrote: Could you please put these braces on the same line of the namespace/struct declarations? That way its slightly more compact. https://git

[clang] [analyzer] Fix a crash from element region construction during `ArrayInitLoopExpr` analysis (PR #113570)

2024-10-24 Thread Balazs Benics via cfe-commits
@@ -513,70 +513,25 @@ ProgramStateRef ExprEngine::updateObjectsUnderConstruction( static ProgramStateRef bindRequiredArrayElementToEnvironment(ProgramStateRef State, const ArrayInitLoopExpr *AILE, - con

  1   2   3   4   5   >