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

2024-02-23 Thread Amy Kwan via cfe-commits
@@ -223,6 +223,8 @@ CODEGENOPT(MCDCCoverage , 1, 0) ///< Enable MC/DC code coverage criteria. /// If -fpcc-struct-return or -freg-struct-return is specified. ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Default) + /// If -fcomplex-ppc-gnu-ab

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

2024-02-23 Thread Amy Kwan via cfe-commits
@@ -361,6 +439,9 @@ ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { return ABIArgInfo::getDirect(CoerceTy); } } + if (isComplexInRegABI && RetTy->isAnyComplexType()) { amy-kwan wrote: Braces not needed here. https://git

[clang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #75711)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk approved this pull request. I think there are risks to shadowing `yvals_core.h`, but @CaseyCarter is at least aware of it [here](https://github.com/microsoft/STL/issues/3634#issuecomment-1904956652). Once Clang ships its own intrin0.h header, the MSVC STL can adjust thei

[clang] 8fe4487 - [OpenACC] Fix branch-in/out to not refer to a 'region'

2024-02-23 Thread via cfe-commits
Author: erichkeane Date: 2024-02-23T10:02:26-08:00 New Revision: 8fe4487e23e543568745ef461660b1d288805b81 URL: https://github.com/llvm/llvm-project/commit/8fe4487e23e543568745ef461660b1d288805b81 DIFF: https://github.com/llvm/llvm-project/commit/8fe4487e23e543568745ef461660b1d288805b81.diff LO

[clang] [Clang] Fixes of builtin definitions after PR #68324. (PR #81022)

2024-02-23 Thread via cfe-commits
michele-scandale wrote: @AaronBallman, ping. https://github.com/llvm/llvm-project/pull/81022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ObjC] Check entire chain of superclasses to see if class layout can be statically known (PR #81335)

2024-02-23 Thread via cfe-commits
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/81335 >From fe596f4241328f36bda734b2c006aef769efb2c8 Mon Sep 17 00:00:00 2001 From: Rose <83477269+ataridre...@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:51:15 -0500 Subject: [PATCH 1/2] [ObjC] Add pre-commi

[clang] [llvm] [HLSL] Implementation of dot intrinsic (PR #81190)

2024-02-23 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/81190 >From fad7e6eac6a1a65ce00ab3e4f64d5774b426c91d Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Thu, 8 Feb 2024 11:08:59 -0500 Subject: [PATCH 1/4] [HLSL] Implementation of dot intrinsic This change implements

[clang] [RFC][clang][Support] Extract type parsing function. [NFCI] (PR #82797)

2024-02-23 Thread Francesco Petrogalli via cfe-commits
https://github.com/fpetrogalli edited https://github.com/llvm/llvm-project/pull/82797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
rnk wrote: I'm short on time, so I can't respond to all the discussion here, but at a high level, I agree with this direction and it's something I discussed with Microsoft folks working on ASan in the past, so I'm happy to see it come together. There is a great deal of build configuration com

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-23 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > * with `-fstrict-vtable-pointers` flag, we update the vtpr assumption > correctly (mark the load/store vptr with appropriate invariant group > intrinsics) to prevent incorrect vptr load folding; I _guess_ we want a variant of this intrinsic which doesn't affect analyza

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-02-23 Thread zhijian lin via cfe-commits
https://github.com/diggerlin created https://github.com/llvm/llvm-project/pull/82809 The features which __builtin_cpu_support() supports are descripted in https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/PowerPC-Built-in-Functions.html#:~:text=The%20__builtin_cpu_supports%20function%20requires,in%2

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

2024-02-23 Thread Paul Walker via cfe-commits
https://github.com/paulwalker-arm created https://github.com/llvm/llvm-project/pull/82810 Implements the follow-on work requesting on https://github.com/llvm/llvm-project/pull/75614. >From a75304dffb77be1fb15f268000bfbdd07be774e1 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 23 Feb 20

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-backend-powerpc Author: zhijian lin (diggerlin) Changes The features which __builtin_cpu_support() supports are descripted in https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/PowerPC-Built-in-Functions.html#:~:text=The%20_

[clang] [llvm] [LLVM][TypeSize] Remove default constructor. (PR #82810)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-llvm-support Author: Paul Walker (paulwalker-arm) Changes Implements the follow-on work requesting on https://github.com/llvm/llvm-project/pull/75614. --- Full diff: https://github.com/llvm/llvm-project/pull/82810.diff 2 Fi

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Jun Wang via cfe-commits
@@ -194,3 +204,87 @@ __global__ void non_cexpr_waves_per_eu_2() {} // expected-error@+1{{'amdgpu_waves_per_eu' attribute requires parameter 1 to be an integer constant}} __attribute__((amdgpu_waves_per_eu(2, ipow2(2 __global__ void non_cexpr_waves_per_eu_2_4() {} + +// exp

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -194,3 +204,87 @@ __global__ void non_cexpr_waves_per_eu_2() {} // expected-error@+1{{'amdgpu_waves_per_eu' attribute requires parameter 1 to be an integer constant}} __attribute__((amdgpu_waves_per_eu(2, ipow2(2 __global__ void non_cexpr_waves_per_eu_2_4() {} + +// exp

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-02-23 Thread zhijian lin via cfe-commits
https://github.com/diggerlin updated https://github.com/llvm/llvm-project/pull/82809 >From cef79b36bcb3f4b7452d01aafdf111ff0e50605d Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 23 Feb 2024 13:23:18 -0500 Subject: [PATCH 1/2] Implement a subset of builtin_cpu_supports() features --- clang

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-02-23 Thread zhijian lin via cfe-commits
https://github.com/diggerlin updated https://github.com/llvm/llvm-project/pull/82809 >From cef79b36bcb3f4b7452d01aafdf111ff0e50605d Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 23 Feb 2024 13:23:18 -0500 Subject: [PATCH 1/3] Implement a subset of builtin_cpu_supports() features --- clang

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/82814 Like with 'break'/'continue', returning out of a compute construct is ill-formed, so this implements the diagnostic. However, unlike the OpenMP implementation of this same diagnostic, OpenACC doesn't have a

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes Like with 'break'/'continue', returning out of a compute construct is ill-formed, so this implements the diagnostic. However, unlike the OpenMP implementation of this same diagnostic, OpenACC doesn't have

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-23 Thread John McCall via cfe-commits
rjmccall wrote: > > On the target hook, it's a shame we can't easily get this information from > > LLVM. I believe it's already there — `TargetLowering` has an > > `allowsMisalignedMemoryAccesses` method that includes some approximation of > > how fast a particular access would be. In practice

[clang] [clang] Note that optnone and target attributes do not apply to nested functions (PR #82815)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk created https://github.com/llvm/llvm-project/pull/82815 This behavior is true for all attributes, but this behavior can be surprising for attributes which have function-wide effects, such as `optnone` and `target`. Most other function attributes affect the prototype or se

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 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 962a6970f2827bcdda574426701c7c57f79a1ccf cdbf2a137ed7ba0a6d40f955072ef636ee93b292 --

[clang-tools-extra] [clangd] Fix renaming single argument ObjC methods (PR #82396)

2024-02-23 Thread David Goldman via cfe-commits
https://github.com/DavidGoldman updated https://github.com/llvm/llvm-project/pull/82396 >From 8a9c09575ed143e762faa7abf48285ed6b4b0335 Mon Sep 17 00:00:00 2001 From: David Goldman Date: Tue, 20 Feb 2024 13:14:26 -0500 Subject: [PATCH 1/3] [clangd] Fix renaming single argument ObjC methods Add

[clang] [clang] Note that optnone and target attributes do not apply to nested functions (PR #82815)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Reid Kleckner (rnk) Changes This behavior is true for all attributes, but this behavior can be surprising for attributes which have function-wide effects, such as `optnone` and `target`. Most other function attributes affect the prototype

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/82814 >From cdbf2a137ed7ba0a6d40f955072ef636ee93b292 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 23 Feb 2024 10:36:31 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'return' branch-out of Compute Construct

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

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

[clang-tools-extra] 59e5519 - [clangd] Fix renaming single argument ObjC methods (#82396)

2024-02-23 Thread via cfe-commits
Author: David Goldman Date: 2024-02-23T14:11:39-05:00 New Revision: 59e5519c81c57a66424d657864ce69cb0efdc7d8 URL: https://github.com/llvm/llvm-project/commit/59e5519c81c57a66424d657864ce69cb0efdc7d8 DIFF: https://github.com/llvm/llvm-project/commit/59e5519c81c57a66424d657864ce69cb0efdc7d8.diff

[clang-tools-extra] [clangd] Fix renaming single argument ObjC methods (PR #82396)

2024-02-23 Thread David Goldman via cfe-commits
https://github.com/DavidGoldman closed https://github.com/llvm/llvm-project/pull/82396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

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

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-02-23 Thread zhijian lin via cfe-commits
https://github.com/diggerlin updated https://github.com/llvm/llvm-project/pull/82809 >From cef79b36bcb3f4b7452d01aafdf111ff0e50605d Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 23 Feb 2024 13:23:18 -0500 Subject: [PATCH 1/4] Implement a subset of builtin_cpu_supports() features --- clang

[clang-tools-extra] [clang-tidy] Add support for determining constness of more expressions. (PR #82617)

2024-02-23 Thread Felix Berger via cfe-commits
https://github.com/fberger approved this pull request. https://github.com/llvm/llvm-project/pull/82617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. Looks good. Looks like something similar should be done for goto https://github.com/llvm/llvm-project/pull/82814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
erichkeane wrote: > Looks good. Looks like something similar should be done for goto Thanks! Yes, I agree we probably want to do something similar for goto, but I'm still looking at it. Trying to keep patches small :) https://github.com/llvm/llvm-project/pull/82814 _

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-23 Thread Aaron Ballman via cfe-commits
@@ -14277,6 +14325,113 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind GetConversionKind(QualType FromType, AaronBallman wrot

[clang] [clang-tools-extra] [clangd] Use `SymbolName` to represent Objective-C selectors (PR #82061)

2024-02-23 Thread Alex Hoppen via cfe-commits
ahoppen wrote: For some context: When I’m talking about * finding the ranges to rename based on an index that’s not clangd’s built-in index* I meant a request like https://github.com/apple/llvm-project/pull/7973. This allows us to use Apple’s IndexStore to find the locations of symbols to rena

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

2024-02-23 Thread via cfe-commits
https://github.com/DanielKristofKiss created https://github.com/llvm/llvm-project/pull/82819 Branch protection, sign return address, guarded control stack attributes are only emitted as module flags if not specified per function. The inliner might inline functions with different set of flag

[clang] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm @llvm/pr-subscribers-clang Author: Dani (DanielKristofKiss) Changes Branch protection, sign return address, guarded control stack attributes are only emitted as module flags if not specified per function. The inliner might inline functio

[clang] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Dani (DanielKristofKiss) Changes Branch protection, sign return address, guarded control stack attributes are only emitted as module flags if not specified per function. The inliner might inline functions with different set of

[clang] [NFC] Fix formatting so CI can continue (PR #82721)

2024-02-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/82721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Fix formatting so CI can continue (PR #82721)

2024-02-23 Thread Chris B via cfe-commits
llvm-beanz wrote: Do you have a link to the CI that failed this? The official clang doc build succeeded and published the docs. https://github.com/llvm/llvm-project/pull/82721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

2024-02-23 Thread via cfe-commits
DanielKristofKiss wrote: RFC as I'm not sure the right approach is to emit that many attribute always. LLVM's Function::createWithDefaultAttr to be extended too with propagation of the module flags to the function. https://github.com/llvm/llvm-project/pull/82819

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,167 @@ +//===--- UnsafeCrtpCheck.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] [flang] [llvm] [Docs] Allow building man pages without myst_parser (PR #82402)

2024-02-23 Thread Michał Górny via cfe-commits
https://github.com/mgorny edited https://github.com/llvm/llvm-project/pull/82402 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [Docs] Allow building man pages without myst_parser (PR #82402)

2024-02-23 Thread Michał Górny via cfe-commits
https://github.com/mgorny approved this pull request. Thank you. From a quick test run with and without `myst-parser`, this seems to work as intended. https://github.com/llvm/llvm-project/pull/82402 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [flang] [llvm] [Docs] Allow building man pages without myst_parser (PR #82402)

2024-02-23 Thread Michał Górny via cfe-commits
@@ -35,8 +35,16 @@ import sphinx -if sphinx.version_info >= (3, 0): -extensions.append("myst_parser") +# When building man pages, we do not use the markdown pages, +# So, we can continue without the myst_parser dependencies. +# Doing so reduces dependencies of some packag

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,171 @@ +//===--- UnsafeCrtpCheck.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-format][NFC] Enable RemoveSemicolon for clang-format style (PR #82735)

2024-02-23 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/82735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,62 @@ +.. title:: clang-tidy - bugprone-unsafe-crtp + +bugprone-unsafe-crtp + + +Finds CRTP used in an error-prone way. + +If the constructor of a class intended to be used in a CRTP is public, then +it allows users to construct that class on its own

[clang] [Clang] Append target search paths for direct offloading compilation (PR #82699)

2024-02-23 Thread Jan Patrick Lehr via cfe-commits
https://github.com/jplehr approved this pull request. LG https://github.com/llvm/llvm-project/pull/82699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9966008 - [Clang] Append target search paths for direct offloading compilation (#82699)

2024-02-23 Thread via cfe-commits
Author: Joseph Huber Date: 2024-02-23T14:21:02-06:00 New Revision: 99660082cb387c9bf7974fef558c5f73d8b5a198 URL: https://github.com/llvm/llvm-project/commit/99660082cb387c9bf7974fef558c5f73d8b5a198 DIFF: https://github.com/llvm/llvm-project/commit/99660082cb387c9bf7974fef558c5f73d8b5a198.diff

[clang] [Clang] Append target search paths for direct offloading compilation (PR #82699)

2024-02-23 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/82699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk commented: Is it feasible to create a migration path from the static runtime to the dynamic runtime? As written, this requires users to update their ASan builds at the same time that they take this update. Is it possible to leave the static runtime behind, create a migra

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
@@ -0,0 +1,81 @@ +//===-- sanitizer_win_thunk_interception.h - -===// +// +// 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: Apa

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl created https://github.com/llvm/llvm-project/pull/82827 There are two issues here. first `ICK_Floating_Integral` were always defaulting to `CK_FloatingToIntegral` for vectors regardless of direction of cast. Check was scalar only so added a vec float check to the co

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Farzon Lotfi (farzonl) Changes There are two issues here. first `ICK_Floating_Integral` were always defaulting to `CK_FloatingToIntegral` for vectors regardless of direction of cast. Check was scalar only so added a vec float check to th

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + bool NotEnumType = dyn_cast(this->getType()) == nullptr; + if (NotEnumType) Kupa-Martin wrote: In C mode enumeration constants have integral type, so

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 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 24e7be426efe142c49bfab5cb278ffa313424176 7d77f7ac71f1928812fc6dcdbce29a7ea924 --

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
https://github.com/Kupa-Martin updated https://github.com/llvm/llvm-project/pull/81418 >From ca5879d97c3573ea26a3b431c3c18656a67370f2 Mon Sep 17 00:00:00 2001 From: 44-2-Kupa-Martin Date: Sun, 11 Feb 2024 12:22:45 -0300 Subject: [PATCH] [Clang][Sema] Fix missing warning when comparing mismatche

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/82827 >From 15eee3edd9ad834dc46fb5a1053874093b41a65a Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Fri, 23 Feb 2024 15:28:13 -0500 Subject: [PATCH] [HLSL] Fix casting asserts There are two issues here. first ICK_F

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
https://github.com/Kupa-Martin updated https://github.com/llvm/llvm-project/pull/81418 >From f08540e18abc078623ea1273f246003b76c24562 Mon Sep 17 00:00:00 2001 From: 44-2-Kupa-Martin Date: Sun, 11 Feb 2024 12:22:45 -0300 Subject: [PATCH] [Clang][Sema] Fix missing warning when comparing mismatche

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s +// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s + +typedef enum EnumA { + A +} EnumA; + +enum EnumB { + B +}; + +enum { + C +}; +

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + bool NotEnumType = dyn_cast(this->getType()) == nullptr; + if (NotEnumType) Kupa-Martin wrote: done https://github.com/llvm/llvm-project/pull/81418 _

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + if (isa(this->getType())) +return this->getType(); + else if (const EnumConstantDecl *ECD = this->getEnumConstantDecl()) erichkeane wrote: ```sugg

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

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

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -4097,6 +4105,13 @@ FieldDecl *Expr::getSourceBitField() { return nullptr; } +EnumConstantDecl *Expr::getEnumConstantDecl() { + Expr *E = this->IgnoreParenImpCasts(); + if (DeclRefExpr *DRE = dyn_cast(E)) erichkeane wrote: ```suggestion if (auto *DRE

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A couple more coding standard edits, else LGTM. https://github.com/llvm/llvm-project/pull/81418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Justin Bogner via cfe-commits
@@ -1,4 +1,8 @@ // RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.6-library -S -fnative-half-type -finclude-default-header -o - -ast-dump %s | FileCheck %s +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.3-library %

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Justin Bogner via cfe-commits
@@ -4843,7 +4843,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, .get(); break; case ICK_Floating_Integral: - if (ToType->isRealFloatingType()) + if (ToType->isRealFloatingType() || ToType->hasFloatingRepresentation()) ---

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Farzon Lotfi via cfe-commits
@@ -4843,7 +4843,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, .get(); break; case ICK_Floating_Integral: - if (ToType->isRealFloatingType()) + if (ToType->isRealFloatingType() || ToType->hasFloatingRepresentation()) ---

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/82827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
https://github.com/Kupa-Martin updated https://github.com/llvm/llvm-project/pull/81418 >From 706ad23821800a624792dd00b7b38b3f7cfe89ad Mon Sep 17 00:00:00 2001 From: 44-2-Kupa-Martin Date: Sun, 11 Feb 2024 12:22:45 -0300 Subject: [PATCH] [Clang][Sema] Fix missing warning when comparing mismatche

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + if (isa(this->getType())) +return this->getType(); + else if (const EnumConstantDecl *ECD = this->getEnumConstantDecl()) Kupa-Martin wrote: done

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/82827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/82827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Fix formatting so CI can continue (PR #82721)

2024-02-23 Thread via cfe-commits
AtariDreams wrote: > Do you have a link to the CI that failed this? The official clang doc build > succeeded and published the docs. https://buildkite.com/llvm-project/github-pull-requests/builds/41428 https://github.com/llvm/llvm-project/pull/82721

[clang] [flang] [flang] Fixes for LIT testing of FLANG_RUNTIME_F128_MATH_LIB build. (PR #82832)

2024-02-23 Thread Slava Zakharin via cfe-commits
https://github.com/vzakhari created https://github.com/llvm/llvm-project/pull/82832 Follow-up for #81971 to fix the disabled LIT test and add LIT tests for lowering of the added math intrinsics. >From 81ea8a2cf3a1cb4b9e99d590f7a80b156fe609b8 Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date:

[clang] [flang] [flang] Fixes for LIT testing of FLANG_RUNTIME_F128_MATH_LIB build. (PR #82832)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang-driver Author: Slava Zakharin (vzakhari) Changes Follow-up for #81971 to fix the disabled LIT test and add LIT tests for lowering of the added math intrinsics. --- Full diff: https://github.com/llvm/llvm-project/

[clang] [flang] [flang] Fixes for LIT testing of FLANG_RUNTIME_F128_MATH_LIB build. (PR #82832)

2024-02-23 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 162fa4dd25d631d0ab7816ec6081bcaff951a23c...81ea8a2cf3a1cb4b9e99d590f7a80b156fe609b8 flang

[clang] [flang] [flang] Fixes for LIT testing of FLANG_RUNTIME_F128_MATH_LIB build. (PR #82832)

2024-02-23 Thread Slava Zakharin via cfe-commits
https://github.com/vzakhari updated https://github.com/llvm/llvm-project/pull/82832 >From 81ea8a2cf3a1cb4b9e99d590f7a80b156fe609b8 Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date: Fri, 23 Feb 2024 13:08:49 -0800 Subject: [PATCH 1/2] [flang] Fixes for LIT testing of FLANG_RUNTIME_F128_MATH_L

[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits
https://github.com/rohit-rao created https://github.com/llvm/llvm-project/pull/82833 Updates the extension feature `define-target-os-macros` to support the recently-added XROS target (TARGET_OS_VISION). >From 48ab8968ea279aab03f64c657656254ededb374e Mon Sep 17 00:00:00 2001 From: Rohit Rao Da

[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (rohit-rao) Changes Updates the extension feature `define-target-os-macros` to support the recently-added XROS target (TARGET_OS_VISION). --- Full diff: https://github.com/llvm/llvm-project/pull/82833.diff 2 Files Affected:

[clang] [HLSL] Fix casting asserts (PR #82827)

2024-02-23 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/82827 >From 0ff2c7162d2676190b5ad370b7e7171581d8d21b Mon Sep 17 00:00:00 2001 From: Farzon Lotfi Date: Fri, 23 Feb 2024 15:28:13 -0500 Subject: [PATCH] [HLSL] Fix casting asserts There are two issues here. first ICK_F

[clang-tools-extra] [clang-tidy] Add support for determining constness of more expressions. (PR #82617)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL approved this pull request. I didn't check entire change, in some places `{}` in if's aren't needed. Overall looking fine, but this check need to be run on bigger code-base to verify if there are no false positives or crashes. https://github.com/llvm/llvm-project/pul

[clang] [Driver] Improve error when a compiler-rt library is not found (PR #81037)

2024-02-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: @tru After related improvements this uncovered, this patch should be good to review. https://github.com/llvm/llvm-project/pull/81037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,232 @@ +// RUN: %check_clang_tidy %s bugprone-unsafe-crtp %t + +namespace class_implicit_ctor { +template +class CRTP {}; +// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: the implicit default constructor of the CRTP is publicly accessible [bugprone-unsafe-crtp] +// CHECK-

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

2024-02-23 Thread Reid Kleckner via cfe-commits
https://github.com/rnk edited https://github.com/llvm/llvm-project/pull/81677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Extend define-target-os-macros to support XROS. (PR #82833)

2024-02-23 Thread via cfe-commits
rohit-rao wrote: @zixu-w please take a look if you have a minute, thanks! https://github.com/llvm/llvm-project/pull/82833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/82403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,177 @@ +//===--- CrtpConstructorAccessibilityCheck.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-Li

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Overall doesn't look to bad, probably could be merged in +- this state, it need to be run on some exist code-base like llvm. I will look again in next 1-2 days. Now just had quick glance. https://github.com/llvm/llvm-project/pull/82403 ___

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,82 @@ +.. title:: clang-tidy - bugprone-crtp-constructor-accessibility + +bugprone-crtp-constructor-accessibility +=== + +Finds Curiously Recurring Template Pattern used in an error-prone way. + +The CRTP is an idiom, in which a class

[clang-tools-extra] [clang-tidy] Unsafe CRTP check (PR #82403)

2024-02-23 Thread Piotr Zegar via cfe-commits
@@ -100,6 +100,11 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`bugprone-crtp-constructor-accessibility + ` check. + + Detects error-prone CRTP usage, when the CRTP can be constructed outside itself and the derived class. PiotrZSL wrote:

<    1   2   3   4   >