[clang] Revert "Revert "[APINotes] Upstream APINotesOptions"" (PR #70975)

2023-11-01 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 64d5da60d437049548a752001c4081f65137ea47 92773698aa91ff8c17f6152f3142507795a4186e --

[clang-tools-extra] [clang] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2023-11-01 Thread via cfe-commits
philnik777 wrote: This is missing a few tests and probably has some bugs, but I'd like to know whether this is a good approach before putting a lot of work into it. https://github.com/llvm/llvm-project/pull/70976 ___ cfe-commits mailing list cfe-commi

[clang] [clang] Separate bit-field padding diagnostics into -Wpadded-bitfield (PR #70978)

2023-11-01 Thread via cfe-commits
https://github.com/DanShaders created https://github.com/llvm/llvm-project/pull/70978 The `-Wpadded` diagnostics are usually very noisy and generally not helpful. However, reporting padding that was introduced in bit-fields is rather helpful. For example, yesterday in SerenityOS's discord we h

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

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Yuxuan Chen (yuxuanchen1997) Changes This PR is proposing a fix for https://github.com/llvm/llvm-project/issues/65971. Previously, given a coroutine like this ``` task foo(int a) { co_return; } ``` Parameter `a` is never used. Howe

[clang] [clang] Separate bit-field padding diagnostics into -Wpadded-bitfield (PR #70978)

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (DanShaders) Changes The `-Wpadded` diagnostics are usually very noisy and generally not helpful. However, reporting padding that was introduced in bit-fields is rather helpful. For example, yesterday in SerenityOS's discord we had v

[clang-tools-extra] [clang] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2023-11-01 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 86f2e0925051a860eb0a2c187b185b47c88ec45a e0389b126920ed6dd89d729908e6c39b313da65f --

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-01 Thread via cfe-commits
@@ -0,0 +1,61 @@ +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata=f,g,h,i,j,k,l,m,n,o,p -emit-llvm -o - 2>&1 | FileCheck %s -check-prefixes=CHECK32 --match-full-lines +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata -emit-llvm -o - 2>&1 | FileC

[llvm] [clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-11-01 Thread via cfe-commits
https://github.com/goldsteinn updated https://github.com/llvm/llvm-project/pull/67166 >From 686eff52ac0878fa9545481eaf32b47350c68be8 Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Fri, 22 Sep 2023 08:21:21 -0500 Subject: [PATCH 1/7] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-01 Thread via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata -emit-llvm -o - 2>&1 | FileCheck %s +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata=n,_ZN11MyNamespace10myVariableE,_ZL1s,_ZZ4testvE7counter -emit-llvm -o - 2>&1 | FileCheck %s

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

2023-11-01 Thread via cfe-commits
https://github.com/serge-sans-paille updated https://github.com/llvm/llvm-project/pull/70381 >From 8ee0ca67fcd45ba462701ba2b4c58d412d77d2bd Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Thu, 26 Oct 2023 22:31:43 +0200 Subject: [PATCH 1/4] [clang] Change representation of CurLexerKind

[clang] [OpenMP] Make team reductions less bad (PR #70981)

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Johannes Doerfert (jdoerfert) Changes This removes an unnuessary early synchronization in the copy function, removes the unused thread id argument, and uses 64 bit operations for the copy through shared memory if the reduction ele

[clang] [Clang] Emit type metadata on vtables when IRPGO instrumentation option is on. (PR #70841)

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mingming Liu (minglotus-6) Changes The motivating use case is to have type metadata on vtables if IRPGO instrumentation is on (without the requirement of `-fwhole-program-vtables` or `-flto`). A related rfc is in https://discourse.llvm.

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

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Martin Storsjö (mstorsjo) Changes The const.cpp testcase fails when running in MSVC mode, while it does succeed in MinGW mode. In MSVC mode, there are more constructor invocations than expected, as the printout looks like this: A(1)

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread via cfe-commits
avl-llvm wrote: > > Or maybe we can include the DW_AT_const_value in both places? > > The ask to drop the constant off of the declaration comes from the > DWARFParallelLinker work where it was causing non-deterministic output. But > @dwblaikie @avl-llvm will know more about that I do not have

[clang] [clang] Separate bit-field padding diagnostics into -Wpadded-bitfield (PR #70978)

2023-11-01 Thread via cfe-commits
https://github.com/DanShaders updated https://github.com/llvm/llvm-project/pull/70978 >From 5446542556971dfcfed097ad92925712cbe3a7a8 Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Wed, 1 Nov 2023 15:31:49 -0400 Subject: [PATCH 1/2] [clang] Separate bit-field padding diagnostics into -Wpadded

[clang] Reland "[clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes" (PR #69676)

2023-11-01 Thread via cfe-commits
antangelo wrote: Apologies for the delay, I haven't been able to look into this until now. The patch has been reverted in https://github.com/llvm/llvm-project/commit/801c78d5b474c2319aa8ead44db7ba8cacac4714 https://github.com/llvm/llvm-project/pull/69676 ___

[clang] [flang] [flang][windows] Add option to link against specific MSVC CRT (PR #70833)

2023-11-01 Thread via cfe-commits
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, return true; } -void tools::addFortranRuntimeLibs(const ToolChain &TC, +void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,

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

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Congcong Cai (HerrCai0907) Changes isAssignmentToMemberOf will return `std::make_pair(nullptr, nullptr)` when failed. Using `std::optional` can describe failed case clearly. --- Full diff: https://github.com/llvm/llvm-project/pull/71

[clang] [clang] Separate bit-field padding diagnostics into -Wpadded-bitfield (PR #70978)

2023-11-01 Thread via cfe-commits
https://github.com/DanShaders updated https://github.com/llvm/llvm-project/pull/70978 >From 7906a4689d44a64ead5259f947049c862f6bf7e6 Mon Sep 17 00:00:00 2001 From: Dan Klishch Date: Wed, 1 Nov 2023 21:59:21 -0400 Subject: [PATCH] [clang] Separate bit-field padding diagnostics into -Wpadded-bit

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

2023-11-01 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 1/2] [clang] Add support for new loop attribute [[clang::code_a

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

2023-11-01 Thread via cfe-commits
@@ -322,6 +322,56 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

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

2023-11-01 Thread via cfe-commits
@@ -10026,6 +10026,10 @@ def err_duplicate_case_differing_expr : Error< def warn_case_empty_range : Warning<"empty case range specified">; def warn_missing_case_for_condition : Warning<"no case matching constant switch condition '%0'">; +def err_loop_attr_duplication : Error<

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

2023-11-01 Thread via cfe-commits
@@ -788,6 +797,20 @@ void LoopInfoStack::push(BasicBlock *Header, clang::ASTContext &Ctx, } } + // Translate 'loop attributes' arguments to equivalent Attr enums. + // It's being handled separately from LoopHintAttrs not to support + // legacy GNU attributes and prag

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

2023-11-01 Thread via cfe-commits
@@ -4280,3 +4280,12 @@ def PreferredType: InheritableAttr { let Args = [TypeArgument<"Type", 1>]; let Documentation = [PreferredTypeDocumentation]; } + +def CodeAlign: StmtAttr { + let Spellings = [CXX11<"clang", "code_align">, + C23<"clang", "code_align"

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

2023-11-01 Thread 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)``

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

2023-11-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Chuanqi Xu (ChuanqiXu9) Changes Close https://github.com/llvm/llvm-project/issues/56980. This patch tries to introduce a light-weight optimization attribute for coroutines which are guaranteed to only be destroyed after it reached th

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

2023-11-01 Thread via cfe-commits
@@ -4280,3 +4280,12 @@ def PreferredType: InheritableAttr { let Args = [TypeArgument<"Type", 1>]; let Documentation = [PreferredTypeDocumentation]; } + +def CodeAlign: StmtAttr { + let Spellings = [CXX11<"clang", "code_align">, + C23<"clang", "code_align"

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

2023-11-01 Thread 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] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-01 Thread 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] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-01 Thread via cfe-commits
@@ -0,0 +1,124 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +// Add diagnostics tests for Loop attribute: [[clang::code_align()]]. + +void foo() { + int i; + int a

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

2023-11-01 Thread via cfe-commits
@@ -0,0 +1,124 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local %s smanna12 wrote: Done https://github.com/llvm/llvm-project/pull/70762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

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

2023-11-01 Thread via cfe-commits
@@ -0,0 +1,124 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +// Add diagnostics tests for Loop attribute: [[clang::code_align()]]. smanna12 wrote:

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

2023-11-01 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/70762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-01 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 ae7f7f2ef2033a48fb9db3cb70b88ad62019f40b d049dc9997bdb78ff7e7cbf9b04aa42b9274cfd9 --

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

2023-11-01 Thread via cfe-commits
smanna12 wrote: Thank you @erichkeane and @AaronBallman for reviews and feedbacks. >>Please be sure to add a reasonable description to the patch summary so that >>reviewers know more about what's going on, but thank you for already having >>written docs (that helps give context). I have added

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

2023-11-01 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 1/3] [clang] Add support for new loop attribute [[clang::code_a

[clang-tools-extra] [clangd] [C++20] [Modules] Introduce initial support for C++20 Modules (PR #66462)

2023-11-01 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 4fed3d374dfca82d0cb32bb444985ece04438376 c9e4d58d1c2ecdbbbc4a518ee1698901d0b74e0d --

[llvm] [clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-11-01 Thread via cfe-commits
https://github.com/goldsteinn closed https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-01 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 L

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

2023-11-01 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 https://git

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

2023-11-01 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 https://github.com/llvm

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

2023-11-01 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] [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: https:

[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 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] 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: https://github.com/llvm/llvm-project/commit/3bc056d5f0ebe9e4074afa088c3a0355f9ab901a.diff

[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 LO

[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] 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 https://li

[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`

[flang] [mlir] [clang] [Flang][OpenMP][MLIR] Add support for -nogpulib option (PR #71045)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-mlir Author: Dominik Adamski (DominikAdamski) Changes If -nogpulib option is passed by the user, then the OpenMP device runtime is not used and we should not emit globals to configure debugging at compile-time for the

[flang] [mlir] [clang] [Flang][OpenMP][MLIR] Add support for -nogpulib option (PR #71045)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-llvm Author: Dominik Adamski (DominikAdamski) Changes If -nogpulib option is passed by the user, then the OpenMP device runtime is not used and we should not emit globals to configure debugging at compile-time for the device runtime. Link to -nog

[flang] [clang] [mlir] [Flang][OpenMP][MLIR] Add support for -nogpulib option (PR #71045)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver Author: Dominik Adamski (DominikAdamski) Changes If -nogpulib option is passed by the user, then the OpenMP device runtime is not used and we should not emit globals to configure debugging at compile-time for the device runtime. Link to -

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

2023-11-02 Thread via cfe-commits
Author: Congcong Cai Date: 2023-11-02T19:30:06+08:00 New Revision: 43e13fdc9e8edd425f640c424071377879c07822 URL: https://github.com/llvm/llvm-project/commit/43e13fdc9e8edd425f640c424071377879c07822 DIFF: https://github.com/llvm/llvm-project/commit/43e13fdc9e8edd425f640c424071377879c07822.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::De

[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 `clang::De

[clang] 98da183 - [clang] Remove diagnostic that came with `[[clang::preferred_type]]` (#70632)

2023-11-02 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-02T16:17:17+04:00 New Revision: 98da18344eed96cabfd2214131185686b1983412 URL: https://github.com/llvm/llvm-project/commit/98da18344eed96cabfd2214131185686b1983412 DIFF: https://github.com/llvm/llvm-project/commit/98da18344eed96cabfd2214131185686b1983412.

[clang] [clang][analyzer] scan-build: Ensure path prefixes exist (PR #71053)

2023-11-02 Thread via cfe-commits
https://github.com/amcn created https://github.com/llvm/llvm-project/pull/71053 scan-build's `UpdatePrefix` calculates the shared prefix of a set of files. Its use of strings and regular expressions to do so means that it can sometimes end up calculating a prefix which does not correspond to a

[clang] [clang][analyzer] scan-build: Ensure path prefixes exist (PR #71053)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (amcn) Changes scan-build's `UpdatePrefix` calculates the shared prefix of a set of files. Its use of strings and regular expressions to do so means that it can sometimes end up calculating a prefix which does not correspond to a rea

[clang] [clang][analyzer] scan-build: Ensure path prefixes exist (PR #71053)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (amcn) Changes scan-build's `UpdatePrefix` calculates the shared prefix of a set of files. Its use of strings and regular expressions to do so means that it can sometimes end up calculating a prefix which does not c

[clang] f1c9a1c - Revert "Revert "[APINotes] Upstream APINotesOptions""

2023-11-02 Thread via cfe-commits
Author: Egor Zhdan Date: 2023-11-02T12:39:55Z New Revision: f1c9a1c3a590970ba88e28a58d0f3622e8c2c415 URL: https://github.com/llvm/llvm-project/commit/f1c9a1c3a590970ba88e28a58d0f3622e8c2c415 DIFF: https://github.com/llvm/llvm-project/commit/f1c9a1c3a590970ba88e28a58d0f3622e8c2c415.diff LOG: Re

[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: @@ -174,9 +176,116 @@ compareValueToThreshold(ProgramStateRef State, NonLoc Value, NonLoc Threshold, return {nullptr, nullptr}; } -void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad,

[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: @@ -22,23 +22,25 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h" #include "llvm/ADT/SmallString.h" +#include "llvm/S

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

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 @llvm/pr-subscribers-llvm-ir Author: Paul Walker (paulwalker-arm) Changes [LLVM][AArch64] Add ASM constraints for reduced GPR register ranges. The patch adds the follow ASM constraints: Uci => w8-w11 Ucj => w12-w15 These con

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

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Paul Walker (paulwalker-arm) Changes [LLVM][AArch64] Add ASM constraints for reduced GPR register ranges. The patch adds the follow ASM constraints: Uci => w8-w11 Ucj => w12-w15 These constraints are required for SME load/stor

[clang] [clang] Catch missing format attributes (PR #70024)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Budimir Aranđelović (budimirarandjelovicsyrmia) Changes Enable flag -Wmissing-format-attribute to catch missing attributes. --- Full diff: https://github.com/llvm/llvm-project/pull/70024.diff 6 Files Affected: - (modified) clang/include

[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: @@ -217,80 +326,71 @@ void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad, // MallocChecker that call SValBuilder::getConjuredHeapSymbolVal()) and // non-symbolic regions (e.g. a

[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

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

2023-11-02 Thread via cfe-commits
@@ -440,6 +440,14 @@ MDNode *LoopInfo::createMetadata( Ctx, {MDString::get(Ctx, "llvm.loop.parallel_accesses"), AccGroup})); } + // Setting clang::code_align attribute. + if (Attrs.CodeAlign > 0) { smanna12 wrote: Added consumption on this IR in M

[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: DonatNagyE wrote: Thanks for the suggestions; I'll probably upload the next revision tomorrow. > One remark about the review workflow, I'd prefer if the conversation starter > would resolve the conversations. Let me exp

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

2023-11-02 Thread via cfe-commits
https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/70762 >From 93d46d40f46663cfa30fc01da965887508684e25 Mon Sep 17 00:00:00 2001 From: "Manna, Soumi" Date: Mon, 30 Oct 2023 21:41:00 -0700 Subject: [PATCH 1/4] [clang] Add support for new loop attribute [[clang::code_a

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -265,6 +269,61 @@ bool AIXTargetCodeGenInfo::initDwarfEHRegSizeTable( return PPC_initDwarfEHRegSizeTable(CGF, Address, Is64Bit, /*IsAIX*/ true); } +void AIXTargetCodeGenInfo::setTargetAttributes( +const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -0,0 +1,64 @@ +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata=a4,a5,a8,a9,b,c,d,e,v -emit-llvm -o - 2>&1 \ +// RUN: | FileCheck %s -check-prefixes=CHECK32 --match-full-lines +// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -S -mtocdata -emit-llv

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -0,0 +1,69 @@ +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 %s -triple=powerpc-ibm-aix-xcoff -S -mtocdata=h,g,f,e,d,c,b,a,globalOneWithAlias,globalTwoWithAlias,ll,t3 -verify -emit-llvm -o - | FileCheck %s -check-prefix=CHECK --match-full-lines +// RUN: %clang_cc

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -0,0 +1,16 @@ +; RUN: not --crash llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s --check-prefix CHECK-ERROR +; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s --check-prefix CHECK-ERROR + +@a = global [5 x i16] zeroinitializer, alig

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 %s -triple powerpc-unknown-aix -S -mtocdata=g1,g2,g3 -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-MIX --match-full-lines diggerlin wrote: I am not sure the purpose of the test case, I think all the test scenario have b

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -421,13 +421,102 @@ void AIX::AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm_unreachable("Unexpected C++ library type; only libc++ is supported."); } +// This function processes all the mtocdata options to build the final +// simplified toc data options to pass

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

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

[clang] [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (PR #70837)

2023-11-02 Thread via cfe-commits
@@ -30,3 +30,24 @@ void test(int i) { clang_analyzer_dump(g4); // expected-warning@-1 {{&i [as 64 bit integer]}} } + +struct A { + int n; + void set(int x) { +n = x; + } +}; +using ptr_size = decltype(sizeof(void *)); DonatNagyE wrote: Do I see it c

[clang-tools-extra] [llvm] [clang] [lldb] [flang] [IndVars] Add check of loop invariant for trunc instructions (PR #71072)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Author: Markos Horro (markoshorro) Changes The same idea as in 34d380e1f63a7e2cdb9ab1e6498f727fcd710a14, but for truncation instructions. Improvement for #59633. --- Full diff: https://github.com/llvm/llvm-project/pull/71072.diff 2 Fi

[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

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 3aad77ebc37532a6a3836d902d0014391ed0a0eb d93ec3a6ba414483efd6126fc7a953228b5e4150 --

[clang] 43feb3e - [clang] Separate bit-field padding diagnostics into -Wpadded-bitfield (#70978)

2023-11-02 Thread via cfe-commits
Author: Dan Klishch Date: 2023-11-02T11:52:57-04:00 New Revision: 43feb3eeb1ba4de920d6eaa12b7a5c21f6dd6229 URL: https://github.com/llvm/llvm-project/commit/43feb3eeb1ba4de920d6eaa12b7a5c21f6dd6229 DIFF: https://github.com/llvm/llvm-project/commit/43feb3eeb1ba4de920d6eaa12b7a5c21f6dd6229.diff L

[clang] [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (PR #70837)

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

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andrey Ali Khan Bolshakov (bolshakov-a) Changes Prior to this, attempts to bind a bit-field to an NTTP of reference type produced an error because references to subobjects in NTTPs are disallowed. But C++20 allows references to subobjects

[clang] [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (PR #70837)

2023-11-02 Thread via cfe-commits
@@ -30,3 +30,24 @@ void test(int i) { clang_analyzer_dump(g4); // expected-warning@-1 {{&i [as 64 bit integer]}} } + +struct A { + int n; + void set(int x) { +n = x; + } +}; +using ptr_size = decltype(sizeof(void *)); +void gh_69922(ptr_size p) { + // expected-warni

[clang] 8a3e4b5 - [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (#70349)

2023-11-02 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-02T20:56:39+04:00 New Revision: 8a3e4b5f32e6d333b6fa70aa6c505046ce18630f URL: https://github.com/llvm/llvm-project/commit/8a3e4b5f32e6d333b6fa70aa6c505046ce18630f DIFF: https://github.com/llvm/llvm-project/commit/8a3e4b5f32e6d333b6fa70aa6c505046ce18630f.

[clang] 8775947 - [clang][NFC] Refactor `clang::Linkage` (#71049)

2023-11-02 Thread via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-02T20:57:29+04:00 New Revision: 8775947633bf189e1847707932b1015f04640ea0 URL: https://github.com/llvm/llvm-project/commit/8775947633bf189e1847707932b1015f04640ea0 DIFF: https://github.com/llvm/llvm-project/commit/8775947633bf189e1847707932b1015f04640ea0.

[clang] [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (PR #70837)

2023-11-02 Thread via cfe-commits
https://github.com/DonatNagyE commented: Basically LGTM, thanks for fixing this crash. I don't give a formal approval because I didn't independently verify the correctness of the details, but I like the direction of the change. https://github.com/llvm/llvm-project/pull/70837 __

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

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

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

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

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

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

[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
stephenpeckham wrote: > What are the ABI implications here? Do all translation units have to agree on > whether a variable is "tocdata"? The manual change hints there's some sort of > linker fixup, but it's not clear to me how that works. There are no ABI implications. Using -mtocdata removes

[llvm] [clang] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)

2023-11-02 Thread via cfe-commits
@@ -421,13 +421,101 @@ void AIX::AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm_unreachable("Unexpected C++ library type; only libc++ is supported."); } +// This function processes all the mtocdata options to build the final +// simplified toc data options to pass

[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

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 55c9f24344a49cd1deb86af1d79d4dc3a798c6fb 5e35c30414517b242a1e68d46ecc5cfae3b75130 --

[clang] [clang][analyzer] Add a test case to PR-70792 for Issue-59493 (PR #71073)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ella Ma (Snape3058) Changes Following PR #70792 for issue #70464 Add a test case for issue #59493 --- Full diff: https://github.com/llvm/llvm-project/pull/71073.diff 1 Files Affected: - (modified) clang/test/Analysis/issue-70464.cpp (

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread via cfe-commits
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/71095 This patch adjusts the inline function decl check for LLVM libc to ignore implicit functions. For the moment the plan is to ignore these and mark the class with a macro so that it can be given the appropr

[clang-tools-extra] [clang-tidy][libc] Ignore implicit function inline (PR #71095)

2023-11-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: None (michaelrj-google) Changes This patch adjusts the inline function decl check for LLVM libc to ignore implicit functions. For the moment the plan is to ignore these and mark the class with a macro so that it can be given the approp

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-11-02 Thread via cfe-commits
https://github.com/wheatman updated https://github.com/llvm/llvm-project/pull/69061 >From b46d376e803bae29231e313a623f508e22e6c9d6 Mon Sep 17 00:00:00 2001 From: Brian Wheatman Date: Sat, 14 Oct 2023 12:02:19 -0400 Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive cons

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-11-02 Thread via cfe-commits
@@ -62,3 +62,28 @@ void t10(void) { UnsignedCharTy subscript = 0; int val = array[subscript]; // no warning for unsigned char } + +void t11(void) { + int array[256] = { 0 }; + int val = array['a']; // no warning for char with known positive value +} + +void t12(void) { +

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-11-02 Thread via cfe-commits
wheatman wrote: Thanks you for the comments. I made the updates and added the note in `clang/docs/ReleaseNotes.rst` https://github.com/llvm/llvm-project/pull/69061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

<    22   23   24   25   26   27   28   29   30   31   >