[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
@@ -0,0 +1,131 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang] [analyzer] Fix StackAddrEscapeChecker crash on temporary object fields (PR #66493)

2023-09-18 Thread Balazs Benics via cfe-commits
steakhal wrote: Let me know if you are still okay with the latest change. @DonatNagyE @Xazax-hun https://github.com/llvm/llvm-project/pull/66493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Add std::variant checker (PR #66481)

2023-09-18 Thread Balazs Benics via cfe-commits
@@ -318,6 +318,10 @@ def C11LockChecker : Checker<"C11Lock">, Dependencies<[PthreadLockBase]>, Documentation; +def StdVariantChecker : Checker<"StdVariant">, + HelpText<"Check wether we access the right type stored in std::variant">, steakhal wrote:

[clang] [RISCV] Support predefined marcro __riscv_misaligned_{fast,avoid}. (PR #65756)

2023-09-18 Thread Yeting Kuo via cfe-commits
@@ -1220,3 +1220,15 @@ // RUN: -march=rv64i_zve32x_zvkt1p0 -x c -E -dM %s \ // RUN: -o - | FileCheck --check-prefix=CHECK-ZVKT-EXT %s // CHECK-ZVKT-EXT: __riscv_zvkt 100{{$}} + +// RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \

[clang-tools-extra] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-18 Thread via cfe-commits
vabridgers wrote: The status above is showing 1 change requested, but I think I've addressed all comments. Please review at your convenience. Thank you. https://github.com/llvm/llvm-project/pull/65889 ___ cfe-commits mailing list

[libunwind] [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (PR #66549)

2023-09-18 Thread via cfe-commits
@@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) mflr 0 std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0 PPC64_STR(1) + PPC64_STR(4) // Save r4 first since it will be used for fixing r2. +#if defined(_AIX) + // The TOC register (r2) was changed by

[libunwind] [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (PR #66549)

2023-09-18 Thread via cfe-commits
@@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) mflr 0 std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0 PPC64_STR(1) + PPC64_STR(4) // Save r4 first since it will be used for fixing r2. +#if defined(_AIX) + // The TOC register (r2) was changed by

[clang] [InstSimplify] Fold icmp of `X and/or C1` and `X and/or C2` into constant (PR #65905)

2023-09-18 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > LGTM, but please cleanup commits. GitHub will squash commits into a single commit. https://github.com/llvm/llvm-project/pull/65905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Improve CI output when trailing whitespace is found (PR #66649)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/66649 Fixes #66468 >From df20b6321bf9332571fc4e45ae370793876f7773 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 18 Sep 2023 09:58:29 -0400 Subject: [PATCH] [clang] Improve CI output when trailing whitespace

[clang] [Sema] add cast from IncompleteArrayType to ConstantArrayType in TryReferenceListInitialization (PR #65918)

2023-09-18 Thread Congcong Cai via cfe-commits
@@ -4532,6 +4532,15 @@ static void TryReferenceListInitialization(Sema , if (T1Quals.hasAddressSpace()) Sequence.AddQualificationConversionStep( cv1T1, DestType->isRValueReferenceType() ? VK_XValue : VK_LValue); + else if

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Changes This patch folds the pattern `a ne/eq (zext (a ne/eq c))` into a boolean constant or a compare. Clang vs GCC: https://godbolt.org/z/4ro817WE8 Alive2: https://alive2.llvm.org/ce/z/6z9NRF Fixes #65073. --- Full diff:

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Jakub Kuderski via cfe-commits
@@ -1625,6 +1625,35 @@ SmallVector has grown a few other minor advantages over std::vector, causing and is no longer "private to the implementation". A name like ``SmallVectorHeader`` might be more appropriate. +.. _dss_pagedvector: + +llvm/ADT/PagedVector.h

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Changes This patch folds the pattern `a ne/eq (zext (a ne/eq c))` into a boolean constant or a compare. Clang vs GCC: https://godbolt.org/z/4ro817WE8 Alive2: https://alive2.llvm.org/ce/z/6z9NRF Fixes #65073. --- Full diff:

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
ktf wrote: For the record, the latest version of this uses a BumpPtrAllocator to allocate pages, as suggested. https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -300,6 +300,11 @@ Changes in existing checks ` check to identify calls to static member functions with out-of-class inline definitions. +- Updated :doc:`llvmlibc-implementation-in-namespace PiotrZSL wrote: Put changes in alphabetical order. use

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -30,15 +32,18 @@ void ImplementationInNamespaceCheck::check( return; if (const auto *NS = dyn_cast(MatchedDecl)) { -if (NS->getName() != RequiredNamespace) { - diag(NS->getLocation(), "'%0' needs to be the outermost namespace") - <<

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -3,18 +3,18 @@ #define MACRO_A "defining macros outside namespace is valid" class ClassB; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be declared within the '__llvm_libc' namespace +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be declared

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-18 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/66651 >From b6df142239256e979a70896f324f9ed3547c640c Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Mon, 18 Sep 2023 09:34:56 +0200 Subject: [PATCH 1/2] Revert "clang/OpenCL: Add inline implementations of sqrt

[clang] [clang-repl][CUDA] Move CUDA module registration to beginning of global_ctors (PR #66658)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Changes CUDA device code needs to be registered to the runtime before kernels can be launched. This is done through a global constructor. User code in Clang interpreter, is also executed through `global_ctors`. This patch ensures kernels

[clang] [NFC][Clang][Headers] Update refs to ACLE in comments (PR #66662)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Changes Non functional change to update section comments in arm_acle.h, in order to align with updated documentation: [https://arm-software.github.io/acle/main/acle.html](https://arm-software.github.io/acle/main/acle.html) --- Full diff:

[clang-tools-extra] [mlir][sparse] refine sparse fusion with empty tensors materialization (PR #66563)

2023-09-18 Thread Aart Bik via cfe-commits
https://github.com/aartbik closed https://github.com/llvm/llvm-project/pull/66563 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove inaccurate legacy handling of bad bitwise shifts (PR #66647)

2023-09-18 Thread Balazs Benics via cfe-commits
steakhal wrote: What report diff's should we expect? https://github.com/llvm/llvm-project/pull/66647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Three-way comparisons (PR #65901)

2023-09-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/65901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-18 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/65844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-18 Thread Erich Keane via cfe-commits
erichkeane wrote: > TBH, not sure if the UML diagrams would really help anyone understand what's > going on. I tend to agree with this, the documentation via these diagrams is confusing me as well, it doesn't really seem to add anything (and in fact, seem to be 'subtracting' in my case).

[clang] [clang] Improve CI output when trailing whitespace is found (PR #66649)

2023-09-18 Thread Louis Dionne via cfe-commits
ldionne wrote: @asl This should make it a bit more explicit. I see this now when running locally: ``` + echo '*** Checking for trailing whitespace left in Clang source files ***' *** Checking for trailing whitespace left in Clang source files *** + grep -rnI '[[:blank:]]$' clang/lib

[clang] [clang] Improve CI output when trailing whitespace is found (PR #66649)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Fixes #66468 --- Full diff: https://github.com/llvm/llvm-project/pull/66649.diff 1 Files Affected: - (modified) clang/utils/ci/run-buildbot (+5-1) ``diff diff --git a/clang/utils/ci/run-buildbot b/clang/utils/ci/run-buildbot

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,34 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,34 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang] [LLD][AARCH64] lld incorrectly handles .eh_frame when it has a non-zero offset within its output section. (PR #65966)

2023-09-18 Thread via cfe-commits
https://github.com/simpal01 updated https://github.com/llvm/llvm-project/pull/65966 >From eb4d99345cbe9aba6b909ccbc7ce932dcaef3f7d Mon Sep 17 00:00:00 2001 From: Simi Pallipurath Date: Mon, 11 Sep 2023 14:42:27 +0100 Subject: [PATCH] [LLD][AARCH64] lld incorrectly handles .eh_frame when it has

[clang] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw resolved https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw resolved https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Guillaume Chatelet via cfe-commits
https://github.com/gchatelet updated https://github.com/llvm/llvm-project/pull/66504 >From f1427a81c4a3425c1a574316fc26d2c74297b34b Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Fri, 15 Sep 2023 12:34:17 + Subject: [PATCH 1/3] [clang-tidy] Update

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
https://github.com/ktf resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
https://github.com/ktf edited https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
@@ -0,0 +1,132 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Vassil Vassilev via cfe-commits
@@ -7944,9 +7944,13 @@ void ASTReader::PrintStats() { std::fprintf(stderr, "*** AST File Statistics:\n"); unsigned NumTypesLoaded = - TypesLoaded.size() - llvm::count(TypesLoaded, QualType()); + TypesLoaded.size() - std::count(TypesLoaded.materialisedBegin(),

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -30,15 +32,18 @@ void ImplementationInNamespaceCheck::check( return; PiotrZSL wrote: this could be replaced with `decl(isExpansionInMainFile())` https://github.com/llvm/llvm-project/pull/66504 ___ cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-18 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr edited https://github.com/llvm/llvm-project/pull/66651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
@@ -10442,32 +10441,54 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator , DeclContext *DC, if (getLangOpts().CUDA && !isFunctionTemplateSpecialization) maybeAddCUDAHostDeviceAttrs(NewFD, Previous); -// If it's a friend (and only if it's a friend), it's

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Jakub Kuderski via cfe-commits
@@ -0,0 +1,133 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[PATCH] D64087: [clang] Correct source locations for instantiations of out-of-line defaulted special member functions. (PR25683)

2023-09-18 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann added a comment. @cor3ntin, any concerns or suggestions per my recent updates? I'll plan to land this in the next couple of days otherwise. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64087/new/ https://reviews.llvm.org/D64087

[PATCH] D158156: [analyzer] Add C++ array delete checker

2023-09-18 Thread Discookie via Phabricator via cfe-commits
Discookie marked 12 inline comments as done. Discookie added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CXXDeleteChecker.cpp:192 + + const Stmt *S = N->getStmtForDiagnostics(); + if (!S) steakhal wrote: > Discookie wrote: > > steakhal

[clang] 52a55a7 - [clang][Interp] Allow zero-init of primitives with an empty init list

2023-09-18 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2023-09-18T11:09:30+02:00 New Revision: 52a55a7178381c7ac2b46155f2cc000dac48f2d4 URL: https://github.com/llvm/llvm-project/commit/52a55a7178381c7ac2b46155f2cc000dac48f2d4 DIFF: https://github.com/llvm/llvm-project/commit/52a55a7178381c7ac2b46155f2cc000dac48f2d4.diff

[PATCH] D158595: [clang][Interp] Allow zero-init of primitives with an empty init list

2023-09-18 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG52a55a717838: [clang][Interp] Allow zero-init of primitives with an empty init list (authored by tbaeder). Repository: rG LLVM Github Monorepo

[clang] [clang] Enable --print-supported-extensions for all targets (PR #66586)

2023-09-18 Thread David Spickett via cfe-commits
DavidSpickett wrote: Put `-mcpu` aside for now, that's nice, but it's only going to be viable in a world where the backend (tablegen) and frontend (target parsers/ABI info) agree on what is valid and can also be passed to clang. > The file with the full log outputs is here: >

[clang] [clang] Enable --print-supported-extensions for all targets (PR #66586)

2023-09-18 Thread David Spickett via cfe-commits
DavidSpickett wrote: > I was only able to check intel's one (w.r.t to -mcpu), without being aware on > aarch64 / riscv world's detail. Yes I wouldn't expect you to right away, that's why we all keep an eye out for each other's changes :) . That's what I meant about starting by writing more

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-18 Thread Romaric Jodin via cfe-commits
https://github.com/rjodinchr created https://github.com/llvm/llvm-project/pull/66651 This is reverting the previous implementation to avoid adding inline function in opencl headers. This was breaking clspv flow google/clspv#1231, while https://reviews.llvm.org/D156743 mentioned that just

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Jakub Kuderski via cfe-commits
@@ -0,0 +1,132 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[libunwind] [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (PR #66549)

2023-09-18 Thread via cfe-commits
@@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) mflr 0 std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0 PPC64_STR(1) + PPC64_STR(4) // Save r4 first since it will be used for fixing r2. +#if defined(_AIX) + // The TOC register (r2) was changed by

[libunwind] [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (PR #66549)

2023-09-18 Thread via cfe-commits
@@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext) mflr 0 std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0 PPC64_STR(1) + PPC64_STR(4) // Save r4 first since it will be used for fixing r2. +#if defined(_AIX) + // The TOC register (r2) was changed by

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/2] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [clang-cl] Fix for __FUNCTION__ in c++. (PR #66120)

2023-09-18 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/66120 >From 3fcfa303bd211f9a3382657012968cd3f7269db8 Mon Sep 17 00:00:00 2001 From: Ammarguellat Date: Tue, 12 Sep 2023 11:25:19 -0700 Subject: [PATCH 1/2] [clang-cl] Fix for __FUNCTION__ in c++. ---

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw resolved https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/3] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Giulio Eulisse via cfe-commits
https://github.com/ktf updated https://github.com/llvm/llvm-project/pull/66430 >From b952f0577dfe8112f394bd5392212f843c0cc86e Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+...@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:58:21 +0200 Subject: [PATCH 01/16] Introduce PagedVector

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane > I guess my first question is 'why'? Per the comment you mentioned, it is redundant. Switching to `DependentFunctionTemplateSpecializationInfo` also results in constructs such as: ``` template struct A { template<> void f(); }; ``` being diagnosed prior

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Vassil Vassilev via cfe-commits
@@ -0,0 +1,132 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -3,18 +3,18 @@ #define MACRO_A "defining macros outside namespace is valid" class ClassB; -// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be declared within the '__llvm_libc' namespace +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be declared

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. As a single small change to make hardcoded namespaces configurable looks fine. I added some comments related to overall issues in this check. Fell free to fix them or ignore them. https://github.com/llvm/llvm-project/pull/66504

[clang] [clang-repl][CUDA] Move CUDA module registration to beginning of global_ctors (PR #66658)

2023-09-18 Thread Anubhab Ghosh via cfe-commits
https://github.com/argentite created https://github.com/llvm/llvm-project/pull/66658 CUDA device code needs to be registered to the runtime before kernels can be launched. This is done through a global constructor. User code in Clang interpreter, is also executed through `global_ctors`. This

[PATCH] D158156: [analyzer] Add C++ array delete checker

2023-09-18 Thread Donát Nagy via Phabricator via cfe-commits
donat.nagy added a comment. Looks good, thanks for the improvements! One minor remark: your commit uses backticks (`) around the class names in the bug reports, which is commonly used to mark code fragments e.g. in commit messages; however, in the bug reports IIRC most other checkers use

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
@@ -2154,6 +2144,15 @@ bool RecursiveASTVisitor::TraverseFunctionHelper(FunctionDecl *D) { TALI->NumTemplateArgs)); } } +// FIXME: Do we want to traverse the explicit template arguments for

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread Piotr Fusik via cfe-commits
https://github.com/pfusik updated https://github.com/llvm/llvm-project/pull/66643 >From 88028509d7e5b5eaf38075c18abba498cb00087a Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Mon, 18 Sep 2023 18:07:44 +0200 Subject: [PATCH] [clang] Fix null dereference on return in lambda attribute

[clang] [analyzer] Remove inaccurate legacy handling of bad bitwise shifts (PR #66647)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Changes Previously, bitwise shifts with constant operands were validated by the checker `core.UndefinedBinaryOperatorResult`. However, this logic was unreliable, and commit 25b9696b61e53a958e217bb3d0eab66350dc187f added the

[clang] Introduce paged vector (PR #66430)

2023-09-18 Thread Jakub Kuderski via cfe-commits
@@ -0,0 +1,133 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +//

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))`

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))` (PR #65852)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq c))`

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I guess my first question is 'why'? My second is 'if this is unnecessary, why was it here in the first place?`. I'd like some level of historical analysis here/perhaps the knowledge of @zygoloid. https://github.com/llvm/llvm-project/pull/66636

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -2613,70 +2579,6 @@ class TypeAliasTemplateDecl : public RedeclarableTemplateDecl { static bool classofKind(Kind K) { return K == TypeAliasTemplate; } }; -/// Declaration of a function specialization at template class scope. -/// -/// For example: -/// \code -///

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread Piotr Fusik via cfe-commits
pfusik wrote: > I'd be inclined to move the test to clang/test/Parser/ because even though > the fix is in Sema, it's testing a wrong parse. It's an ICE in Sema. The test is identical to the bug report, but it doesn't mean the issue is limited to syntax errors. ```cpp int main() {

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/66504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Changes This is reverting the previous implementation to avoid adding inline function in opencl headers. This was breaking clspv flow google/clspv#1231, while https://reviews.llvm.org/D156743 mentioned that just decoring the call node with

[clang-tools-extra] [clang-tidy] Update llvmlibc-implementation-in-namespace to new rules (PR #66504)

2023-09-18 Thread Piotr Zegar via cfe-commits
@@ -30,15 +32,18 @@ void ImplementationInNamespaceCheck::check( return; if (const auto *NS = dyn_cast(MatchedDecl)) { -if (NS->getName() != RequiredNamespace) { - diag(NS->getLocation(), "'%0' needs to be the outermost namespace") - <<

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -185,14 +185,11 @@ namespace SameSignatureAfterInstantiation { namespace PR22040 { template struct Foobar { -template <> void bazqux(typename T::type) {} // expected-error 2{{cannot be used prior to '::' because it has no members}} erichkeane

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -428,6 +428,8 @@ class ASTNodeTraverser void VisitFunctionDecl(const FunctionDecl *D) { if (const auto *FTSI = D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); +else if (const auto *DFTSI =

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -2154,6 +2144,15 @@ bool RecursiveASTVisitor::TraverseFunctionHelper(FunctionDecl *D) { TALI->NumTemplateArgs)); } } +// FIXME: Do we want to traverse the explicit template arguments for

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I didn't spend much time in Serialization, so hopefully someone else can take a look, but in general I think I'm warming toward this. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -10442,32 +10441,54 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator , DeclContext *DC, if (getLangOpts().CUDA && !isFunctionTemplateSpecialization) maybeAddCUDAHostDeviceAttrs(NewFD, Previous); -// If it's a friend (and only if it's a friend), it's

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl][CUDA] Move CUDA module registration to beginning of global_ctors (PR #66658)

2023-09-18 Thread Anubhab Ghosh via cfe-commits
https://github.com/argentite updated https://github.com/llvm/llvm-project/pull/66658 >From bed2919f781c5ef71e268c95b31a6b9af5392730 Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Mon, 18 Sep 2023 20:33:19 +0530 Subject: [PATCH] [clang-repl][CUDA] Move CUDA module registration to beginning

[clang] clang/OpenCL: set sqrt fp accuracy on call to Z4sqrt (PR #66651)

2023-09-18 Thread Matt Arsenault via cfe-commits
@@ -5612,6 +5612,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo , BundleList); EmitBlock(Cont); } + if (CI->getCalledFunction() && CI->getCalledFunction()->hasName() && +

[clang] [NFC][Clang][Headers] Update refs to ACLE in comments (PR #66662)

2023-09-18 Thread M Iyengar via cfe-commits
https://github.com/Blue-Dot created https://github.com/llvm/llvm-project/pull/2 Non functional change to update section comments in arm_acle.h, in order to align with updated documentation:

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread via cfe-commits
cor3ntin wrote: I would still move the original test, things in sema usually at least parse (ie, this has unbalanced parens). I won't insist though https://github.com/llvm/llvm-project/pull/66643 ___ cfe-commits mailing list

[PATCH] D145214: [TSAN] add support for riscv64

2023-09-18 Thread Aditya Kumar via Phabricator via cfe-commits
hiraditya added a comment. ping: @jrtc27 @asb do you have any pending feedback for this patch? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145214/new/ https://reviews.llvm.org/D145214 ___ cfe-commits

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread Piotr Fusik via cfe-commits
pfusik wrote: @cor3ntin to `test/CXX/what` or `test/Parser` ? https://github.com/llvm/llvm-project/pull/66643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Preserve UDL nodes in RemoveNestedImmediateInvocation (PR #66641)

2023-09-18 Thread via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/66641 D63960 performs a tree transformation on AST to prevent evaluating constant expressions eagerly by removing recorded immediate consteval invocations from subexpressions. (See

[clang] [clang] Preserve UDL nodes in RemoveNestedImmediateInvocation (PR #66641)

2023-09-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes D63960 performs a tree transformation on AST to prevent evaluating constant expressions eagerly by removing recorded immediate consteval invocations from subexpressions. (See https://reviews.llvm.org/D63960#inline-600736 for its

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread Piotr Fusik via cfe-commits
https://github.com/pfusik created https://github.com/llvm/llvm-project/pull/66643 Fixes https://github.com/llvm/llvm-project/issues/48527 >From ea731b4d3d553f42cbaaec2079adeec3927b4150 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Mon, 18 Sep 2023 15:10:58 +0200 Subject: [PATCH] [clang]

[clang-tools-extra] [InstSimplify] Fold icmp of `X and/or C1` and `X and/or C2` into constant (PR #65905)

2023-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/65905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [InstSimplify] Fold icmp of `X and/or C1` and `X and/or C2` into constant (PR #65905)

2023-09-18 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > LGTM, but please cleanup commits. GitHub will squash commits into a single commit. https://github.com/llvm/llvm-project/pull/65905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-09-18 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 556946. hazohelet added a comment. After discussion in https://github.com/llvm/llvm-project/pull/66222, I noticed I had misunderstood the recursiveness of constant-evaluated context. I was pushing constant-evaluating on the lambda body when it appears

[clang-tools-extra] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-18 Thread via cfe-commits
@@ -1333,7 +1333,14 @@ void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) { void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) { VisitExpr(S); S->getValue().Profile(ID); - ID.AddInteger(S->getType()->castAs()->getKind()); + + QualType T =

[clang] [analyzer] Do not use APInt methods on _BitInt() Types (PR #65887)

2023-09-18 Thread via cfe-commits
https://github.com/DonatNagyE approved this pull request. Don't forget to update the commit message! https://github.com/llvm/llvm-project/pull/65887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D148381: [Clang] Implement the 'counted_by' attribute

2023-09-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. I've got no further comments/concerns. Comment at: clang/include/clang/AST/Decl.h:4272-4275 +FieldDecl *FD = nullptr; +for (FieldDecl *Field : fields()) + FD = Field; +return FD; aaron.ballman wrote: > void wrote: >

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread via cfe-commits
cor3ntin wrote: @Fznamznon I think so too, although I'd be inclined to move the test to `clang/test/Parser/` because even though the fix is in Sema, it's testing a wrong parse. The commit message also could do with a longer description. Otherwise LGTM

  1   2   3   4   5   >