[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-20 Thread via cfe-commits
@@ -1386,9 +1386,19 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&& std::forward<_Tuple>(__t), typename __make_tuple_indices>>::type{})) +#if _LIBCPP_STD_VER >= 20 template inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mak

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-20 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/85263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-20 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/85263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-20 Thread Bhuminjay Soni via cfe-commits
11happy wrote: > Not bad, still few issues left, mainly with `getOpcode`. Thanks for your review! Update: I will update the PR with the requested changes after 24 as I have mid semester exams from 21-24. https://github.com/llvm/llvm-project/pull/84481 ___

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-03-20 Thread Haojian Wu via cfe-commits
hokein wrote: > The change seems to be correct in the way code is written. > > However, I wonder what's the connection between the crash and the function > being changed? Is there a way to fail gracefully if there are more mistakes > in this function for incorrect code (e.g. fail deduction ins

[clang] [llvm] [Coroutines] Drop dead instructions more aggressively in addMustTailToCoroResumes() (PR #85271)

2024-03-20 Thread via cfe-commits
https://github.com/zmodem closed https://github.com/llvm/llvm-project/pull/85271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9d1cb18 - [Coroutines] Ignore instructions more aggressively in addMustTailToCoroResumes() (#85271)

2024-03-20 Thread via cfe-commits
Author: Hans Date: 2024-03-20T14:51:45+01:00 New Revision: 9d1cb18d19862fc0627e4a56e1e491a498e84c71 URL: https://github.com/llvm/llvm-project/commit/9d1cb18d19862fc0627e4a56e1e491a498e84c71 DIFF: https://github.com/llvm/llvm-project/commit/9d1cb18d19862fc0627e4a56e1e491a498e84c71.diff LOG: [Co

[clang] 3fbac79 - [AArch64] Don't write to source directory in test

2024-03-20 Thread Benjamin Kramer via cfe-commits
Author: Benjamin Kramer Date: 2024-03-20T14:54:39+01:00 New Revision: 3fbac79064e405a54388d11370ab5a8f0f23914d URL: https://github.com/llvm/llvm-project/commit/3fbac79064e405a54388d11370ab5a8f0f23914d DIFF: https://github.com/llvm/llvm-project/commit/3fbac79064e405a54388d11370ab5a8f0f23914d.dif

[clang] 9f16859 - [InstallAPI] Simplify & improve symbol printing for diagnostics (#85894)

2024-03-20 Thread via cfe-commits
Author: Cyndy Ishida Date: 2024-03-20T07:26:08-07:00 New Revision: 9f168591f36952d8cca543a5ba67906dc07096ff URL: https://github.com/llvm/llvm-project/commit/9f168591f36952d8cca543a5ba67906dc07096ff DIFF: https://github.com/llvm/llvm-project/commit/9f168591f36952d8cca543a5ba67906dc07096ff.diff

[clang] [InstallAPI] Simplify & improve symbol printing for diagnostics (PR #85894)

2024-03-20 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida closed https://github.com/llvm/llvm-project/pull/85894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 5fb2797 - [GOFF][z/OS] Change PrivateGlobalPrefix and PrivateLabelPrefix to be L# (#85730)

2024-03-20 Thread via cfe-commits
Author: Neumann Hon Date: 2024-03-20T10:30:30-04:00 New Revision: 5fb2797f23343999cace3afe24480e8711df4566 URL: https://github.com/llvm/llvm-project/commit/5fb2797f23343999cace3afe24480e8711df4566 DIFF: https://github.com/llvm/llvm-project/commit/5fb2797f23343999cace3afe24480e8711df4566.diff L

[clang] [llvm] [GOFF][z/OS] Change PrivateGlobalPrefix and PrivateLabelPrefix to be L# (PR #85730)

2024-03-20 Thread Neumann Hon via cfe-commits
https://github.com/Everybody0523 closed https://github.com/llvm/llvm-project/pull/85730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Add documentation for `CastExpr::path()`. (PR #85623)

2024-03-20 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/85623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 972f65a - [clang][NFC] Add documentation for `CastExpr::path()`. (#85623)

2024-03-20 Thread via cfe-commits
Author: martinboehme Date: 2024-03-20T15:34:11+01:00 New Revision: 972f65a83f933b0f90cf975ef89452f4210e9b06 URL: https://github.com/llvm/llvm-project/commit/972f65a83f933b0f90cf975ef89452f4210e9b06 DIFF: https://github.com/llvm/llvm-project/commit/972f65a83f933b0f90cf975ef89452f4210e9b06.diff

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG] Full support of complex multiplication and division. (PR #81514)

2024-03-20 Thread Joshua Cranmer via cfe-commits
https://github.com/jcranmer-intel approved this pull request. https://github.com/llvm/llvm-project/pull/81514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-20 Thread Paul T Robinson via cfe-commits
@@ -4743,7 +4771,9 @@ static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_castsi128_pd(__m128i __a) { ///128-bit vectors of [2 x double], using the operation specified by the ///immediate integer operand. /// -///Each comparison yields 0x0 for false, 0xFFF

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-20 Thread Paul T Robinson via cfe-commits
@@ -1168,8 +1202,8 @@ _mm_comige_ss(__m128 __a, __m128 __b) ///operands to determine if the first operand is not equal to the second ///operand. /// -///The comparison returns 0 for false, 1 for true. If either of the two -///lower floating-point values is NaN,

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-20 Thread Paul T Robinson via cfe-commits
@@ -207,6 +207,8 @@ _mm256_div_ps(__m256 __a, __m256 __b) /// Compares two 256-bit vectors of [4 x double] and returns the greater ///of each pair of values. /// +///If either value in a comparison is NaN, returns the value from \a __b. pogo59 wrote: I

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-20 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 updated https://github.com/llvm/llvm-project/pull/85862 >From 5ed257ea248a5868cd3190bd1ad89413a1606370 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Tue, 19 Mar 2024 13:20:14 -0700 Subject: [PATCH 1/2] [X86][Headers] Specify result of NaN comparisons Make sure al

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-20 Thread Paul T Robinson via cfe-commits
@@ -710,6 +728,7 @@ _mm_cmpge_ps(__m128 __a, __m128 __b) /// ///The comparison yields 0x0 for false, 0x for true, in the ///low-order bits of a vector of [4 x float]. +///If either value in a comparison is NaN, returns false. pogo59 wrote:

[clang] 7812fcf - [VectorCombine] foldBitcastShuf - add support for binary shuffles (REAPPLIED)

2024-03-20 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-03-20T15:06:19Z New Revision: 7812fcf3d79ef7fe9ec6bcdfc8fd9143864956cb URL: https://github.com/llvm/llvm-project/commit/7812fcf3d79ef7fe9ec6bcdfc8fd9143864956cb DIFF: https://github.com/llvm/llvm-project/commit/7812fcf3d79ef7fe9ec6bcdfc8fd9143864956cb.diff LOG:

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-03-20 Thread Ilya Biryukov via cfe-commits
ilya-biryukov wrote: > This issue comes from a bug in the implementation where we missed to handle > the template template parameter. The resulting crash is a manifestation of > this problem. Sure, that's obvious. I see that we access the vector by the template parameter index and the access

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improves -print-library-module-manifest-path. (PR #85943)

2024-03-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante created https://github.com/llvm/llvm-project/pull/85943 This adds a libc++ to modules.json as is currently used by libc++. When libc++.so is not found the function will search for libc++.a as fallback. >From 9fdea5b6f70b6c2ef9215e28d21f9f233ed61af1 Mon Sep 17 00:00:

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
usx95 wrote: Friendly ping for review: @jyknight @zygoloid @efriedma-quic https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/85398 >From 0654f624b3b60026398e8b0168623a85e3129630 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 15 Mar 2024 13:19:36 + Subject: [PATCH 1/4] [codegen] Emit cleanups for branch in stmt-expr and coro suspe

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #85944)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/85944 This patch replaces getAs<> with castAs<> to resolve 1. Dereferencing a pointer issue with nullptr FPT when calling ResolveExceptionSpec() in checkEscapingByref(clang::VarDecl *, clang::Sema &). 2. Dereferenci

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #85944)

2024-03-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (smanna12) Changes This patch replaces getAs<> with castAs<> to resolve 1. Dereferencing a pointer issue with nullptr FPT when calling ResolveExceptionSpec() in checkEscapingByref(clang::VarDecl *, clang::Sema &). 2. Dereferencing

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #85944)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/85944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][docs] Document hlsl.h in the HLSL docs (PR #84081)

2024-03-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/84081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 48a1a9b - [HLSL][docs] Document hlsl.h in the HLSL docs (#84081)

2024-03-20 Thread via cfe-commits
Author: Chris B Date: 2024-03-20T10:16:17-05:00 New Revision: 48a1a9b26048d2a88eaf5b09de0525ab557615de URL: https://github.com/llvm/llvm-project/commit/48a1a9b26048d2a88eaf5b09de0525ab557615de DIFF: https://github.com/llvm/llvm-project/commit/48a1a9b26048d2a88eaf5b09de0525ab557615de.diff LOG:

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-20 Thread Roberto Bampi via cfe-commits
https://github.com/gigaroby updated https://github.com/llvm/llvm-project/pull/84346 >From e19f49ca2660cbcd64fb81aae0428e899d61cac6 Mon Sep 17 00:00:00 2001 From: Roberto Bampi Date: Thu, 7 Mar 2024 18:10:56 +0100 Subject: [PATCH 1/2] [clang-format] Add --fail-on-incomplete-format. At the momen

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
@@ -337,12 +347,58 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::handleComplex(uint64_t &TypeSize) const { + llvm::Type *ElemTy; + unsigned RegsNeeded; // Registers Needed f

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
@@ -420,6 +496,10 @@ ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { return ABIArgInfo::getDirect(CoerceTy); } } + if (IsComplexInRegABI && RetTy->isAnyComplexType()) { +assert(RetTy->isAnyComplexType() && "RetTy must be Complex type.

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
@@ -330,22 +330,33 @@ namespace { class PPC32_SVR4_ABIInfo : public DefaultABIInfo { bool IsSoftFloatABI; bool IsRetSmallStructInRegABI; + bool IsComplexInRegABI; diggerlin wrote: do we need a new data member `IsComplexInRegABI` here ? (there are several

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
@@ -337,12 +347,58 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::handleComplex(uint64_t &TypeSize) const { + llvm::Type *ElemTy; + unsigned RegsNeeded; // Registers Needed f

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
@@ -396,12 +407,77 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::handleComplex(uint64_t &TypeSize) const { + llvm::Type *ElemTy; + unsigned RegsNeeded; // Registers Needed f

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-20 Thread via cfe-commits
@@ -0,0 +1,625 @@ +//===-- NullPointerAnalysisModel.cpp *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #85944)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/85944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang] Fix potential dereferencing of nullptr (PR #85944)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/85944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add --fail-on-incomplete-format. (PR #84346)

2024-03-20 Thread Roberto Bampi via cfe-commits
@@ -0,0 +1,5 @@ +// RUN: cat %s | not clang-format --fail-on-incomplete-format | FileCheck %s +// RUN: cat %s | clang-format | FileCheck %s +int a([) {} + +// CHECK: int a([) {} gigaroby wrote: > It's missing the EOF. Also, use a single hyphen for the option like

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-20 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-20 Thread Kees Cook via cfe-commits
kees wrote: Hmpf. Build failure encountered under an Assert: ``` # | Assertion failed: VarSize == CstSize && "Emitted constant has unexpected size", file C:\ws\src\clang\lib\CodeGen\CodeGenModule.cpp, line 5294 # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

2024-03-20 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/85923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

2024-03-20 Thread via cfe-commits
alexfh wrote: Apart from the correctness issues, we've seen some regressions on various benchmarks from LLVM Test Suite after this patch. Specifically, around 3-5% regression on x86-64 in various metrics of the [Interpolation](https://github.com/llvm/llvm-test-suite/tree/main/MicroBenchmarks/I

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-20 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovicsyrmia updated https://github.com/llvm/llvm-project/pull/70307 From c9ef2f27f4b633a5862c4a46d6940ce830a7bde1 Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Thu, 26 Oct 2023 10:39:52 +0200 Subject: [PATCH] [clang] Emit bad shift warnings ---

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2024-03-20 Thread zhijian lin via cfe-commits
https://github.com/diggerlin edited https://github.com/llvm/llvm-project/pull/77732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-20 Thread Budimir Aranđelović via cfe-commits
@@ -2803,9 +2803,10 @@ static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, // C++11 [expr.shift]p1: Shift width must be less than the bit width of // the shifted type. unsigned SA = (unsigned) RHS.getLimitedValue(LHS.getBitWidth()-1); -

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-20 Thread Budimir Aranđelović via cfe-commits
@@ -2836,9 +2837,11 @@ static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, // C++11 [expr.shift]p1: Shift width must be less than the bit width of the // shifted type. unsigned SA = (unsigned) RHS.getLimitedValue(LHS.getBitWidth()-1); -

[clang] [APINotes] Upstream the remaining API Notes fixes and tests (PR #84773)

2024-03-20 Thread Egor Zhdan via cfe-commits
@@ -638,15 +638,15 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S, PDecl->setInvalidDecl(); } - ProcessDeclAttributes(S, PDecl, FD.D); - // Regardless of setter/getter attribute, we save the default getter/setter // selector names in anticipation of declar

[clang] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)

2024-03-20 Thread via cfe-commits
https://github.com/hiraditya updated https://github.com/llvm/llvm-project/pull/85704 >From a930e01740cd574905922fab9de850974940f6b3 Mon Sep 17 00:00:00 2001 From: AdityaK Date: Mon, 18 Mar 2024 14:09:13 -0700 Subject: [PATCH] clang driver: enable fast unaligned access for Android on RISCV64 A

[clang] [APINotes] Upstream the remaining API Notes fixes and tests (PR #84773)

2024-03-20 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,4 @@ +Name: SomeBrokenLib +Functions: + - Name: do_something_with_pointers +Nu llabilityOfRet: O egorzhdan wrote: Alright, I added a comment https://github.com/llvm/llvm-project/pull/84773 ___ cfe-commi

[clang] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)

2024-03-20 Thread via cfe-commits
@@ -167,6 +167,10 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-relax"); } + // Android requires fast unaligned access on RISCV64. hiraditya wrote: Added a test to check that following `-mstric

[clang] [APINotes] Upstream the remaining API Notes fixes and tests (PR #84773)

2024-03-20 Thread Egor Zhdan via cfe-commits
@@ -0,0 +1,44 @@ +// RUN: rm -rf %t && mkdir -p %t +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify + +// Test with Swift versio

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

2024-03-20 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/85923 >From c0c07deebef4e2c76d935b4ce8fc1d4abddab4db Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Wed, 20 Mar 2024 10:32:58 + Subject: [PATCH] Reland [FMV] Emit the resolver along with the default ve

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2024-03-20 Thread via cfe-commits
@@ -0,0 +1,625 @@ +//===-- NullPointerAnalysisModel.cpp *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [APINotes] Upstream the remaining API Notes fixes and tests (PR #84773)

2024-03-20 Thread Egor Zhdan via cfe-commits
@@ -52,49 +52,54 @@ static void applyNullability(Sema &S, Decl *D, NullabilityKind Nullability, if (!Metadata.IsActive) return; - auto IsModified = [&](Decl *D, QualType QT, -NullabilityKind Nullability) -> bool { + auto GetModified = + [&

[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

2024-03-20 Thread Brandon Wu via cfe-commits
@@ -8927,8 +8927,13 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { } } - if (T->isRVVSizelessBuiltinType()) -checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext)); + if (T->isRVVSizelessBuiltinType() && isa(CurContext)) { +const FunctionD

[clang] [clang][RISCV] Enable RVV with function attribute __attribute__((target("arch=+v"))) (PR #83674)

2024-03-20 Thread Brandon Wu via cfe-commits
@@ -8927,8 +8927,13 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { } } - if (T->isRVVSizelessBuiltinType()) -checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext)); + if (T->isRVVSizelessBuiltinType() && isa(CurContext)) { +const FunctionD

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-20 Thread Kees Cook via cfe-commits
kees wrote: > Is this an existing bug? i.e. it's the CodeGen test for `union { char x[]; } > x = {0};` ... :P Confirmed. Adding a CodeGen test for `union { char x[]; } x = {0};` without any of the changes from this PR still hits the assert. I assume this was from making flex array initializat

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Eric Li via cfe-commits
https://github.com/tJener created https://github.com/llvm/llvm-project/pull/85957 A coroutine function body (`CoroutineBodyStmt`) may have null children, which causes `isa` to segfault. >From 386e7dea15739df65ad9ecb3dd7f7dcd23b6acae Mon Sep 17 00:00:00 2001 From: Eric Li Date: Wed, 20 Mar 202

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Eric Li (tJener) Changes A coroutine function body (`CoroutineBodyStmt`) may have null children, which causes `isa` to segfault. --- Full diff: https://github.com/llvm/llvm-project/pull/85957.diff 2 Files Affected: - (modified) clang/l

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/2] [clang] Set correct FPOptions if attribute 'optnone' present

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 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 a9fe23cde3ee554f4bd6118edcc2e747f3a8d8d5 386e7dea15739df65ad9ecb3dd7f7dcd23b6acae --

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall approved this pull request. https://github.com/llvm/llvm-project/pull/85957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Sam McCall via cfe-commits
@@ -4628,6 +4662,21 @@ TEST(TransferTest, DoesNotCrashOnUnionThisExpr) { LangStandard::lang_cxx17, /*ApplyBuiltinTransfer=*/true, "operator="); } +TEST(TransferTest, DoesNotCrashOnNullChildren) { + std::string Code = (CoroutineLibrary + R"cc( +task foo() noexcept {

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall edited https://github.com/llvm/llvm-project/pull/85957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Eric Li via cfe-commits
https://github.com/tJener updated https://github.com/llvm/llvm-project/pull/85957 >From 386e7dea15739df65ad9ecb3dd7f7dcd23b6acae Mon Sep 17 00:00:00 2001 From: Eric Li Date: Wed, 20 Mar 2024 12:15:45 -0400 Subject: [PATCH 1/2] [clang][dataflow] Fix crash when analyzing a coroutine A coroutine

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Eric Li via cfe-commits
https://github.com/tJener updated https://github.com/llvm/llvm-project/pull/85957 >From 386e7dea15739df65ad9ecb3dd7f7dcd23b6acae Mon Sep 17 00:00:00 2001 From: Eric Li Date: Wed, 20 Mar 2024 12:15:45 -0400 Subject: [PATCH 1/3] [clang][dataflow] Fix crash when analyzing a coroutine A coroutine

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Eric Li via cfe-commits
@@ -4628,6 +4662,21 @@ TEST(TransferTest, DoesNotCrashOnUnionThisExpr) { LangStandard::lang_cxx17, /*ApplyBuiltinTransfer=*/true, "operator="); } +TEST(TransferTest, DoesNotCrashOnNullChildren) { + std::string Code = (CoroutineLibrary + R"cc( +task foo() noexcept {

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies… (PR #85962)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 created https://github.com/llvm/llvm-project/pull/85962 … with auto keyword Reported by Static Analyzer Tool: In clang::dataflow::Environment::initialize(): Using the auto keyword without an & causes the copy of an object of type LambdaCapture >From cb419a47b3

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies… (PR #85962)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/85962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies… (PR #85962)

2024-03-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (smanna12) Changes Reported by Static Analyzer Tool: In clang::dataflow::Environment::initialize(): Using the auto keyword without an & causes the copy of an object of type LambdaCapture --- Full diff: https://github.com/llvm/llvm-pr

[clang] [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (PR #85962)

2024-03-20 Thread via cfe-commits
https://github.com/smanna12 edited https://github.com/llvm/llvm-project/pull/85962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a6a6066 - [clang][dataflow] Fix crash when analyzing a coroutine (#85957)

2024-03-20 Thread via cfe-commits
Author: Eric Li Date: 2024-03-20T12:45:30-04:00 New Revision: a6a6066290679f23f2bd6b27afc7a06aab07590f URL: https://github.com/llvm/llvm-project/commit/a6a6066290679f23f2bd6b27afc7a06aab07590f DIFF: https://github.com/llvm/llvm-project/commit/a6a6066290679f23f2bd6b27afc7a06aab07590f.diff LOG:

[clang] [clang][dataflow] Fix crash when analyzing a coroutine (PR #85957)

2024-03-20 Thread Eric Li via cfe-commits
https://github.com/tJener closed https://github.com/llvm/llvm-project/pull/85957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9cb5004 - Reland [FMV] Emit the resolver along with the default version definit… (#85923)

2024-03-20 Thread via cfe-commits
Author: Alexandros Lamprineas Date: 2024-03-20T16:49:51Z New Revision: 9cb5004209323d6fa8af8c41e456818c20585984 URL: https://github.com/llvm/llvm-project/commit/9cb5004209323d6fa8af8c41e456818c20585984 DIFF: https://github.com/llvm/llvm-project/commit/9cb5004209323d6fa8af8c41e456818c20585984.di

[clang] Reland [FMV] Emit the resolver along with the default version definit… (PR #85923)

2024-03-20 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea closed https://github.com/llvm/llvm-project/pull/85923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 25d61be - [X86] avx-shuffle-builtins.c - limit to x86 targets

2024-03-20 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-03-20T16:59:11Z New Revision: 25d61be8a5e563988661709c5d01f67c06b388e2 URL: https://github.com/llvm/llvm-project/commit/25d61be8a5e563988661709c5d01f67c06b388e2 DIFF: https://github.com/llvm/llvm-project/commit/25d61be8a5e563988661709c5d01f67c06b388e2.diff LOG:

[clang] b20360a - clang driver: enable fast unaligned access for Android on RISCV64 (#85704)

2024-03-20 Thread via cfe-commits
Author: AdityaK Date: 2024-03-20T10:15:23-07:00 New Revision: b20360abeb3a80281dc082f1e093abd13cb1ee4c URL: https://github.com/llvm/llvm-project/commit/b20360abeb3a80281dc082f1e093abd13cb1ee4c DIFF: https://github.com/llvm/llvm-project/commit/b20360abeb3a80281dc082f1e093abd13cb1ee4c.diff LOG:

[clang] clang driver: enable fast unaligned access for Android on RISCV64 (PR #85704)

2024-03-20 Thread via cfe-commits
https://github.com/hiraditya closed https://github.com/llvm/llvm-project/pull/85704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

2024-03-20 Thread via cfe-commits
goldsteinn wrote: > Apart from the correctness issues, we've seen some regressions on various > benchmarks from LLVM Test Suite after this patch. Specifically, around 3-5% > regression on x86-64 in various metrics of the > [Interpolation](https://github.com/llvm/llvm-test-suite/tree/main/Micro

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Balázs Kéri via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Balázs Kéri via cfe-commits
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect( +SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Balázs Kéri via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Balázs Kéri via cfe-commits
@@ -1217,6 +1231,11 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, E.isStreamEof() ? ErrorFEof : ErrorFEof | ErrorFError; StateFailed = E.setStreamState( StateFailed, StreamState::getOpened(Desc, NewES, !NewES.isFEof())); + // On failure, the con

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Balázs Kéri via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/2] [clang] Set correct FPOptions if attribute 'optnone' present

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread John McCall via cfe-commits
@@ -1495,6 +1495,10 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, return Actions.ActOnFinishFunctionBody(Res, nullptr, false); } + // Some function attributes (like OptimizeNoneAttr) affect FP options. + Sema::FPFeaturesStateRAII SaveFPFeatures(Action

[clang] [llvm] [clang][HLSL][SPRI-V] Add convergence intrinsics (PR #80680)

2024-03-20 Thread Natalie Chouinard via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: https://github.com/sudonatalie commented: LGTM in terms of how this affects the SPIR-V backend, but if others

[clang] [llvm] [clang][HLSL][SPRI-V] Add convergence intrinsics (PR #80680)

2024-03-20 Thread Natalie Chouinard via cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= , Nathan =?utf-8?q?Gau=C3=ABr?= Message-ID: In-Reply-To: https://github.com/sudonatalie approved this pull request. https://github.com/

[clang] [HIP][NFC] Refactor managed var codegen (PR #85976)

2024-03-20 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/85976 Refactor managed variable handling in codegen so that the transformation is done separately from registration. This will allow the new driver to register the managed var in the linker wrapper. >From 11d10a8ac

[clang] [HIP][NFC] Refactor managed var codegen (PR #85976)

2024-03-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yaxun (Sam) Liu (yxsamliu) Changes Refactor managed variable handling in codegen so that the transformation is done separately from registration. This will allow the new driver to register the managed var in the linker wrapper. --- Full

[clang] [HIP][NFC] Refactor managed var codegen (PR #85976)

2024-03-20 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B edited https://github.com/llvm/llvm-project/pull/85976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP][NFC] Refactor managed var codegen (PR #85976)

2024-03-20 Thread Artem Belevich via cfe-commits
@@ -1160,9 +1152,8 @@ void CGNVCUDARuntime::createOffloadingEntries() { // Returns module constructor to be added. llvm::Function *CGNVCUDARuntime::finalizeModule() { + transformManagedVars(); Artem-B wrote: This does not look like "NFC" as we now perform th

[clang] [HIP][NFC] Refactor managed var codegen (PR #85976)

2024-03-20 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. LGTM, sans the "NFC" part in the description. https://github.com/llvm/llvm-project/pull/85976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

2024-03-20 Thread via cfe-commits
asmok-g wrote: Well, I'm not sure how proper that wold be as a reproducer, I extracted the mentioned test to a program: ``` #include #include "third_party/swiftshader/src/Reactor/Coroutine.hpp" #include "third_party/swiftshader/src/Reactor/Reactor.hpp" using float4 = float[4]; using int4 = i

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > I am also ok with changing the patch to reject programs whose await_suspend > > doesn't strictly return std::coroutine_handle if upstream prefers. > > It should be good to do that since it makes the behavior more conforming. And > maybe it is better to do this a seper

<    1   2   3   4   >