[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes "Interp" clashes with the clang interpreter and people often confuse this. --- Patch is 27.66 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/104552.diff 123 Fil

[clang] [clang] Rename all AST/Interp stuff to AST/ByteCode (PR #104552)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104552 "Interp" clashes with the clang interpreter and people often confuse this. >From a4a8254c45fa220d3a25e3951069106667f3a280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 16 Aug 2024 08:

[clang] [clang][Interp] Add scopes to conditional operator subexpressions (PR #104418)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/104418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2221987 - [clang][Interp] Add scopes to conditional operator subexpressions (#104418)

2024-08-15 Thread via cfe-commits
Author: Timm Baeder Date: 2024-08-16T08:37:46+02:00 New Revision: 22219873987587d8b5d793ab5dea982a0887ac7c URL: https://github.com/llvm/llvm-project/commit/22219873987587d8b5d793ab5dea982a0887ac7c DIFF: https://github.com/llvm/llvm-project/commit/22219873987587d8b5d793ab5dea982a0887ac7c.diff L

[clang] [clang][Interp] Support ObjC blocks (PR #104551)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/104551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Support blocks (PR #104551)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes I started out by adding a new pointer type for blocks, and I was fully prepared to compile their AST to bytecode and later call them. ... then I found out that the current interpreter doesn't support calling

[clang] [clang][Interp] Support blocks (PR #104551)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104551 >From 1d03ec1fd0066b8e73c1ae969b9235936ba7ae7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Thu, 15 Aug 2024 20:31:38 +0200 Subject: [PATCH] [clang][Interp] Support blocks --- clang/lib/

[clang] [clang][Interp] Support blocks (PR #104551)

2024-08-15 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104551 I started out by adding a new pointer type for blocks, and I was fully prepared to compile their AST to bytecode and later call them. ... then I found out that the current interpreter doesn't support calling

[clang] [llvm] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3, e5m2) (PR #102969)

2024-08-15 Thread Sergey Kozub via cfe-commits
sergey-kozub wrote: What do I need to push this through? I'm still seeing "1 workflow awaiting approval" message. Should I add some other reviewer(s) who are authorized to run workflows? https://github.com/llvm/llvm-project/pull/102969 ___ cfe-commits

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-15 Thread Marco Borgeaud via cfe-commits
marco-antognini-sonarsource wrote: @MitalAshok, thanks for the fix! Do you think it could also go into the 19.x branch? https://github.com/llvm/llvm-project/pull/100419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Helena Kotas (hekota) Changes Implements `__builtin_is_intangible` type trait. HLSL intangible types are special implementation-defined types such as resource handles or samplers. Any class that is an array of intangible type or contains

[clang] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/104544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/104544 >From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 15 Aug 2024 19:03:29 -0700 Subject: [PATCH 1/6] Implement `__builtin_is_intangible` --- clang/include/clang/

[clang] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/104544 >From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 15 Aug 2024 19:03:29 -0700 Subject: [PATCH 1/5] Implement `__builtin_is_intangible` --- clang/include/clang/

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/104544 >From 6d5f8991a4ef9e79bc1bed30addf7b29b7ed0d2e Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 15 Aug 2024 19:03:29 -0700 Subject: [PATCH 1/4] Implement `__builtin_is_intangible` --- clang/include/clang/

[clang] [HLSL] Implement '__builtin_is_intangible' type trait (PR #104544)

2024-08-15 Thread Helena Kotas via cfe-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/104544 Implements `__builtin_is_intangible` type trait. HLSL intangible types are special implementation-defined types such as resource handles or samplers. Any class that is an array of intangible type or contains ba

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
https://github.com/MichelleCDjunaidi edited https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-15 Thread via cfe-commits
https://github.com/yingopq updated https://github.com/llvm/llvm-project/pull/99615 >From 6605181d2b5b56d517432d697da4a89facd8e99a Mon Sep 17 00:00:00 2001 From: Ying Huang Date: Fri, 19 Jul 2024 04:19:09 -0400 Subject: [PATCH] [clang] Support -Wa, options -mmsa and -mno-msa --- clang/include/

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-15 Thread via cfe-commits
@@ -2630,6 +2631,10 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, CmdArgs.push_back("-massembler-no-warn"); } else if (Value == "--noexecstack") { UseNoExecStack = true; + } else if (Value == "-mmsa") { yingopq wro

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-15 Thread via cfe-commits
https://github.com/yingopq updated https://github.com/llvm/llvm-project/pull/99615 >From 48193d5afb03d4c3e87cb4a3bcf6164c1d390ddb Mon Sep 17 00:00:00 2001 From: Ying Huang Date: Fri, 19 Jul 2024 04:19:09 -0400 Subject: [PATCH] [clang] Support -Wa, options -mmsa and -mno-msa --- clang/include/

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-15 Thread Xiang Li via cfe-commits
https://github.com/python3kgae closed https://github.com/llvm/llvm-project/pull/104040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c20e7b6 - [HLSL] update default validator version to 1.8. (#104040)

2024-08-15 Thread via cfe-commits
Author: Xiang Li Date: 2024-08-15T22:44:07-04:00 New Revision: c20e7b6fe105e4dffc8ecff77b03a049d327c567 URL: https://github.com/llvm/llvm-project/commit/c20e7b6fe105e4dffc8ecff77b03a049d327c567 DIFF: https://github.com/llvm/llvm-project/commit/c20e7b6fe105e4dffc8ecff77b03a049d327c567.diff LOG:

[clang-tools-extra] [clang-tidy] Workaround for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Konstantin Romanov (ksromanov) Changes Fixes #102945 --- Full diff: https://github.com/llvm/llvm-project/pull/104540.diff 2 Files Affected: - (modified) clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck

[clang-tools-extra] [clang-tidy] Workaround for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Konstantin Romanov (ksromanov) Changes Fixes #102945 --- Full diff: https://github.com/llvm/llvm-project/pull/104540.diff 2 Files Affected: - (modified) clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp (

[clang-tools-extra] [clang-tidy] Workaround for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-15 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-tools-extra] [clang-tidy] Workaround for cppcoreguidelines-pro-type-union-access if memLoc is invalid (PR #104540)

2024-08-15 Thread Konstantin Romanov via cfe-commits
https://github.com/ksromanov created https://github.com/llvm/llvm-project/pull/104540 Fixes #102945 >From 5c5f8496341e7b97faf62dad2ba7e0b210bde11b Mon Sep 17 00:00:00 2001 From: Konstantin Romanov Date: Fri, 9 Aug 2024 23:40:07 -0400 Subject: [PATCH] Workaround for cppcoreguidelines-pro-type-u

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-08-15 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I feel the change is somewhat odd to me. Since the description is about the lambda but the change is about VarDecls. I feel there is a mismatch and I feel this may not solve the underlying problem fundamentally. I feel it'll be better to make it more st

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-15 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/96804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-08-15 Thread Owen Pan via cfe-commits
@@ -5272,22 +5272,46 @@ the configuration (without a prefix: ``Auto``). .. _ReflowComments: -**ReflowComments** (``Boolean``) :versionbadge:`clang-format 3.8` :ref:`¶ ` - If ``true``, clang-format will attempt to re-flow comments. That is it - will touch a comment and *ref

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-08-15 Thread Campbell Barton via cfe-commits
https://github.com/ideasman42 updated https://github.com/llvm/llvm-project/pull/104533 >From d53cf4f059cacadbbb6e32349a26580e7ea1a55b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 16 Aug 2024 11:28:19 +1000 Subject: [PATCH 1/2] Add "clang-format-on-save-mode" minor mode to clang-fo

[clang] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-08-15 Thread Campbell Barton via cfe-commits
https://github.com/ideasman42 edited https://github.com/llvm/llvm-project/pull/104533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-08-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Campbell Barton (ideasman42) Changes Add a minor mode to run clang-format on save. Formatting before saving works well and is convenient to avoid having to remember to manually run clang format. I've written this as it's own packa

[clang] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-08-15 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] Add "clang-format-on-save-mode" minor mode to clang-format.el (PR #104533)

2024-08-15 Thread Campbell Barton via cfe-commits
https://github.com/ideasman42 created https://github.com/llvm/llvm-project/pull/104533 Add a minor mode to run clang-format on save. Formatting before saving works well and is convenient to avoid having to remember to manually run clang format. I've written this as it's own package but it's p

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/101583 >From cce5781733a7c294f10dc75f48372ff6ee331239 Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Thu, 1 Aug 2024 16:36:27 -0700 Subject: [PATCH 1/3] [-Wunsafe-buffer-usage] Add warn on unsafe calls to libc f

[clang] [Clang] [Sema] Error on reference types inside a union with msvc 1900+ (PR #102851)

2024-08-15 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 closed https://github.com/llvm/llvm-project/pull/102851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9088ac1 - [Clang] [Sema] Error on reference types inside a union with msvc 1900+ (#102851)

2024-08-15 Thread via cfe-commits
Author: Max Winkler Date: 2024-08-15T18:02:08-07:00 New Revision: 9088ac1e8335d32bed275fbd33f0cd1b9bd400d6 URL: https://github.com/llvm/llvm-project/commit/9088ac1e8335d32bed275fbd33f0cd1b9bd400d6 DIFF: https://github.com/llvm/llvm-project/commit/9088ac1e8335d32bed275fbd33f0cd1b9bd400d6.diff L

[clang] f861e33 - [Driver] Reject -Wa, -mrelax-relocations= for non-ELF

2024-08-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-08-15T18:01:10-07:00 New Revision: f861e33912732d3de05369cdff852968fcdcb3a0 URL: https://github.com/llvm/llvm-project/commit/f861e33912732d3de05369cdff852968fcdcb3a0 DIFF: https://github.com/llvm/llvm-project/commit/f861e33912732d3de05369cdff852968fcdcb3a0.diff

[clang] [llvm] [BPF] introduce `__attribute__((bpf_fastcall))` (PR #101228)

2024-08-15 Thread via cfe-commits
@@ -2189,6 +2189,14 @@ def BTFTypeTag : TypeAttr { let LangOpts = [COnly]; } +def BPFFastCall : InheritableAttr, + TargetSpecificAttr { + let Spellings = [Clang<"bpf_fastcall">]; + let Subjects = SubjectList<[FunctionLike]>; + let Documentation = [BPFFast

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-15 Thread Kees Cook via cfe-commits
kees wrote: > Can we split `-fsanitize=unsigned-integer-overflow` into > `-fsanitize=unsigned-integer-overflow-patternA,unsigned-integer-overflow-patternB,unsigned-integer-overflow-patternC...` > ? > > Then it's quite intuitive to disable them with `no-sanitize`. Yikes, no way. The pattern ex

[clang] 812e049 - [Driver] Correctly handle -Wa,--crel -Wa,--no-crel

2024-08-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-08-15T17:32:16-07:00 New Revision: 812e049ac1c2424f96746ac4c453d6255b0a6ca5 URL: https://github.com/llvm/llvm-project/commit/812e049ac1c2424f96746ac4c453d6255b0a6ca5 DIFF: https://github.com/llvm/llvm-project/commit/812e049ac1c2424f96746ac4c453d6255b0a6ca5.diff

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4148,6 +4152,30 @@ static void emitWriteback(CodeGenFunction &CGF, assert(!isProvablyNull(srcAddr.getBasePointer()) && "shouldn't have writeback for provably null argument"); + if (CGF.getLangOpts().HLSL) { +if (!isa(writeback.CastExpr)) { + RValue Tmp

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4148,6 +4152,30 @@ static void emitWriteback(CodeGenFunction &CGF, assert(!isProvablyNull(srcAddr.getBasePointer()) && "shouldn't have writeback for provably null argument"); + if (CGF.getLangOpts().HLSL) { +if (!isa(writeback.CastExpr)) { + RValue Tmp

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -5703,6 +5709,12 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity, Out << "E"; break; } + case Expr::HLSLOutArgExprClass: { +const auto *OAE = cast(E); +Out << (OAE->isInOut() ? "_inout_" : "_out_"); +mangleType(E->getType()); +

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -7061,6 +7061,67 @@ class ArraySectionExpr : public Expr { void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } }; +/// This class represents temporary values used to represent inout and out +/// arguments in HLSL. From the callee perspective these parameters are mo

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4148,6 +4152,30 @@ static void emitWriteback(CodeGenFunction &CGF, assert(!isProvablyNull(srcAddr.getBasePointer()) && "shouldn't have writeback for provably null argument"); + if (CGF.getLangOpts().HLSL) { +if (!isa(writeback.CastExpr)) {

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -7061,6 +7061,67 @@ class ArraySectionExpr : public Expr { void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } }; +/// This class represents temporary values used to represent inout and out +/// arguments in HLSL. From the callee perspective these parameters are mo

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -7061,6 +7061,67 @@ class ArraySectionExpr : public Expr { void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } }; +/// This class represents temporary values used to represent inout and out +/// arguments in HLSL. From the callee perspective these parameters are mo

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -1121,3 +1121,99 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl *New, + FunctionDecl *Old) { + if (New->getNumPar

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4148,6 +4152,30 @@ static void emitWriteback(CodeGenFunction &CGF, assert(!isProvablyNull(srcAddr.getBasePointer()) && "shouldn't have writeback for provably null argument"); + if (CGF.getLangOpts().HLSL) { +if (!isa(writeback.CastExpr)) { + RValue Tmp

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4689,6 +4720,31 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, assert(type->isReferenceType() == E->isGLValue() && "reference binding to unmaterialized r-value!"); + // Add writeback for HLSLOutParamExpr. + if (const HLSLOutArgExpr *OE

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -11427,6 +11427,19 @@ static void AnalyzeImplicitConversions( return; } + if (auto *OutArgE = dyn_cast(E)) { +// The base expression is only used to initialize the parameter for +// arguments to `inout` parameters, so we only traverse down the base +// ex

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -7061,6 +7061,67 @@ class ArraySectionExpr : public Expr { void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } }; +/// This class represents temporary values used to represent inout and out +/// arguments in HLSL. From the callee perspective these parameters are mo

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -4689,6 +4720,31 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, assert(type->isReferenceType() == E->isGLValue() && "reference binding to unmaterialized r-value!"); + // Add writeback for HLSLOutParamExpr. + if (const HLSLOutArgExpr *OE

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
@@ -1121,3 +1121,99 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl *New, + FunctionDecl *Old) { + if (New->getNumPar

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-15 Thread John McCall via cfe-commits
https://github.com/rjmccall requested changes to this pull request. https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [BPF] introduce `__attribute__((bpf_fastcall))` (PR #101228)

2024-08-15 Thread via cfe-commits
@@ -2189,6 +2189,14 @@ def BTFTypeTag : TypeAttr { let LangOpts = [COnly]; } +def BPFFastCall : InheritableAttr, + TargetSpecificAttr { + let Spellings = [Clang<"bpf_fastcall">]; + let Subjects = SubjectList<[FunctionLike]>; + let Documentation = [BPFFast

[clang] 9d63a09 - [Driver] Improve error message for -Wa,-x=unknown

2024-08-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-08-15T17:04:41-07:00 New Revision: 9d63a09b452b641e3cc5d88066464b8250bd2bf7 URL: https://github.com/llvm/llvm-project/commit/9d63a09b452b641e3cc5d88066464b8250bd2bf7 DIFF: https://github.com/llvm/llvm-project/commit/9d63a09b452b641e3cc5d88066464b8250bd2bf7.diff

[clang] [llvm] [PowerPC] Fix codegen for transparent_union function params (PR #101738)

2024-08-15 Thread Lei Huang via cfe-commits
lei137 wrote: Seems `CGT.ConvertType(Ty)` does what was needed. I've simplified the patch to use that instead. https://github.com/llvm/llvm-project/pull/101738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [llvm] [PowerPC] Fix codegen for transparent_union function params (PR #101738)

2024-08-15 Thread Lei Huang via cfe-commits
https://github.com/lei137 updated https://github.com/llvm/llvm-project/pull/101738 >From f25e4ab65ed16a1e1a3bde91efe24bd0d52e0e74 Mon Sep 17 00:00:00 2001 From: Lei Huang Date: Fri, 2 Aug 2024 13:58:37 -0400 Subject: [PATCH 01/13] [PowerPC] Fix codegen for transparent_union function params Up

[clang] [clang-tools-extra] Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (PR #95802)

2024-08-15 Thread Jakub Jelínek via cfe-commits
jakubjelinek wrote: @ThePhD @AaronBallman @cor3ntin Joseph Myers raised an interesting question whether the tokens in embed-parameter-sequence are macro expanded or not. Consider ```c #define FILE "/etc/passwd" #define LIMIT limit(1) #define THIS , 1, 2, 3 #define PRE prefix (42, ONE #embed FILE

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-15 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > > Before reland, please include me into review I'd like to understand why > > `-fsanitize-pattern-exclusion=all` is better than something like > > `-fno-sanitize=overflow-pattern-all` > > The latter doesn't make sense to me. `no-sanitize` takes a list of sanitizers > to co

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
bob80905 wrote: I've created an issue here to test the space parameter: https://github.com/llvm/llvm-project/issues/104521 https://github.com/llvm/llvm-project/pull/97103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] d156a5a - [Driver] Reject -Wa, -mrelax-relocations= for non-x86

2024-08-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-08-15T16:28:42-07:00 New Revision: d156a5a1cb3b3405a6c1e941d112f262c29e15cf URL: https://github.com/llvm/llvm-project/commit/d156a5a1cb3b3405a6c1e941d112f262c29e15cf DIFF: https://github.com/llvm/llvm-project/commit/d156a5a1cb3b3405a6c1e941d112f262c29e15cf.diff

[clang] [Clang] Add target triple to fix failing test (PR #104513)

2024-08-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Sorry, this commit fixed that, and the offending commit was #102757. https://github.com/llvm/llvm-project/pull/104513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add target triple to fix failing test (PR #104513)

2024-08-15 Thread via cfe-commits
Sirraide wrote: > This caused a buildbot failure: > https://lab.llvm.org/buildbot/#/builders/38/builds/157 That builder seems to have been using an older commit before this was merged because the `-triple x86_64-linux-gnu` is missing from the command line: > c:\buildbot\as-builder-1\x-armv7l\b

[clang] [Clang] Add target triple to fix failing test (PR #104513)

2024-08-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: This caused a buildbot failure: https://lab.llvm.org/buildbot/#/builders/38/builds/157 https://github.com/llvm/llvm-project/pull/104513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] 3333ec1 - [Driver] Make CodeGenOptions name match MCTargetOptions names

2024-08-15 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-08-15T15:52:20-07:00 New Revision: ec1183803fa5a2353e710b8b22db6a72e292 URL: https://github.com/llvm/llvm-project/commit/ec1183803fa5a2353e710b8b22db6a72e292 DIFF: https://github.com/llvm/llvm-project/commit/ec1183803fa5a2353e710b8b22db6a72e292.diff

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-15 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum closed https://github.com/llvm/llvm-project/pull/101802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c5b611a - [libclang/python] Expose `clang_isBeforeInTranslationUnit` for `SourceRange.__contains__`

2024-08-15 Thread via cfe-commits
Author: Jannick Kremer Date: 2024-08-16T00:32:58+02:00 New Revision: c5b611a419ca8acab041ca52a94c6338bdcd1756 URL: https://github.com/llvm/llvm-project/commit/c5b611a419ca8acab041ca52a94c6338bdcd1756 DIFF: https://github.com/llvm/llvm-project/commit/c5b611a419ca8acab041ca52a94c6338bdcd1756.diff

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -483,6 +483,34 @@ bool clang::analyze_format_string::ParseFormatStringHasSArg(const char *I, return false; } +unsigned clang::analyze_format_string::ParseFormatStringFirstSArgIndex( +const char *&I, const char *E, unsigned ArgIndex, const LangOptions &LO, +const

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -783,6 +783,18 @@ bool ParsePrintfString(FormatStringHandler &H, bool ParseFormatStringHasSArg(const char *beg, const char *end, const LangOptions &LO, const TargetInfo &Target); +/// Parse C format string and return index (relative to `ArgInde

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -2292,6 +2292,18 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { } } + void handleUnsafeLibcCall(const CallExpr *Call, unsigned PrintfInfo, +ASTContext &Ctx) override { +// We have checked that there is a direct

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/101583 >From cce5781733a7c294f10dc75f48372ff6ee331239 Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Thu, 1 Aug 2024 16:36:27 -0700 Subject: [PATCH 1/3] [-Wunsafe-buffer-usage] Add warn on unsafe calls to libc f

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-15 Thread Ziqing Luo via cfe-commits
@@ -443,6 +448,368 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { return false; } +namespace libc_fun_disjoint_inner_matchers { +// `libc_fun_disjoint_inner_matchers` covers a set of matchers that match +// disjoint node sets. They all take a `CoreName`, which

[clang-tools-extra] [clang-tidy] use upper case letters for bool conversion suffix (PR #102831)

2024-08-15 Thread Oliver Stöneberg via cfe-commits
firewave wrote: I do not think this logic should be added to a check and should stay in a single place as it is right now. > A bit of nitpick, but would it make sense to have some consistency with > `readability-identifier-naming`? As pointed out here this logic now exists in three different

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

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

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL requested changes to this pull request. for me oryginal version that used registerMatchers instead of visitor were way better, specially that there are matchers that could be used for this, or could be written. And even for performance reasons it could be implemented

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-08-15 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,120 @@ +//===--- IncorrectEnableSharedFromThisCheck.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

  1   2   3   4   5   6   >