[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -848,7 +862,21 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - auto *Transformed = Operand; + bool InplaceCall = + isCoroInplaceCall(Operand) && + isAttributedCoroInp

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -15,6 +15,7 @@ #include "CoroutineStmtBuilder.h" #include "clang/AST/ASTLambda.h" +#include "clang/AST/ComputeDependence.h" ChuanqiXu9 wrote: Is this used? https://github.com/llvm/llvm-project/pull/99282 ___ cfe

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -5443,24 +5444,38 @@ RValue CodeGenFunction::EmitRValueForField(LValue LV, //======// RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, - ReturnValueSlot ReturnValu

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -8278,4 +8307,3 @@ Declares that a function potentially allocates heap memory, and prevents any pot of ``nonallocating`` by the compiler. }]; } - ChuanqiXu9 wrote: Unnecessary change https://github.com/llvm/llvm-project/pull/99282 __

[clang] [llvm] [HLSL] Add list of exported functions as named metadata node 'dx.exports` (PR #102275)

2024-08-06 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 bacb534e583ef439bcaf6627dab96945d43cdbf6 340834e9c1ea12c8de4ee9f5a6b7c0191e96f489 --e

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

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

[clang] [llvm] [HLSL] Add list of exported functions as named metadata node 'dx.exports` (PR #102275)

2024-08-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/102275 Adds list of exported functions as named metadata node 'dx.exports`. During CodeGen each exported functions is marked with an "hlsl.export" attribute. Based on these attributes the DXILTranslateMetadata pass wil

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-06 Thread via cfe-commits
https://github.com/yingopq updated https://github.com/llvm/llvm-project/pull/99615 >From 444cd83d070600a26938514070d79dc900946868 Mon Sep 17 00:00:00 2001 From: Ying Huang Date: Fri, 19 Jul 2024 04:19:09 -0400 Subject: [PATCH] [clang] Support -Wa, options -mmsa and -mno-msa --- clang/include/

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

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

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Fangrui Song (MaskRay) Changes This reverts commit 0fa20c55b58deb94090985a5c5ffda4d5ceb3cd1. Storing raw symbol names is generally preferred in profile files. Demangling might lose information. Some platforms might use different demangli

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Fangrui Song (MaskRay) Changes This reverts commit 0fa20c55b58deb94090985a5c5ffda4d5ceb3cd1. Storing raw symbol names is generally preferred in profile files. Demangling might lose information. Some platforms might use different dem

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Fangrui Song (MaskRay) Changes This reverts commit 0fa20c55b58deb94090985a5c5ffda4d5ceb3cd1. Storing raw symbol names is generally preferred in profile files. Demangling might lose information. Some platforms might use different demangling

[clang] [llvm] Revert "demangle function names in trace files (#87626)" (PR #102274)

2024-08-06 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/102274 This reverts commit 0fa20c55b58deb94090985a5c5ffda4d5ceb3cd1. Storing raw symbol names is generally preferred in profile files. Demangling might lose information. Some platforms might use different demangling sc

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/102227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] [clang][ASTMatcher] Add `matches` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

2024-08-06 Thread via cfe-commits
https://github.com/Gitspike updated https://github.com/llvm/llvm-project/pull/102152 >From c74cea916b5efe739de8a4dc6f63d583f5a46da3 Mon Sep 17 00:00:00 2001 From: hehouhua Date: Wed, 7 Aug 2024 11:55:30 +0800 Subject: [PATCH] [clang][ASTMatcher] Add matches for StringLiteral which matches lite

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] [llvm] [RISCV] Add vector and vector crypto to SiFiveP400 scheduler model (PR #102155)

2024-08-06 Thread Pengcheng Wang via cfe-commits
@@ -45,6 +154,13 @@ defvar SiFiveP400FloatArith = SiFiveP400FEXQ0; defvar SiFiveP400F2I = SiFiveP400FEXQ0; def SiFiveP400FloatDiv: ProcResource<1>; +// Vector pipeline +def SiFiveP400VEXQ0: ProcResource<1>; wangpc-pp wrote: So there is 1 vec

[clang] [clang][ASTMatcher] Add `matches` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)

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

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread via cfe-commits
@@ -288,6 +288,8 @@ AST Matchers - Fixed an issue with the `hasName` and `hasAnyName` matcher when matching inline namespaces with an enclosing namespace of the same name. +- Add ``matches``. Gitspike wrote: fixed,thanks https://github.com/llvm/llvm-projec

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread via cfe-commits
@@ -5582,6 +5582,20 @@ Narrowing Matchers +MatcherStringLiteral>matchesStringRef RegExp, Regex::RegexFlags Flags = NoFlags Gitspike wrote: fixed,thanks https://github.com/llvm/llvm-project

[clang] [llvm] [LLVM][PassBuilder] Extend the function signature of callback for optimizer pipeline extension point (PR #100953)

2024-08-06 Thread Shilei Tian via cfe-commits
https://github.com/shiltian updated https://github.com/llvm/llvm-project/pull/100953 >From 0110da5be4f0430826bac7ede96bc71b238ef0fc Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Sun, 28 Jul 2024 15:28:09 -0400 Subject: [PATCH] [LLVM][PassBuilder] Extend the function signature of callback fo

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread via cfe-commits
https://github.com/Gitspike updated https://github.com/llvm/llvm-project/pull/102152 >From 994e693ed246df662f757c69035d54f62639b560 Mon Sep 17 00:00:00 2001 From: hehouhua Date: Tue, 6 Aug 2024 22:17:00 +0800 Subject: [PATCH 1/3] [clang][ASTMatcher] Add matcher for 'matches' Add Matcher matche

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread via cfe-commits
https://github.com/Gitspike updated https://github.com/llvm/llvm-project/pull/102152 >From 994e693ed246df662f757c69035d54f62639b560 Mon Sep 17 00:00:00 2001 From: hehouhua Date: Tue, 6 Aug 2024 22:17:00 +0800 Subject: [PATCH 1/2] [clang][ASTMatcher] Add matcher for 'matches' Add Matcher matche

[clang] [llvm] [RISCV] Add vector and vector crypto to SiFiveP400 scheduler model (PR #102155)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -45,6 +154,13 @@ defvar SiFiveP400FloatArith = SiFiveP400FEXQ0; defvar SiFiveP400F2I = SiFiveP400FEXQ0; def SiFiveP400FloatDiv: ProcResource<1>; +// Vector pipeline +def SiFiveP400VEXQ0: ProcResource<1>; topperc wrote: There is an issue q

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] [llvm] [RISCV] Add vector and vector crypto to SiFiveP400 scheduler model (PR #102155)

2024-08-06 Thread Pengcheng Wang via cfe-commits
@@ -45,6 +154,13 @@ defvar SiFiveP400FloatArith = SiFiveP400FEXQ0; defvar SiFiveP400F2I = SiFiveP400FEXQ0; def SiFiveP400FloatDiv: ProcResource<1>; +// Vector pipeline +def SiFiveP400VEXQ0: ProcResource<1>; wangpc-pp wrote: `EXQ0` means `exe

[clang] [llvm] [RISCV] Add sifive-p470 processor (PR #102022)

2024-08-06 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/102022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add sifive-p470 processor (PR #102022)

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

[clang] [llvm] [LLVM][PassBuilder] Extend the function signature of callback for optimizer pipeline extension point (PR #100953)

2024-08-06 Thread Shilei Tian via cfe-commits
shiltian wrote: This PR will not be needed if we decide to move `AMDGPUAttributorPass` to full LTO stage (https://github.com/llvm/llvm-project/pull/102086). https://github.com/llvm/llvm-project/pull/100953 ___ cfe-commits mailing list cfe-commits@list

[clang] [C++20] [Modules] Don't set modules owner ship information for builtin declarations (PR #102115)

2024-08-06 Thread Chuanqi Xu via cfe-commits
@@ -2376,6 +2376,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); + // Builtin functions shouldn't be owned by any module. + if (New->hasOwningModule(

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/102226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 030ee84 - Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (#102226)

2024-08-06 Thread via cfe-commits
Author: Joseph Huber Date: 2024-08-06T21:33:25-05:00 New Revision: 030ee841a9c9fbbd6e7c001e751737381da01f7b URL: https://github.com/llvm/llvm-project/commit/030ee841a9c9fbbd6e7c001e751737381da01f7b DIFF: https://github.com/llvm/llvm-project/commit/030ee841a9c9fbbd6e7c001e751737381da01f7b.diff

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread Ding Fei via cfe-commits
@@ -288,6 +288,8 @@ AST Matchers - Fixed an issue with the `hasName` and `hasAnyName` matcher when matching inline namespaces with an enclosing namespace of the same name. +- Add ``matches``. danix800 wrote: ```suggestion - Add `matches` for `StringLiteral`

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread Ding Fei via cfe-commits
@@ -5582,6 +5582,20 @@ Narrowing Matchers +MatcherStringLiteral>matchesStringRef RegExp, Regex::RegexFlags Flags = NoFlags danix800 wrote: ```suggestion Matcher

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-06 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM. Thanks for the offline discussion @lei137 https://github.com/llvm/llvm-project/pull/101390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][ASTMatcher] Add matcher for 'matches' (PR #102152)

2024-08-06 Thread via cfe-commits
https://github.com/Gitspike updated https://github.com/llvm/llvm-project/pull/102152 >From 994e693ed246df662f757c69035d54f62639b560 Mon Sep 17 00:00:00 2001 From: hehouhua Date: Tue, 6 Aug 2024 22:17:00 +0800 Subject: [PATCH] [clang][ASTMatcher] Add matcher for 'matches' Add Matcher matches. -

[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

2024-08-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I don't know, but it would be a lot of work, and would likely still mean > preserving the same information as `SubstTemplateTypeParmType` nodes > currently provide. > > Our scope is also larger than what Clang's resugarer aims to do, because for > our purposes sometimes ther

[clang] [clang][driver][clang-cl] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

2024-08-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Maybe something like this: ``` // RUN: rm -rf %t // RUN: split-file %s %t // RUN: %clang %t/fake.pcm -std=c++20 -### 2>&1 | FileCheck %t/fake.pcm //--- fake.pcm // CHECK-NOT: warning ``` https://github.com/llvm/llvm-project/pull/99300 _

[clang] [clang-format] Fix a bug in annotating CastRParen (PR #102261)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #102102. --- Full diff: https://github.com/llvm/llvm-project/pull/102261.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+10-1) - (modified) clang/unittests/Format/TokenAn

[clang] [clang-format] Fix a bug in annotating CastRParen (PR #102261)

2024-08-06 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/102261 Fixes #102102. >From b72a629d16d5bc3ce800a562fd41ba2dfd1fe1eb Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 6 Aug 2024 18:10:20 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating CastRParen Fixe

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -7920,6 +7923,27 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, ParsedAttr &attr, CallingConv CCOld = fn->getCallConv(); Attr *CCAttr = getCCTypeAttr(S.Context, attr); + if (attr.getKind() == ParsedAttr::AT_RISCVVLSCC) { +// If the riscv_abi_vle

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -5554,6 +5554,17 @@ them if they use them. }]; } +def RISCVVLSCCDocs : Documentation { + let Category = DocCatCallingConvs; + let Heading = "riscv::vls_cc, riscv_vls_cc, clang::riscv_vls_cc"; + let Content = [{ +The ``riscv_vls_cc`` attribute can be applied to a function.

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -2206,6 +2206,21 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args, << A->getSpelling() << Val; } } + + if (Arg *A = Args.getLastArg(options::OPT_mriscv_abi_vlen_EQ)) { +StringRef ABIVLenStr = A->getValue(); +unsigned ABIVLen; +const Driver &

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -4768,6 +4768,25 @@ static void handleCallConvAttr(Sema &S, Decl *D, const ParsedAttr &AL) { case ParsedAttr::AT_RISCVVectorCC: D->addAttr(::new (S.Context) RISCVVectorCCAttr(S.Context, AL)); return; + case ParsedAttr::AT_RISCVVLSCC: { +// If the riscv_abi_vl

[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

2024-08-06 Thread Craig Topper via cfe-commits
@@ -317,38 +323,45 @@ ABIArgInfo RISCVABIInfo::coerceAndExpandFPCCEligibleStruct( // Fixed-length RVV vectors are represented as scalable vectors in function // args/return and must be coerced from fixed vectors. -ABIArgInfo RISCVABIInfo::coerceVLSVector(QualType Ty) const {

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] [Clang] strengthen checks for 'main' function to meet [basic.start.main] p3 requirements (PR #101853)

2024-08-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/101853 >From 56c8d3a8e5f860ec1f68adf997d502849de1cb50 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 4 Aug 2024 00:45:49 +0300 Subject: [PATCH 1/5] [Clang] strengthen checks for 'main' function to meet [basi

[clang] [clang][modules] Enable built-in modules for the upcoming Apple releases (PR #102239)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Ian Anderson (ian-twilightcoder) Changes The upcoming Apple SDK releases will support the clang built-in headers being in the clang built-in modules: stop passing -fbuiltin-headers-in-system-modules for those SDK versions. --- Ful

[clang] [clang][modules] Enable built-in modules for the upcoming Apple releases (PR #102239)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ian Anderson (ian-twilightcoder) Changes The upcoming Apple SDK releases will support the clang built-in headers being in the clang built-in modules: stop passing -fbuiltin-headers-in-system-modules for those SDK versions. --- Full diff:

[clang] [clang][modules] Enable built-in modules for the upcoming Apple releases (PR #102239)

2024-08-06 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder created https://github.com/llvm/llvm-project/pull/102239 The upcoming Apple SDK releases will support the clang built-in headers being in the clang built-in modules: stop passing -fbuiltin-headers-in-system-modules for those SDK versions. >From 529cb1b9ccf

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] [Bounds Safety][NFC] Add some missing coverage for `-fexperimental-late-parse-attributes` (PR #102236)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dan Liew (delcypher) Changes Previously we weren't properly checking that using `-fexperimental-late-parse-attributes` worked on source code that didn't need late parsing. For example we weren't testing that the attribute appearing in th

[clang] [Bounds Safety][NFC] Add some missing coverage for `-fexperimental-late-parse-attributes` (PR #102236)

2024-08-06 Thread Dan Liew via cfe-commits
https://github.com/delcypher created https://github.com/llvm/llvm-project/pull/102236 Previously we weren't properly checking that using `-fexperimental-late-parse-attributes` worked on source code that didn't need late parsing. For example we weren't testing that the attribute appearing in t

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/99656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,194 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent +// the AnalysisBasedWarnings pass from running at all. + +// This diagnostic is re-enabled an

[clang] [Modules][Diagnostic] Mention which AST file's options differ from the current TU options. (PR #101413)

2024-08-06 Thread Volodymyr Sapsai via cfe-commits
@@ -130,7 +130,7 @@ class ASTReaderListener { /// /// \returns true to indicate the options are invalid or false otherwise. virtual bool ReadLanguageOptions(const LangOptions &LangOpts, - bool Complain, +

[clang] [Clang] [Frontend] fix crash on parsing ternary operator with `vector_size` condition (PR #102004)

2024-08-06 Thread Matheus Izvekov via cfe-commits
@@ -6719,6 +6719,16 @@ QualType Sema::CheckVectorConditionalTypes(ExprResult &Cond, ExprResult &LHS, : UsualArithmeticConversions(LHS, RHS, QuestionLoc, ACK_Conditional); +if (ResultElementTy.isNull()) { + Diag(Que

[clang] [clang-format] Change BinPackParameters to an enum to add a BreakAlways (PR #101882)

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

[clang] [clang-format] Change BinPackParameters to an enum to add a BreakAlways (PR #101882)

2024-08-06 Thread via cfe-commits
https://github.com/VolatileAcorn updated https://github.com/llvm/llvm-project/pull/101882 >From e6f04cd8cd22d309a6f6c945c121c77e96371f86 Mon Sep 17 00:00:00 2001 From: Tom Pottage Date: Fri, 2 Aug 2024 20:26:47 +0100 Subject: [PATCH] [clang-format] Deprecate BinPackParameters and add BreakPara

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread Joel E. Denny via cfe-commits
https://github.com/jdenny-ornl approved this pull request. https://github.com/llvm/llvm-project/pull/102226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > Thanks! Can this be fixed on `release/19.x` too? I'm still surprised this made it into the Release, since I'm pretty sure I only landed all of these changes after the fork. But we should be able to backport it from the existing issue. https://github.com/llvm/llvm-project/pul

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread Steven Wu via cfe-commits
cachemeifyoucan wrote: Thanks! Can this be fixed on `release/19.x` too? https://github.com/llvm/llvm-project/pull/102226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-06 Thread Doug Wyatt via cfe-commits
@@ -2397,6 +2397,1262 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { }; } // namespace +// = + +namespace FXAnalysis { + +enum class DiagnosticID : uint8_t { + None = 0, // s

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Chris B (llvm-beanz) Changes HLSL tends to rely pretty aggressively on scalarization occuring in the complier, which allows for some relaxed language behaviors when types are fully sclarized to equivalent scalar representations. This chan

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris B (llvm-beanz) Changes HLSL tends to rely pretty aggressively on scalarization occuring in the complier, which allows for some relaxed language behaviors when types are fully sclarized to equivalent scalar representations. This cha

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/102227 HLSL tends to rely pretty aggressively on scalarization occuring in the complier, which allows for some relaxed language behaviors when types are fully sclarized to equivalent scalar representations. This c

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Joseph Huber (jhuber6) Changes This reverts commit 90ccf2187332ff900d46a58a27cb0353577d37cb. Fixes: https://github.com/llvm/llvm-project/issues/100212 --- Full diff: https://github.com/llvm/llvm-project/pull/102226.diff 3 Files

[clang] Revert "[LinkerWrapper] Extend with usual pass options (#96704)" (PR #102226)

2024-08-06 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/102226 This reverts commit 90ccf2187332ff900d46a58a27cb0353577d37cb. Fixes: https://github.com/llvm/llvm-project/issues/100212 >From 3ddd7a6df3ef85cbfe3f5fc0294817638275d4df Mon Sep 17 00:00:00 2001 From: Joseph Hube

[clang] [llvm] [Clang] Protect ObjCMethodList assignment operator against self-assignment (PR #97933)

2024-08-06 Thread via cfe-commits
https://github.com/smanna12 closed https://github.com/llvm/llvm-project/pull/97933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Protect ObjCMethodList assignment operator against self-assignment (PR #97933)

2024-08-06 Thread via cfe-commits
smanna12 wrote: > I'm sorry, @smanna12, I misread the code earlier and misled you. That > `PunnedPointer` assignment operator I directed you too isn't a copy > assignment operator (it takes a `intptr_t`, not a reference or value of > `PunnedPointer`). Changing that assignment operator won't af

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/102206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Protect ObjCMethodList assignment operator against self-assignment (PR #97933)

2024-08-06 Thread Tom Honermann via cfe-commits
tahonermann wrote: I'm sorry, @smanna12, I misread the code earlier and misled you. That `PunnedPointer` assignment operator I directed you too isn't a copy assignment operator (it takes a `intptr_t`, not a reference or value of `PunnedPointer`). Changing that assignment operator won't affect

[clang] [clang] Inject tokens containing #embed back into token stream (PR #97274)

2024-08-06 Thread Ben Barham via cfe-commits
https://github.com/bnbarham edited https://github.com/llvm/llvm-project/pull/97274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Inject tokens containing #embed back into token stream (PR #97274)

2024-08-06 Thread Ben Barham via cfe-commits
@@ -2123,17 +2123,18 @@ class Preprocessor { char getSpellingOfSingleCharacterNumericConstant(const Token &Tok, bnbarham wrote: Thanks @AaronBallman! https://github.com/llvm/llvm-project/pull/97274 ___ cfe-commit

[clang] Warning Libc functions (PR #101583)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -443,6 +447,314 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +AST_MATCHER(CallExpr, isUnsafeLibcFunctionCall) { + static const std::set PredefinedNames{ + // numeric conversion: + "atof", + "atoi", + "atol", + "atoll

[clang] Warning Libc functions (PR #101583)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -443,6 +448,260 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +AST_MATCHER(CallExpr, isUnsafeLibcFunctionCall) { + static const std::set PredefinedNames{ + // numeric conversion: + "atof", + "atoi", + "atol", + "atoll

[clang] [llvm] demangle function names in trace files (PR #87626)

2024-08-06 Thread Reid Kleckner via cfe-commits
rnk wrote: I think I'll leave this change in and file an issue about it. A 10% compile time regression with `-ftime-trace` isn't great, but it doesn't feel revert-worthy. https://github.com/llvm/llvm-project/pull/87626 ___ cfe-commits mailing list cf

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-08-06 Thread Ahmed Bougacha via cfe-commits
@@ -1056,12 +1056,18 @@ class ConstantPtrAuth final : public Constant { return !getAddrDiscriminator()->isNullValue(); } - /// A constant value for the address discriminator which has special - /// significance to ctors/dtors lowering. Regular address discrimination c

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-08-06 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Ok, it took me a moment to understand what was happening here - I had to talk to Ahmed because I didn't recognize the AddrDiscriminator_* enums and had assumed I'd forgotten them :D This needs to update `ItaniumRTTIBuilder::BuildVTablePointer` to take the storage address, and t

[clang] [clang][driver][clang-cl] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

2024-08-06 Thread Sharadh Rajaraman via cfe-commits
https://github.com/sharadhr updated https://github.com/llvm/llvm-project/pull/99300 >From 51e74869c87de8ed8b37e7a9391428f3dfc1ac1a Mon Sep 17 00:00:00 2001 From: Sharadh Rajaraman Date: Sun, 14 Jul 2024 11:05:57 +0100 Subject: [PATCH 1/2] `TY_ModuleFile` should be a 'CXX' file type --- clang/

[clang] [clang][driver][clang-cl] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

2024-08-06 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 2e9f15e1dfd8bc90d0cd91157c8b3b036cee981e cbe5a79ca48a888917863dd807ebcfefb2385d74 --e

[clang] [clang][driver][clang-cl] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

2024-08-06 Thread Sharadh Rajaraman via cfe-commits
sharadhr wrote: Not quite sure how to handle the test for this; I'm struggling to find a `.pcm` file that can be used. https://github.com/llvm/llvm-project/pull/99300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang][driver][clang-cl] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

2024-08-06 Thread Sharadh Rajaraman via cfe-commits
https://github.com/sharadhr updated https://github.com/llvm/llvm-project/pull/99300 >From 51e74869c87de8ed8b37e7a9391428f3dfc1ac1a Mon Sep 17 00:00:00 2001 From: Sharadh Rajaraman Date: Sun, 14 Jul 2024 11:05:57 +0100 Subject: [PATCH 1/2] `TY_ModuleFile` should be a 'CXX' file type --- clang/

[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

2024-08-06 Thread Oliver Hunt via cfe-commits
@@ -3955,9 +3955,23 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) { VTable, Two); } - if (auto &Schema = CGM.getCodeGenOpts().PointerAuth.CXXTypeInfoVTablePointer) -VTable = CGM.getConstantSigne

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -0,0 +1,180 @@ +// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \ +// RUN:-fsafe-buffer-usage-suggestions -verify %s + +using size_t = __typeof(sizeof(int)); + +namespace std { + class type_info; + class bad_cast; + class bad_typeid; + + template class span

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -926,22 +926,27 @@ class CArrayToPtrAssignmentGadget : public FixableGadget { /// A call of a function or method that performs unchecked buffer operations /// over one of its pointer parameters. class UnsafeBufferUsageAttrGadget : public WarningGadget { - constexpr static c

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -6835,6 +6837,31 @@ the proper solution would be to create a different function (possibly an overload of ``baz()``) that accepts a safe container like ``bar()``, and then use the attribute on the original ``baz()`` to help the users update their code to use the new function

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
@@ -6835,6 +6837,31 @@ the proper solution would be to create a different function (possibly an overload of ``baz()``) that accepts a safe container like ``bar()``, and then use the attribute on the original ``baz()`` to help the users update their code to use the new function

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ commented: Ok technical part looks good! https://github.com/llvm/llvm-project/pull/101585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-06 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/101585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread via cfe-commits
@@ -5838,7 +5839,7 @@ QualType TreeTransform::TransformDependentAddressSpaceType( } else { TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo( Result, getDerived().getBaseLocation()); -TransformType(TLB, DI->getTypeLoc()); +TLB.TypeWasModifie

[clang] [llvm] [OpenMP] OpenMP 5.1 "assume" directive parsing support (PR #92731)

2024-08-06 Thread Julian Brown via cfe-commits
jtb20 wrote: Thank you for the update! https://github.com/llvm/llvm-project/pull/92731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread Johannes Doerfert via cfe-commits
@@ -5838,7 +5839,7 @@ QualType TreeTransform::TransformDependentAddressSpaceType( } else { TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo( Result, getDerived().getBaseLocation()); -TransformType(TLB, DI->getTypeLoc()); +TLB.TypeWasModifie

  1   2   3   4   5   >