[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-04-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 1/9] [clangd] Support go-to-definition on type hints. The core par

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Got it. I've renamed the flag as `-fexperimental-modules-reduced-bmi`. > > Thanks. > > > I feel the suggestion like let users to use `-Xclang` options look odd.. > > I think the point here is that we want **expert** users to try this out (with > understanding that it mig

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this patch in next week if no objection comes in. https://github.com/llvm/llvm-project/pull/85050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombiner] Remove trivially dead `llvm.allow.{runtime,ubsan}.check()` (PR #84851)

2024-04-01 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/84851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add new check readability-enum-initial-value (PR #86129)

2024-04-01 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/86129 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 3365d62 - [clang-tidy] add new check readability-enum-initial-value (#86129)

2024-04-01 Thread via cfe-commits
Author: Congcong Cai Date: 2024-04-01T15:53:57+08:00 New Revision: 3365d62179011aad6da3e4cbcb31044eec3462a2 URL: https://github.com/llvm/llvm-project/commit/3365d62179011aad6da3e4cbcb31044eec3462a2 DIFF: https://github.com/llvm/llvm-project/commit/3365d62179011aad6da3e4cbcb31044eec3462a2.diff

[clang] ef0291e - [NFC] [Serialization] Reordering lexcical and visible TU block after type decl offsets

2024-04-01 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-04-01T16:16:03+08:00 New Revision: ef0291e5f4451abbafab0c839bf51a6382f735f3 URL: https://github.com/llvm/llvm-project/commit/ef0291e5f4451abbafab0c839bf51a6382f735f3 DIFF: https://github.com/llvm/llvm-project/commit/ef0291e5f4451abbafab0c839bf51a6382f735f3.diff LO

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

2024-04-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I think the support for modules in clangd is pretty important. I posted https://discourse.llvm.org/t/rfc-directions-for-modules-support-in-clangd/78072 and let's see if we can make some progress. https://github.com/llvm/llvm-project/pull/66462

[clang] [llvm] [PowerPC] Implement 32-bit expansion for rldimi (PR #86783)

2024-04-01 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises updated https://github.com/llvm/llvm-project/pull/86783 >From b886dcf2da25417d9f8cd75ff4aa58686e35139d Mon Sep 17 00:00:00 2001 From: Qiu Chaofan Date: Wed, 27 Mar 2024 17:11:04 +0800 Subject: [PATCH] [PowerPC] Implement 32-bit expansion for rldimi rldimi is 64-bit

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-04-01 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Friendly ping @cor3ntin and @erichkeane if you're back in the offices. https://github.com/llvm/llvm-project/pull/82310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Pol M via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -10895,6 +10899,132 @@ bool VectorExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { return Success(APValue(ResultElements.data(), ResultElements.

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Pol M via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -10895,6 +10899,132 @@ bool VectorExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { return Success(APValue(ResultElements.data(), ResultElements.

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Pol M via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -10895,6 +10899,132 @@ bool VectorExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { return Success(APValue(ResultElements.data(), ResultElements.

[clang] [llvm] [PowerPC] Implement 32-bit expansion for rldimi (PR #86783)

2024-04-01 Thread Kai Luo via cfe-commits
bzEq wrote: > due to backward compatibility, it needs to be expanded into series of rlwimi > in 32-bit environment Why must be 'series of rlwimi'? Why don't we just expand it following what ISA describes and let legalizer generates code sequence under 32-bit mode? ``` n ← sh5 || sh0:4 r ← ROT

[clang] [C99] Claim conformance to WG14 N717 (PR #87228)

2024-04-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes This was the paper that added Universal Character Names to C. --- Full diff: https://github.com/llvm/llvm-project/pull/87228.diff 3 Files Affected: - (added) clang/test/C/C99/n717.c (+69) - (added)

[clang] [C99] Claim conformance to WG14 N717 (PR #87228)

2024-04-01 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 84299df301dc07ea83fa8378051103195c3a7c65...f8e130df9e602662444280346b71a82347ae8a29 clang

[clang] [llvm] MIPS: Support -m(no-)unaligned-access for r6 (PR #85174)

2024-04-01 Thread Nathan Sidwell via cfe-commits
urnathan wrote: #65742 is committed, so MIPS' TargetInfo will need adjusting to propagate the unaligned capability. See 7df79ababee8 https://github.com/llvm/llvm-project/pull/85174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-01 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand created https://github.com/llvm/llvm-project/pull/87233 The previous API relied on pointer equality of inputs and outputs to signal whether a change occured. This was too subtle and led to bugs in practice. It was also very limiting: the override could not return an equiv

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Yitzhak Mandelbaum (ymand) Changes The previous API relied on pointer equality of inputs and outputs to signal whether a change occured. This was too subtle and led to bugs in practice. It was also very limiting: the override could not retu

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > As I've just commented at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114479 > the `__is_array` intrinsic exists to optimize `std::is_array` and so should > match its existing behaviour. If you want to change the behaviour of > `std::is_array` then please do so via an LW

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-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 a1a8bb1d3ae9a535526aba9514e87f76e2d040fa 6889df911a11fc5c27149f138176166aef3e1f73 --

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-01 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/87233 >From b7f63ed7ca3c503f55eccc215f0a66368e2c5e5e Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 1 Apr 2024 12:13:39 + Subject: [PATCH] [clang][dataflow] Refactor `widen` API to be explicit about cha

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-04-01 Thread Jonathan Wakely via cfe-commits
jwakely wrote: Last time I checked, neither GCC nor Clang allowed T[0] to match a partial specialization for `is_array` so the extension isn't very well extended :) https://github.com/llvm/llvm-project/pull/86652 ___ cfe-commits mailing list cfe-commi

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Last time I checked, neither GCC nor Clang allowed T[0] to match a partial > specialization for `is_array` so the extension isn't very well extended > :) Oh, I agree, I am learning to loathe this extension the more I look into this. Did you see this lovely bit: > Oh wow

[clang] [RFC][Clang] Enable custom type checking for printf (PR #86801)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I looked at the OpenCL spec for C standard library support and was > > surprised that 1) it's only talking about C99 so it's unclear what happens > > for C11 (clause 6 says "This document describes the modifications and > > restrictions to C99 and C11 in OpenCL C" but 6

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-01 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/87233 >From d8d875271bd47b71701143afb06ea654546e2b7c Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 1 Apr 2024 12:13:39 + Subject: [PATCH] [clang][dataflow] Refactor `widen` API to be explicit about cha

[clang] [clang] Fix bitfield access unit for vbase corner case (PR #87238)

2024-04-01 Thread Nathan Sidwell via cfe-commits
https://github.com/urnathan created https://github.com/llvm/llvm-project/pull/87238 This fixes #87227 My change to bitfield access unit allocation (#65742) causes an ICE for a corner case of vbase allocation: a class where an unshared (i.e. not the nearly-empty base optimization) vbase is plac

[clang] [clang] Move tailclipping to bitfield allocation (PR #87090)

2024-04-01 Thread Nathan Sidwell via cfe-commits
https://github.com/urnathan converted_to_draft https://github.com/llvm/llvm-project/pull/87090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-04-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, but I think the next steps are two-fold: add a second `Sema` class for something else (perhaps OpenMP?) and add a base class for accessing commonly used functionality (`getASTContext()`, `Diag()`, etc). https://github.com/llvm/l

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-04-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/84184 >From 23f4208fb9978370f59cae16db0747acb3e2c906 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Mar 2024 18:01:35 +0300 Subject: [PATCH 1/7] [clang] Factor out OpenACC part of `Sema` This patch mov

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A quick few things I noticed, not nearly a thorough review. https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-04-01 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I'd personally be fine with deprecating it. As I said above, we use it in libc++ for padding inside `string` like ```c++ struct short_string { ; char padding[sizeof(value_type) - 1]; ; }; ``` That could be refactored relatively easily as ```c++ template struct padding_t

[clang] [HLSL] Implement array temporary support (PR #79382)

2024-04-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/79382 >From bd74d7db681cd07fda56f26e79e047c6d1a41f6b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 29 Feb 2024 15:37:50 -0600 Subject: [PATCH 1/9] [HLSL] Pass arrays by value HLSL constant sized array fu

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/87144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Thank you! LGTM aside from expanding the testing a bit. https://github.com/llvm/llvm-project/pull/87144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-01 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s +// expected-no-diagnostics + +enum {A, S, D, F}; +int main() { +using asdf = decltype(A); +using enum asdf; // this line causes the crash +return 0; +} AaronBallman wrote: I'd li

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -583,11 +583,14 @@ class alignas(void *) Stmt { unsigned IsArrow : 1; /// True if this member expression used a nested-name-specifier to -/// refer to the member, e.g., "x->Base::f", or found its member via -/// a using declaration. When true, a MemberExprN

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 2 nits, else LGTM. https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1735,48 +1757,21 @@ MemberExpr *MemberExpr::Create( ValueDecl *MemberDecl, DeclAccessPair FoundDecl, DeclarationNameInfo NameInfo, const TemplateArgumentListInfo *TemplateArgs, QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR) { - bool HasQ

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
@@ -1735,48 +1757,21 @@ MemberExpr *MemberExpr::Create( ValueDecl *MemberDecl, DeclAccessPair FoundDecl, DeclarationNameInfo NameInfo, const TemplateArgumentListInfo *TemplateArgs, QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR) { - bool HasQ

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81642 >From b45a42322682f3b872e6753965c4e4a7edb68333 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 9 Feb 2024 14:00:49 -0500 Subject: [PATCH 1/4] [Clang] Unify interface for accessing template argume

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-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 f914e8e77c4703814e2f2dcef1d4569b17837c92 01858345a1146f761dec8e5d0a5a36dc0507ec48 --

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81642 >From b45a42322682f3b872e6753965c4e4a7edb68333 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 9 Feb 2024 14:00:49 -0500 Subject: [PATCH 1/5] [Clang] Unify interface for accessing template argume

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/10] add clang-tidy check readability-math-missing-parentheses Signed

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -129,6 +129,12 @@ New checks Replaces certain conditional statements with equivalent calls to ``std::min`` or ``std::max``. +- New :doc:`readability-math-missing-parentheses 11happy wrote: done https://github.com/llvm/llvm-project/pull/84481 _

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,25 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for missing parentheses in mathematical expressions that involve operators +of different priorities. Parentheses i

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// 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-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,81 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +int foo(){ +return 5; +} + +int bar(){ +return 4; +} + +class fun{ +public: +int A; +double B; +fun(){ +A = 5; +B = 5.4; +} +}; + +void f(){ +//C

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// 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] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -2596,27 +2588,14 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -TypeSourc

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -2545,10 +2545,12 @@ ASTDeclReader::VisitClassTemplateSpecializationDeclImpl( } // Explicit info. - if (TypeSourceInfo *TyInfo = readTypeSourceInfo()) { -auto *ExplicitInfo = -new (C) ClassTemplateSpecializationDecl::ExplicitSpecializationInfo; -Explici

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A few more suggestions, also I like Shafik's suggestion on the variable name. https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1455,21 +1455,17 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) { // If this is a class template specialization, print the template // arguments. - if (const auto *Spec = dyn_cast(D)) { -ArrayRef Args; -TypeSourceInfo *TAW = Spec->getTypeAsWritten

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1455,21 +1455,17 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) { // If this is a class template specialization, print the template // arguments. - if (const auto *Spec = dyn_cast(D)) { -ArrayRef Args; -TypeSourceInfo *TAW = Spec->getTypeAsWritten

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/11] add clang-tidy check readability-math-missing-parentheses Signed

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

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/11] add clang-tidy check readability-math-missing-parentheses Signed

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers commented: As the author of https://reviews.llvm.org/D54188 and the TODO added from there, this patch is the right thing to do. I fixed a false positive diagnostic for C and knew that the fix was insufficient for C++. I do appreciate the abundance of caution

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
@@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +exter

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
@@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +exter

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Nick Desaulniers via cfe-commits
@@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +exter

[clang] [compiler-rt] [llvm] [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (PR #66825)

2024-04-01 Thread Mingming Liu via cfe-commits
https://github.com/minglotus-6 closed https://github.com/llvm/llvm-project/pull/66825 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-01 Thread via cfe-commits
@@ -0,0 +1,252 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// 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-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-01 Thread via cfe-commits
https://github.com/sopyb edited https://github.com/llvm/llvm-project/pull/85572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenCL] Fix BIenqueue_kernel fallthrough (PR #83238)

2024-04-01 Thread Anastasia Stulova via cfe-commits
https://github.com/AnastasiaStulova approved this pull request. Makes sense, LGTM! Thanks https://github.com/llvm/llvm-project/pull/83238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-01 Thread via cfe-commits
@@ -0,0 +1,276 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// 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

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -12,6 +12,7 @@ #ifndef __LIBUNWIND_EXT__ #define __LIBUNWIND_EXT__ +#ifndef __wasm__ EricWF wrote: I would much rather you guard the usage of this header in each file. That way it's clear to the reader in context that the include is unused under a certai

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -10,6 +10,7 @@ #ifndef LIBUNWIND_CET_UNWIND_H #define LIBUNWIND_CET_UNWIND_H +#ifndef __wasm__ EricWF wrote: Again, I don't think `#ifdef`-ing out entire headers is the best way to do this, or is even necessary. https://github.com/llvm/llvm-project/pull

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -15,6 +15,7 @@ #ifndef UNWIND_ASSEMBLY_H #define UNWIND_ASSEMBLY_H +#ifndef __wasm__ EricWF wrote: Again, this is not OK. First, this file just defines macros, so even under WASM it should be safe to include. If you're hitting the `#error` case in the `#

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -431,6 +432,7 @@ int __unw_remove_find_dynamic_unwind_sections( } #endif // __APPLE__ +#endif EricWF wrote: At minimum this needs a comment matching it to the specific block it's closing. https://github.com/llvm/llvm-project/pull/79667 ___

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -12,7 +12,7 @@ // functions. We need to ensure that the return value is sign-extended in the // same way as GCC expects (since otherwise GCC-generated __builtin_isinf // returns true for finite 128-bit floating-point numbers). -#ifdef __aarch64__ +#if defined(__aarch64__) ||

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -39,3 +40,5 @@ extern void *__libunwind_cet_get_registers(unw_cursor_t *); extern void *__libunwind_cet_get_jump_target(void); EricWF wrote: What is the problem with exposing these two declarations, even if they're not defined? https://github.com/llvm/llvm-

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
@@ -12,6 +12,7 @@ #include #include "config.h" +#ifndef __wasm__ EricWF wrote: The problem is that it makes the file a lot harder to read, each `#ifdef` block enclosed within becomes harder to read and reason about its scope. Though I see that _maybe_ WAS

[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)

2024-04-01 Thread via cfe-commits
EricWF wrote: @trcrsired Could you please describe what bits of libunwind WASM uses? It seems to me almost all of the functionality is stripped out? Could you also provide instructions to build and test libunwind under WASM so we could add CI coverage? And so I can test this change myself. ht

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle

[clang-tools-extra] [clang-tidy] add check to suggest replacement of nested std::min or std::max with initializer lists (PR #85572)

2024-04-01 Thread via cfe-commits
@@ -0,0 +1,252 @@ +//===--- MinMaxUseInitializerListCheck.cpp - clang-tidy ---===// +// +// 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] [clang] Fix incorrect line numbers with -E and raw string (#47577) (PR #77021)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > This will need a release note > > Are you asking me to do this? I did not see any instructions about how to do > this. Sorry for not seeing this question earlier! Yes, you should add a release note to clang/docs/ReleaseNotes.rst; we have a section for bug fixes: https

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81642 >From b45a42322682f3b872e6753965c4e4a7edb68333 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 9 Feb 2024 14:00:49 -0500 Subject: [PATCH 1/6] [Clang] Unify interface for accessing template argume

[clang] MIPS/Clang: Set HasUnalignedAccess false if +strict-align (PR #87256)

2024-04-01 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/87256 TargetInfo has HasUnalignedAccess support now. For MIPSr6, we should set it according strict-align. For pre-R6, we always set strict-align and HasUnalignedAccess to false. >From ecee40e72582c98e74e89d3aff97a832

[clang] MIPS/Clang: Set HasUnalignedAccess false if +strict-align (PR #87256)

2024-04-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: YunQiang Su (wzssyqa) Changes TargetInfo has HasUnalignedAccess support now. For MIPSr6, we should set it according strict-align. For pre-R6, we always set strict-align and HasUnalignedAccess to false. --- Full diff: https://github.com/l

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Regarding "Still waiting on this?", I pushed a commit that addresses the fixme. I'll be addressing the rest of your review comments in a subsequent commit.. Also, if we are renaming `ExplicitInstantiationInfo::ExternLoc` to `ExternKeywordLoc`, should we rename th

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: I'd be OK with Clang providing some level of metadata to clarify which is an FMV, and what our target features are. But this sort of analysis still needs to happen in LLVM. https://github.com/llvm/llvm-project/pull/80093 ___ cfe-

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane Regarding "Still waiting on this?", I pushed a commit that > addresses the fixme. I'll be addressing the rest of your review comments in a > subsequent commit.. > > Also, if we are renaming `ExplicitInstantiationInfo::ExternLoc` to > `ExternKeywordLoc`, should

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-04-01 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/79230 >From 44813fefa59b442abcc6cb23c2ac8d3f78e44efc Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 16 Jan 2024 13:18:09 -0800 Subject: [PATCH 01/11] Add support for builtin_verbose_trap The builtin causes

[clang] MIPS/Clang: Set HasUnalignedAccess false if +strict-align (PR #87257)

2024-04-01 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/87257 TargetInfo has HasUnalignedAccess support now. For MIPSr6, we should set it according strict-align. For pre-R6, we always set strict-align and HasUnalignedAccess to false. >From ecee40e72582c98e74e89d3aff97a832

[clang] MIPS/Clang: Set HasUnalignedAccess false if +strict-align (PR #87257)

2024-04-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: YunQiang Su (wzssyqa) Changes TargetInfo has HasUnalignedAccess support now. For MIPSr6, we should set it according strict-align. For pre-R6, we always set strict-align and HasUnalignedAccess to false. --- Full diff: https://github.com/l

[clang] [M68k] Change gcc register name from a7 to sp. (PR #87095)

2024-04-01 Thread Min-Yih Hsu via cfe-commits
mshockwave wrote: Is it possible use `TargetInfo::getGCCRegAliases` to model the aliasing between a7 and sp? Also, could you add a simple test? https://github.com/llvm/llvm-project/pull/87095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-04-01 Thread Jon Roelofs via cfe-commits
jroelofs wrote: I'm not sure llvm needs to know the priorities. I haven't had time to work on this, but my plan was to have something that attempts to step through the resolver instruction by instruction with known bits for the value loaded from `__aarch64_cpu_features.features` according to t

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'm not sure llvm needs to know the priorities. I haven't had time to work on > this, but my plan was to have something that attempts to step through the > resolver instruction by instruction with known bits for the value loaded from > `__aarch64_cpu_features.features` acco

  1   2   3   4   >