[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout stru

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout alsepkow

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout stru

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout stru

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout stru

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -58,9 +60,15 @@ namespace CodeGen { // classes) and calls layoutField to converts each field to its corresponding // LLVM type and to calculate its HLSL constant buffer layout. Any embedded // structs (or arrays of structs) are converted to target layout types as well. +// +

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -174,21 +176,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout alsepkow

[clang] [llvm] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-03-12 Thread Alex Sepkowski via cfe-commits
@@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout stru

[clang] [HLSL][NFC] Update HLSL AST tests to be more readable (PR #130910)

2025-03-12 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/130910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing for empty RootParams (PR #140147)

2025-05-15 Thread Alex Sepkowski via cfe-commits
@@ -155,6 +163,41 @@ std::optional RootSignatureParser::parseRootConstants() { return Constants; } +std::optional RootSignatureParser::parseRootParam() { + assert((CurToken.TokKind == TokenKind::kw_CBV || + CurToken.TokKind == TokenKind::kw_SRV || + CurTo

[clang] [llvm] [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (PR #146124)

2025-07-03 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow edited https://github.com/llvm/llvm-project/pull/146124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (PR #146124)

2025-07-03 Thread Alex Sepkowski via cfe-commits
@@ -0,0 +1,56 @@ +//===- RootSignatureMetadata.h - HLSL Root Signature helpers --===// +// +// 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] [llvm] [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (PR #146124)

2025-07-03 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow commented: LGTM outside of a few minor comments you may choose to address or not. https://github.com/llvm/llvm-project/pull/146124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [llvm] [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (PR #146124)

2025-07-03 Thread Alex Sepkowski via cfe-commits
@@ -103,7 +51,7 @@ class ResourceRange { getOverlapping(const RangeInfo &Info) const; // Return the mapped RangeInfo at X or nullptr if no mapping exists - LLVM_ABI const RangeInfo *lookup(uint32_t X) const; alsepkow wrote: LLVM_ABI no longer needed? h

[clang] [llvm] [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (PR #146124)

2025-07-03 Thread Alex Sepkowski via cfe-commits
@@ -0,0 +1,194 @@ +//===- RootSignatureMetadata.h - HLSL Root Signature helpers --===// +// +// 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] Address a handful of C4146 compiler warnings where literals can be replaced with std::numeric_limits (PR #147623)

2025-07-09 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow updated https://github.com/llvm/llvm-project/pull/147623 >From 7e1c62fce3741b8182db2428c29136524b27b98c Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsep...@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:17:56 -0700 Subject: [PATCH 1/6] Numeric limits i

[clang] Address a handful of C4146 compiler warnings where literals can be replaced with std::numeric_limits (PR #147623)

2025-07-09 Thread Alex Sepkowski via cfe-commits
https://github.com/alsepkow updated https://github.com/llvm/llvm-project/pull/147623 >From 7e1c62fce3741b8182db2428c29136524b27b98c Mon Sep 17 00:00:00 2001 From: Alex Sepkowski <5620315+alsep...@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:17:56 -0700 Subject: [PATCH 1/7] Numeric limits i

[clang] Address a handful of C4146 compiler warnings where literals can be replaced with std::numeric_limits (PR #147623)

2025-07-09 Thread Alex Sepkowski via cfe-commits
@@ -777,7 +779,7 @@ template <> struct MappingTraits { IO.mapOptional("Maximum", signedMaximum); Space.Maximum = static_cast(signedMaximum); -if (Space.Maximum != -1u) +if (Space.Maximum != std::numeric_limits::max()) alsepkow wrote: On furth