[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/71039 The goal of this patch is to refine how the `SVal` base and sub-kinds are represented by forming one unified enum describing the possible SVals. This means that the `unsigned SVal::Kind` and the attached

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balazs Benics (steakhal) Changes The goal of this patch is to refine how the `SVal` base and sub-kinds are represented by forming one unified enum describing the possible SVals. This means that the `unsigned SVal::Kind`

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Balazs Benics via cfe-commits
steakhal wrote: This PR relates to #69835 ([comment](https://github.com/llvm/llvm-project/issues/69835#issuecomment-1775533393)). https://github.com/llvm/llvm-project/pull/71039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] Remove experimental from Vector Crypto extensions (PR #69000)

2023-11-02 Thread Brandon Wu via cfe-commits
4vtomat wrote: Since it's possible that **ISA spec** and **intrinsics spec** are not synchronized, so the updates add an dummy extension called **zexperimental**, once `-menable-experimental-extensions` is specified, the feature `zexperimental` is automatically added. If specifying `let

[clang] [clang-tools-extra] [compiler-rt] [flang] [llvm] [AMDGPU] Fold operand after shrinking instruction in SIFoldOperands (PR #68426)

2023-11-02 Thread Jay Foad via cfe-commits
@@ -290,37 +291,40 @@ bool SIFoldOperands::updateOperand(FoldCandidate ) const { if (Fold.Commuted) TII->commuteInstruction(*Inst32, false); -return true; - } - assert(!Fold.needsShrink() && "not handled"); +Fold.UseMI = Inst32; +Fold.UseOpNo =

[clang] [clang-tools-extra] [compiler-rt] [flang] [llvm] [AMDGPU] Fold operand after shrinking instruction in SIFoldOperands (PR #68426)

2023-11-02 Thread Jay Foad via cfe-commits
https://github.com/jayfoad converted_to_draft https://github.com/llvm/llvm-project/pull/68426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -216,11 +216,12 @@ void PreferMemberInitializerCheck::check( return; } -const FieldDecl *Field = nullptr; -const Expr *InitValue = nullptr; -std::tie(Field, InitValue) = isAssignmentToMemberOf(Class, S, Ctor); -if (!Field) +std::optional> +

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
@@ -118,45 +118,45 @@ static void updateAssignmentLevel( } } -static std::pair +static std::optional> PiotrZSL wrote: Consider changing this std::pair into normal struct, in such way there will be no need to make aliases to fields later in check method

[clang-tools-extra] [NFC][clang-tidy]refactor isAssignmentToMemberOf in PreferMemberInitializerCheck (PR #71006)

2023-11-02 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. +1, as it's better than was before. https://github.com/llvm/llvm-project/pull/71006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AMDGPU] Add code model (#70760) test for amdgpu target. (PR #71019)

2023-11-02 Thread Pravin Jagtap via cfe-commits
https://github.com/pravinjagtap updated https://github.com/llvm/llvm-project/pull/71019 >From ef0118818249da417706db7f8e7086d051d17d50 Mon Sep 17 00:00:00 2001 From: Pravin Jagtap Date: Thu, 2 Nov 2023 01:05:35 -0400 Subject: [PATCH 1/2] [AMDGPU] Add code model (#70760) test for amdgpu target.

[clang] [llvm] [AMDGPU] Add code model (#70760) test for amdgpu target. (PR #71019)

2023-11-02 Thread Matt Arsenault via cfe-commits
@@ -13,6 +13,11 @@ // RUN: not %clang -### -c --target=aarch64 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s // RUN: not %clang -### -c --target=aarch64 -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=ERR-KERNEL %s // RUN: not %clang

[llvm] [clang-tools-extra] [clang] [AMDGPU] New ttracedata intrinsics (PR #70235)

2023-11-02 Thread Jay Foad via cfe-commits
https://github.com/jayfoad updated https://github.com/llvm/llvm-project/pull/70235 >From e02640686a8cf0a42cec01da4f32b6888f5de11f Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Wed, 25 Oct 2023 17:14:40 +0100 Subject: [PATCH 1/2] [AMDGPU] New ttracedata intrinsics Add llvm.amdgcn.s.ttracedata

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
pmatos wrote: > I still think all the defaulted address space parameters should be purged and > it only invites bugs. It's a regression to introduce a new defaulted argument. Understandable, although always writing `PointerType::get(Ctx, 0);` really looks weird given most of the time the

[PATCH] D154396: [clang] Add support for SerenityOS

2023-11-02 Thread Brad Smith via Phabricator via cfe-commits
brad added inline comments. Comment at: clang/lib/Driver/ToolChains/Serenity.cpp:202 + addSystemInclude(DriverArgs, CC1Args, + concat(D.SysRoot, "/usr/local/include")); + addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot, "/usr/include"));

[PATCH] D154396: [clang] Add support for SerenityOS

2023-11-02 Thread Brad Smith via Phabricator via cfe-commits
brad added a comment. But the rest LGTM as a start. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154396/new/ https://reviews.llvm.org/D154396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[flang] [clang] WIP: [flang] Enable fir alias tags pass by default when optimizing for speed (PR #68597)

2023-11-02 Thread Tom Eccles via cfe-commits
tblah wrote: Hi @vzakhari, currently there is a serious performance regression in spec2017 exchange2. With the TBAA tags we produce slightly better code (less repeated loads, hoisting some code out of loops, etc). Unfortunately, this change to the generated code causes LLVM's function

[clang] [clang-repl] [test] Make an XFAIL more precise (PR #70991)

2023-11-02 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: This broke on PS5 bots, like https://lab.llvm.org/buildbot/#/builders/216/builds/29677; those are configured with a triple like `x86_64-sie-ps5`, which seems to use an MSVC like C++ ABI behaviour, so I pushed a revert. Not sure whom to CC to pull in Sony people to discuss

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -fno-builtin -analyzer-checker=core,alpha.unix.Stream -verify %s +// expected-no-diagnostics + +typedef struct _FILE FILE; + +// These functions are not standard C library functions. +FILE *tmpfile(const char *restrict path); // Real

[clang] 0d21436 - [C++20] [Modules] Warn if we found #include in module purview (#69555)

2023-11-02 Thread via cfe-commits
Author: Chuanqi Xu Date: 2023-11-02T16:40:20+08:00 New Revision: 0d2143611425081bb9db5bb6ee57aaddfd1eda53 URL: https://github.com/llvm/llvm-project/commit/0d2143611425081bb9db5bb6ee57aaddfd1eda53 DIFF: https://github.com/llvm/llvm-project/commit/0d2143611425081bb9db5bb6ee57aaddfd1eda53.diff

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Got it. Thanks. Then I feel this is ready to land. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Ben Shi via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -fno-builtin -analyzer-checker=core,alpha.unix.Stream -verify %s +// expected-no-diagnostics + +typedef struct _FILE FILE; + +// These functions are not standard C library functions. +FILE *tmpfile(const char *restrict path); // Real

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Ben Shi via cfe-commits
https://github.com/benshi001 updated https://github.com/llvm/llvm-project/pull/70540 >From bbdb534d7c1300c4b18128fc0ccdd3476c3f6d7f Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Tue, 31 Oct 2023 13:05:19 +0800 Subject: [PATCH] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX

[clang] b73d739 - Revert "[clang-repl] [test] Make an XFAIL more precise (#70991)"

2023-11-02 Thread Martin Storsjö via cfe-commits
Author: Martin Storsjö Date: 2023-11-02T10:49:55+02:00 New Revision: b73d7390732b48014983aa9569e68c139f61bfcb URL: https://github.com/llvm/llvm-project/commit/b73d7390732b48014983aa9569e68c139f61bfcb DIFF:

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Nikita Popov via cfe-commits
nikic wrote: > Also adds AS = 0 as an optional argument to get() methods. I believe that was intentionally omitted to make sure address spaces aren't forgotten (getUnqual is used for the case where they aren't relevant). cc @arsenm Not sure whether this consideration is still relevant with

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Matt Arsenault via cfe-commits
arsenm wrote: I still think all the defaulted address space parameters should be purged and it only invites bugs. It's a regression to introduce a new defaulted argument. https://github.com/llvm/llvm-project/pull/71029 ___ cfe-commits mailing list

[clang] [clang][driver] Add \/../include/c++/v1 to include path on Darwin (PR #70817)

2023-11-02 Thread Liviu Ionescu via cfe-commits
ilg-ul wrote: Then can this bug fix be accepted? Are there any other solutions? https://github.com/llvm/llvm-project/pull/70817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-02 Thread Timm Baeder via cfe-commits
@@ -167,17 +169,13 @@ template class IntegralAP final { } static bool increment(IntegralAP A, IntegralAP *R) { -// FIXME: Implement. -assert(false); -*R = IntegralAP(A.V - 1); -return false; +IntegralAP One(1, A.bitWidth()); tbaederr

[openmp] [clang] [OpenMP] Add support for Solaris/x86_64 (PR #70593)

2023-11-02 Thread Brad Smith via cfe-commits
https://github.com/brad0 updated https://github.com/llvm/llvm-project/pull/70593 >From 261f571d28b8398be221f3928f93bcee211e26ae Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 29 Oct 2023 09:02:12 -0400 Subject: [PATCH] [OpenMP] Add support for Solaris/x86_64 Tested on

[clang] 32521bb - [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (#70540)

2023-11-02 Thread via cfe-commits
Author: Ben Shi Date: 2023-11-02T17:10:56+08:00 New Revision: 32521bb37caad512fd539d95bda26170a91e8a4b URL: https://github.com/llvm/llvm-project/commit/32521bb37caad512fd539d95bda26170a91e8a4b DIFF: https://github.com/llvm/llvm-project/commit/32521bb37caad512fd539d95bda26170a91e8a4b.diff LOG:

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Ben Shi via cfe-commits
https://github.com/benshi001 closed https://github.com/llvm/llvm-project/pull/70540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][AArch64] Add ASM constraints for reduced GPR register ranges. (PR #70970)

2023-11-02 Thread Peter Waller via cfe-commits
peterwaller-arm wrote: Worth a simultaneous update to the langref? https://github.com/llvm/llvm-project/blob/e2564b27472638d2e2019e6cd2fc6d6d608f8b8c/llvm/docs/LangRef.rst#L5080-L5106 https://github.com/llvm/llvm-project/pull/70970 ___ cfe-commits

[flang] [clang] [clang-tools-extra] [llvm] [compiler-rt] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-11-02 Thread Matt Arsenault via cfe-commits
@@ -8201,6 +8201,66 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node, return SDValue(); } +SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N, +SelectionDAG ) const { + SDLoc DL(N); + SDValue LHS =

[flang] [compiler-rt] [llvm] [clang-tools-extra] [clang] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-11-02 Thread Matt Arsenault via cfe-commits
@@ -8201,6 +8201,66 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node, return SDValue(); } +SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N, +SelectionDAG ) const { + SDLoc DL(N); + SDValue LHS =

[clang] [clang-tools-extra] [compiler-rt] [flang] [llvm] [Legalizer] Expand fmaximum and fminimum (PR #67301)

2023-11-02 Thread Matt Arsenault via cfe-commits
@@ -8201,6 +8201,66 @@ SDValue TargetLowering::expandFMINNUM_FMAXNUM(SDNode *Node, return SDValue(); } +SDValue TargetLowering::expandFMINIMUM_FMAXIMUM(SDNode *N, +SelectionDAG ) const { + SDLoc DL(N); + SDValue LHS =

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/69597 >From 26780a13123c14763467c1b9de6b0cef3d92ff1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 18 Oct 2023 15:36:13 +0200 Subject:

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-02 Thread Timm Baeder via cfe-commits
tbaederr wrote: > FWIW, when the description for the PR says it can't be merged for some > reason, it usually goes on the bottom of my review queue until those issues > are addressed. It's difficult to accept known-broken code. :-( Sorry, I forgot to re-enable the tests here. Now that

[clang] [clang][Interp] Implement inc/dec for IntegralAP (PR #69597)

2023-11-02 Thread Timm Baeder via cfe-commits
@@ -167,17 +169,13 @@ template class IntegralAP final { } static bool increment(IntegralAP A, IntegralAP *R) { -// FIXME: Implement. -assert(false); -*R = IntegralAP(A.V - 1); -return false; +IntegralAP One(1, A.bitWidth()); +return add(A, One,

[clang] [clang] Change representation of CurLexerKind (PR #70381)

2023-11-02 Thread via cfe-commits
serge-sans-paille wrote: As expected, the formatter iw now red, otherwise looks good (to me at least), waiting for official approval :-) https://github.com/llvm/llvm-project/pull/70381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] d76b56f - [NFC] Eliminate warnings in SourceLocationEncodingTest.cpp

2023-11-02 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2023-11-02T14:01:17+08:00 New Revision: d76b56fd28582c1cc6663cefa5ae2f8a23492d0a URL: https://github.com/llvm/llvm-project/commit/d76b56fd28582c1cc6663cefa5ae2f8a23492d0a DIFF: https://github.com/llvm/llvm-project/commit/d76b56fd28582c1cc6663cefa5ae2f8a23492d0a.diff

[clang] 858b56e - [Clang] Preserve coroutine parameter referenced state (#70973)

2023-11-02 Thread via cfe-commits
Author: Yuxuan Chen Date: 2023-11-02T14:03:47+08:00 New Revision: 858b56e4962749013ded409ff43370b542c8b6cb URL: https://github.com/llvm/llvm-project/commit/858b56e4962749013ded409ff43370b542c8b6cb DIFF: https://github.com/llvm/llvm-project/commit/858b56e4962749013ded409ff43370b542c8b6cb.diff

[clang] [Clang] Preserve coroutine parameter referenced state (PR #70973)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/70973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Preserve coroutine parameter referenced state (PR #70973)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/70973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Preserve coroutine parameter referenced state (PR #70973)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/70973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Preserve coroutine parameter referenced state (PR #70973)

2023-11-02 Thread Chuanqi Xu via cfe-commits
@@ -1965,9 +1965,15 @@ bool Sema::buildCoroutineParameterMoves(SourceLocation Loc) { if (PD->getType()->isDependentType()) continue; +// Preserve the referenced state for unused parameter diagnostics. +bool DeclReferenced = PD->isReferenced();

[clang] 749083b - [LoongArch] Pre-commit test for issue #70890

2023-11-02 Thread Weining Lu via cfe-commits
Author: Weining Lu Date: 2023-11-02T14:18:19+08:00 New Revision: 749083b91f31f370cf64831d3e7e6215b6d51442 URL: https://github.com/llvm/llvm-project/commit/749083b91f31f370cf64831d3e7e6215b6d51442 DIFF: https://github.com/llvm/llvm-project/commit/749083b91f31f370cf64831d3e7e6215b6d51442.diff

[clang] [compiler-rt] [llvm] [Profile] Refactor profile correlation. (PR #70856)

2023-11-02 Thread David Tellenbach via cfe-commits
dtellenbach wrote: @ZequanWu this seems to cause issues on macOS: https://green.lab.llvm.org/green/job/clang-stage1-RA/36184/console ``` Profile-x86_64 :: Darwin/instrprof-debug-info-correlate.c Profile-x86_64 :: instrprof-darwin- Profile-x86_64h :: Darwin/instrprof-debug-info-correlate.c

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-02 Thread Lu Weining via cfe-commits
https://github.com/SixWeining created https://github.com/llvm/llvm-project/pull/71025 In g++, empty unions are not ignored like empty structs when flattening structs to examine whether the structs can be passed via FARs in C++. This patch aligns clang++ with g++. Fix

[PATCH] D108905: [ItaniumCXXABI] Add -fassume-nothrow-exception-dtor to assume that all exception objects' destructors are non-throwing

2023-11-02 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 557976. MaskRay marked an inline comment as done. MaskRay added a comment. remove unused err_ arguments. fix and test `throw new B` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108905/new/

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-loongarch Author: Lu Weining (SixWeining) Changes In g++, empty unions are not ignored like empty structs when flattening structs to examine whether the structs can be passed via FARs in C++. This patch aligns clang++ with g++. Fix

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Lu Weining (SixWeining) Changes In g++, empty unions are not ignored like empty structs when flattening structs to examine whether the structs can be passed via FARs in C++. This patch aligns clang++ with g++. Fix

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
https://github.com/pmatos created https://github.com/llvm/llvm-project/pull/71029 Replace this with PointerType::get(). Also adds AS = 0 as an optional argument to get() methods. >From 28745bc7877747f998f658ee2f661f8312c54814 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Thu, 2 Nov 2023

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 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 e98195f318375978e3e0b153cade8bb3a05029bb 28745bc7877747f998f658ee2f661f8312c54814 --

[clang] [C++20] [Modules] Don't import function bodies from other module units even with optimizations (PR #71031)

2023-11-02 Thread Timm Baeder via cfe-commits
@@ -3856,10 +3856,19 @@ CodeGenModule::isTriviallyRecursive(const FunctionDecl *FD) { bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) return true; + const auto *F = cast(GD.getDecl());

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Michael Spencer via cfe-commits
Bigcheese wrote: This is fine, it's definitely wrong to include framework headers like this too. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-02 Thread Fangrui Song via cfe-commits
@@ -197,6 +197,7 @@ CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounde CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled. CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-02 Thread Fangrui Song via cfe-commits
@@ -5011,6 +5011,12 @@ void Clang::ConstructJob(Compilation , const JobAction , Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); } + if (const Arg *A = + Args.getLastArg(options::OPT_mregnames, options::OPT_mno_regnames)) { MaskRay

[compiler-rt] [flang] [clang] [libc] [llvm] [clang-tools-extra] [libcxx] [lldb] [PowerPC] Support mcmodel=large for AIX (PR #70652)

2023-11-02 Thread Fangrui Song via cfe-commits
@@ -5723,16 +5723,14 @@ void Clang::ConstructJob(Compilation , const JobAction , if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { StringRef CM = A->getValue(); bool Ok = false; -if (Triple.isOSAIX() && CM == "medium") { +if (Triple.isOSAIX() && CM ==

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/70540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/70540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -fno-builtin -analyzer-checker=core,alpha.unix.Stream -verify %s +// expected-no-diagnostics + +typedef struct _FILE FILE; + +// These functions are not standard C library functions. +FILE *tmpfile(const char *restrict path); // Real

[clang] [llvm] [SVE2.1][Clang][LLVM]Int/FP reduce builtin in Clang and LLVM intrinsic (PR #69926)

2023-11-02 Thread Sander de Smalen via cfe-commits
@@ -1224,7 +1233,27 @@ void SVEEmitter::createHeader(raw_ostream ) { OS << "typedef __SVBFloat16_t svbfloat16_t;\n"; - OS << "#include \n"; + OS << "#include \n\n"; + + OS << "typedef __attribute__((vector_size (16))) int8_t __sve_int8x16_t;\n";

[clang] [llvm] [SVE2.1][Clang][LLVM]Int/FP reduce builtin in Clang and LLVM intrinsic (PR #69926)

2023-11-02 Thread Sander de Smalen via cfe-commits
@@ -0,0 +1,285 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s +// RUN:

[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-02 Thread Freddy Ye via cfe-commits
@@ -7416,3 +7416,46 @@ that ``p->array`` must have at least ``p->count`` number of elements available: }]; } + +def CodeAlignAttrDocs : Documentation { + let Category = DocCatVariable; + let Heading = "clang::code_align"; + let Content = [{ +The ``clang::code_align(N)``

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-02 Thread Lu Weining via cfe-commits
SixWeining wrote: Hi @xen0n @xry111, please help to review this. Thanks. https://github.com/llvm/llvm-project/pull/71025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP][AMDGPU] Enable hostcall printf for OpenCL (PR #70932)

2023-11-02 Thread Vikram Hegde via cfe-commits
vikramRH wrote: @arsenm, The choice of defaults is based on current state of printf. HIP uses hostcalls and OpenCL uses buffered variant by default. However I'm willing to make one of the two variants consistent (preferably hostcalls for me). Do note that this would make all OpenCL printf to

[clang] e98f3bf - [clang][analyzer]][NFC] Simplify method 'ensureStreamNonNull' of StreamChecker (#70927)

2023-11-02 Thread via cfe-commits
Author: Ben Shi Date: 2023-11-02T14:41:33+08:00 New Revision: e98f3bfff2c499e76ce8784ea15cedbfb83b33bf URL: https://github.com/llvm/llvm-project/commit/e98f3bfff2c499e76ce8784ea15cedbfb83b33bf DIFF: https://github.com/llvm/llvm-project/commit/e98f3bfff2c499e76ce8784ea15cedbfb83b33bf.diff LOG:

[clang] [clang][analyzer]][NFC] Simplify method 'ensureStreamNonNull' of StreamChecker (PR #70927)

2023-11-02 Thread Ben Shi via cfe-commits
https://github.com/benshi001 closed https://github.com/llvm/llvm-project/pull/70927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP][AMDGPU] Enable hostcall printf for OpenCL (PR #70932)

2023-11-02 Thread Vikram Hegde via cfe-commits
https://github.com/vikramRH updated https://github.com/llvm/llvm-project/pull/70932 >From 4c0467078b2f38e814569ad351f86129d1c1d5ee Mon Sep 17 00:00:00 2001 From: Vikram Date: Wed, 4 Oct 2023 05:41:47 -0400 Subject: [PATCH] [WIP][AMDGPU] hostcall printf support for OpenCL ---

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 @llvm/pr-subscribers-clang Author: Paulo Matos (pmatos) Changes Replace this with PointerType::get(). Also adds AS = 0 as an optional argument to get() methods. --- Patch is 81.99 KiB, truncated to 20.00 KiB below, full version:

[clang] [C++20] [Modules] Don't import function bodies from other module units even with optimizations (PR #71031)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/71031 Close https://github.com/llvm/llvm-project/issues/60996. Previously, clang will try to import function bodies from other module units to get more optimization oppotunities as much as possible. Then the

[clang] [C++20] [Modules] Don't import function bodies from other module units even with optimizations (PR #71031)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9) Changes Close https://github.com/llvm/llvm-project/issues/60996. Previously, clang will try to import function bodies from other module units to get more optimization oppotunities as much as possible. Then

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this next week if no objection comes in. Since the `frameworks` looks not intended to be the places too. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 3bc056d - [clang-repl] [test] Make an XFAIL more precise (#70991)

2023-11-02 Thread via cfe-commits
Author: Martin Storsjö Date: 2023-11-02T09:51:33+02:00 New Revision: 3bc056d5f0ebe9e4074afa088c3a0355f9ab901a URL: https://github.com/llvm/llvm-project/commit/3bc056d5f0ebe9e4074afa088c3a0355f9ab901a DIFF:

[clang] [clang-repl] [test] Make an XFAIL more precise (PR #70991)

2023-11-02 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo closed https://github.com/llvm/llvm-project/pull/70991 ___ 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 import function bodies from other module units even with optimizations (PR #71031)

2023-11-02 Thread Chuanqi Xu via cfe-commits
@@ -3856,10 +3856,19 @@ CodeGenModule::isTriviallyRecursive(const FunctionDecl *FD) { bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) { if (getFunctionLinkage(GD) != llvm::Function::AvailableExternallyLinkage) return true; + const auto *F = cast(GD.getDecl());

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Ben Shi via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 -fno-builtin -analyzer-checker=core,alpha.unix.Stream -verify %s +// expected-no-diagnostics + +typedef struct _FILE FILE; + +// These functions are not standard C library functions. +FILE *tmpfile(const char *restrict path); // Real

[clang] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX versions in StreamChecker (PR #70540)

2023-11-02 Thread Ben Shi via cfe-commits
https://github.com/benshi001 updated https://github.com/llvm/llvm-project/pull/70540 >From bf36469281f52fe34866e6df5eeafdc51d28819c Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Tue, 31 Oct 2023 13:05:19 +0800 Subject: [PATCH] [clang][analyzer] Restrict 'fopen' & 'tmpfile' modeling to POSIX

[clang] [clang][Interp] Handle std::move etc. builtins (PR #70772)

2023-11-02 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/70772 >From b670986c19e412b3c140b610f2c26d957544b23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 31 Oct 2023 07:17:16 +0100 Subject:

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/71049 This patch introduces a new enumerator `Invalid = 0`, shifting other enumerators by +1. Contrary to how it might sound, this actually affirms status quo of how this enum is stored in `clang::Decl`: ``` /// If

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Aaron Ballman via cfe-commits
@@ -84,22 +88,33 @@ inline bool isUniqueGVALinkage(GVALinkage L) { } inline bool isExternallyVisible(Linkage L) { - return L >= VisibleNoLinkage; + switch (L) { + case Linkage::Invalid: +llvm_unreachable("Linkage hasn't been computed!"); AaronBallman

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Aaron Ballman via cfe-commits
@@ -1921,7 +1920,20 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD, bool IsKnownNewer) const { } bool NamedDecl::hasLinkage() const { - return getFormalLinkage() != NoLinkage; + switch (getFormalLinkage()) { + case Linkage::Invalid: +llvm_unreachable("Linkage

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Aaron Ballman via cfe-commits
@@ -2214,7 +2214,7 @@ void ASTWriter::WriteDeclAbbrevs() { Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec Abv->Add(BitCodeAbbrevOp(0)); // InitStyle Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong -

[clang-tools-extra] [clang] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Aaron Ballman via cfe-commits
@@ -560,7 +562,7 @@ bool CXIndexDataConsumer::handleDecl(const NamedDecl *D, if (shouldSuppressRefs()) markEntityOccurrenceInFile(D, Loc); - + AaronBallman wrote: Every other change in this file is unrelated to the linkage enum and should be backed

[clang] [analyzer] Improve diagnostics from ArrayBoundCheckerV2 (PR #70056)

2023-11-02 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -0,0 +1,149 @@ +// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-output=text\ +// RUN: -analyzer-checker=core,alpha.security.ArrayBoundV2,unix.Malloc,alpha.security.taint -verify %s

[llvm] [clang-tools-extra] [lld] [libc] [clang] [libcxx] [lldb] [compiler-rt] [flang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a nit with the new macro (feel free to fix when landing). https://github.com/llvm/llvm-project/pull/70349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[lld] [compiler-rt] [flang] [libcxx] [llvm] [libc] [clang] [clang-tools-extra] [lldb] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Aaron Ballman via cfe-commits
@@ -569,4 +569,12 @@ void AnnotateIgnoreWritesEnd(const char *file, int line); #define LLVM_NO_PROFILE_INSTRUMENT_FUNCTION #endif +/// \macro LLVM_PREFERRED_TYPE +/// Adjust type of bit-field in debug info. +#if __has_attribute(preferred_type) AaronBallman

[libcxx] [flang] [compiler-rt] [clang] [lld] [lldb] [llvm] [libc] [clang-tools-extra] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/70349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/71049 >From 05089e60021c321b4113db7e4bdf59bdaaa19de7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 2 Nov 2023 14:40:12 +0300 Subject: [PATCH 1/4] [clang][NFC] Refactor `clang::Linkage` This patch

[llvm] [clang-tools-extra] [lldb] [libc] [clang] [libcxx] [lld] [flang] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-02 Thread Erich Keane via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang -S -### -fopenacc %s 2>&1 | FileCheck %s --check-prefix=CHECK-DRIVER +// CHECK-DRIVER: "-cc1" {{.*}} "-fopenacc" erichkeane wrote: At the moment, there should be no problem with them co-existing. Kernels can be separately

[lld] [clang] [clang-tools-extra] [flang] [libcxx] [llvm] [libc] [lldb] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-02 Thread Erich Keane via cfe-commits
@@ -605,6 +605,17 @@ static void InitializeStandardPredefinedMacros(const TargetInfo , Builder.defineMacro("HIP_API_PER_THREAD_DEFAULT_STREAM"); } } + + if (LangOpts.OpenACC) { +// FIXME: When we have full support for OpenACC, we should set this to the +

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
pmatos wrote: > Nit: can you add in the description that this is a follow-up from the opaque > pointer transition (having an explicit motivation helps read a patch). Thanks! you're right. done. https://github.com/llvm/llvm-project/pull/71029 ___

[clang] [llvm] [Coroutines] Introduce [[clang::coro_only_destroy_when_complete]] (PR #71014)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/71014 >From a2dae250abf20d47a7db4da65e25ff33bca28e67 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 2 Nov 2023 11:11:59 +0800 Subject: [PATCH 1/2] [Coroutines] Introduce

[clang] [llvm] [Coroutines] Introduce [[clang::coro_only_destroy_when_complete]] (PR #71014)

2023-11-02 Thread Chuanqi Xu via cfe-commits
@@ -7416,3 +7416,69 @@ that ``p->array`` must have at least ``p->count`` number of elements available: }]; } + +def CoroOnlyDestroyWhenCompleteDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The `coro_only_destroy_when_complete` attribute should

[clang] [llvm] [Coroutines] Introduce [[clang::coro_only_destroy_when_complete]] (PR #71014)

2023-11-02 Thread Chuanqi Xu via cfe-commits
@@ -7416,3 +7416,69 @@ that ``p->array`` must have at least ``p->count`` number of elements available: }]; } + +def CoroOnlyDestroyWhenCompleteDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The `coro_only_destroy_when_complete` attribute should

[clang] [llvm] [PowerPC] Add an alias for -mregnames so that full register names used in assembly. (PR #70255)

2023-11-02 Thread Stefan Pintilie via cfe-commits
https://github.com/stefanp-ibm updated https://github.com/llvm/llvm-project/pull/70255 >From c57979d3d86362df239d3d3ff8cda124d40bb79d Mon Sep 17 00:00:00 2001 From: Stefan Pintilie Date: Wed, 25 Oct 2023 15:21:11 -0500 Subject: [PATCH 1/6] [PowerPC] Add an alias for -mregnames so that full

[clang] [clang-repl] [test] Make an XFAIL more precise (PR #70991)

2023-11-02 Thread Paul T Robinson via cfe-commits
pogo59 wrote: If you want to XFAIL specifically for the Sony targets, what you suggested would work. I'm unclear about the "MSVC C++ ABI" aspect, but if that gets the test to work, go for it. https://github.com/llvm/llvm-project/pull/70991 ___

[clang] 3b449bd - [DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes (4/7)

2023-11-02 Thread Vladislav Dzhidzhoev via cfe-commits
Author: Vladislav Dzhidzhoev Date: 2023-11-02T17:44:52+01:00 New Revision: 3b449bd46a11a55a40cbc0016a99b202fa05248e URL: https://github.com/llvm/llvm-project/commit/3b449bd46a11a55a40cbc0016a99b202fa05248e DIFF:

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Vlad Serebrennikov (Endilll) Changes This patch introduces a new enumerator `Invalid = 0`, shifting other enumerators by +1. Contrary to how it might sound, this actually affirms status quo of how this enum is stored in

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Vlad Serebrennikov (Endilll) Changes This patch introduces a new enumerator `Invalid = 0`, shifting other enumerators by +1. Contrary to how it might sound, this actually affirms status quo of how this enum is stored in

  1   2   3   4   5   >