https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/117608
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -540,10 +555,10 @@ struct BuiltinTypeMethodBuilder {
// create method decl
auto *TSInfo = AST.getTrivialTypeSourceInfo(MethodTy, SourceLocation());
-Method =
-CXXMethodDecl::Create(AST, DeclBuilder.Record, SourceLocation(),
-
@@ -674,6 +700,34 @@
BuiltinTypeDeclBuilder::addHandleAccessFunction(DeclarationName &Name,
.finalizeMethod();
}
+BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addAppendMethod() {
+ using PH = BuiltinTypeMethodBuilder::PlaceHolder;
+ ASTContext &AST = SemaRef.getAST
@@ -674,6 +700,34 @@
BuiltinTypeDeclBuilder::addHandleAccessFunction(DeclarationName &Name,
.finalizeMethod();
}
+BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addAppendMethod() {
+ using PH = BuiltinTypeMethodBuilder::PlaceHolder;
+ ASTContext &AST = SemaRef.getAST
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/118536
>From 97391c97c16029e2a3376ff2938ebc7e94393149 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 3 Dec 2024 11:13:47 -0800
Subject: [PATCH 1/2] [HLSL] Add Append and Consume methods on
Append/ConsumeStructu
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/118536
The methods are using existing clang builtins
`__builtin_hlsl_buffer_update_counter` and `__builtin_hlsl_resource_getpointer`
to update the buffer counter and then load or store the value.
Fixes #112968
>From
hekota wrote:
LGTM!
https://github.com/llvm/llvm-project/pull/115971
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/121989
There will be more changes coming in to `SemaHLSL::ActOnFinishBuffer` so it
would be good to move the packoffset validation out to a separate function.
This PR also unifies the units for cbuffer offset calculati
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/121989
>From f68ea5a099636f840561335dcf2daaed82c7405c Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 7 Jan 2025 12:07:28 -0800
Subject: [PATCH] [HLSL][NFC] Move packoffset validation to separate function
and ca
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/121989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -219,33 +223,41 @@ void SemaHLSL::ActOnFinishBuffer(Decl *Dcl,
SourceLocation RBrace) {
}
}
- if (HasPackOffset && HasNonPackOffset)
hekota wrote:
This is best to review with 'Hide whitespaces'
https://github.com/llvm/llvm-project/pull/121989
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/121989
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4721,9 +4721,9 @@ def HLSLPackOffset: HLSLAnnotationAttr {
let Args = [IntArgument<"Subcomponent">, IntArgument<"Component">];
let Documentation = [HLSLPackOffsetDocs];
let AdditionalMembers = [{
- unsigned getOffset() {
-return subcomponent * 4 + compone
@@ -219,33 +223,41 @@ void SemaHLSL::ActOnFinishBuffer(Decl *Dcl,
SourceLocation RBrace) {
}
}
- if (HasPackOffset && HasNonPackOffset)
-Diag(BufDecl->getLocation(), diag::warn_hlsl_packoffset_mix);
-
- if (HasPackOffset) {
-ASTContext &Context = getASTContext
@@ -194,17 +196,19 @@ static unsigned calculateLegacyCbufferSize(const
ASTContext &Context,
calculateLegacyCbufferSize(Context, VT->getElementType());
Size = ElementSize * ElementCount;
} else {
-Size = Context.getTypeSize(T);
+Size = Context.getTypeSize(
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/121989
>From f68ea5a099636f840561335dcf2daaed82c7405c Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 7 Jan 2025 12:07:28 -0800
Subject: [PATCH 1/2] [HLSL][NFC] Move packoffset validation to separate
function an
hekota wrote:
All of these changes except one are related to layout structs. I will update
the PR description to make it clearer and move that one unrelated change about
synthetizing initializers to the constant buffer codegen PR.
https://github.com/llvm/llvm-project/pull/124840
__
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/124840
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/125904
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/124840
>From 63c465b40512ad4c5fff84c0b2b022b49d46eaa7 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 28 Jan 2025 13:20:30 -0800
Subject: [PATCH 1/6] [HLSL] Constant buffer layout struct update
- create structs
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2576,3 +2576,162 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
+
+static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
+llvm::SmallVectorImpl &List,
+llvm::SmallVectorImpl &DestT
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota commented:
Few notes and questions, otherwise looks mostly good!
Typos in title na description: intialization, implementaiton
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llv
@@ -2576,3 +2576,162 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
+
+static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
+llvm::SmallVectorImpl &List,
+llvm::SmallVectorImpl &DestT
@@ -0,0 +1,714 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes
-emit-llvm -finclude-default-header -o - %s | FileCheck %s
+
+struct TwoFloats {
@@ -2576,3 +2576,162 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
+
+static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
+llvm::SmallVectorImpl &List,
+llvm::SmallVectorImpl &DestT
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -393,7 +396,7 @@ static FieldDecl *createFieldForHostLayoutStruct(Sema &S,
const Type *Ty,
auto *Field = FieldDecl::Create(AST, LayoutStruct, SourceLocation(),
SourceLocation(), II, QT, TSI, nullptr,
false,
@@ -48,94 +48,108 @@ struct TwoFloats {
// CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer
// CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer
cbuffer CB {
- // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float'
+ // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/124866
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -48,94 +48,108 @@ struct TwoFloats {
// CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer
// CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer
cbuffer CB {
- // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float'
+ // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo
@@ -48,94 +48,108 @@ struct TwoFloats {
// CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer
// CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer
cbuffer CB {
- // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float'
+ // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo
@@ -48,94 +48,108 @@ struct TwoFloats {
// CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer
// CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer
cbuffer CB {
- // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float'
+ // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/126561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/124840
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/118536
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota converted_to_draft
https://github.com/llvm/llvm-project/pull/119311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hekota wrote:
> Is this the right solution, or should we be doing something to force the
> constructor function to be generated? I'm a little worried that we have one
> path for initializing some types of globals and a different approach for
> other globals.
I'll see if I can move creation of
hekota wrote:
You are correct @llvm-beanz, this change is not needed at all. Sorry for
wasting your time!
https://github.com/llvm/llvm-project/pull/119311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/119311
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota converted_to_draft
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -54,69 +54,110 @@ void addDxilValVersion(StringRef ValVersionStr,
llvm::Module &M) {
auto *DXILValMD = M.getOrInsertNamedMetadata(DXILValKey);
DXILValMD->addOperand(Val);
}
+
void addDisableOptimizations(llvm::Module &M) {
StringRef Key = "dx.disable_optimizations";
hekota wrote:
Thank you @Fznamznon !
https://github.com/llvm/llvm-project/pull/120090
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,26 +0,0 @@
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
-
-// CHECK: @[[CB:.+]] = external constant { float, double }
-cbuffer A : register(b0, spa
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/119755
Introduces translations of `cbuffer` to LLVM target type `target("dx.CBuffer",
...) `. At this point only `cbuffer`s containing scalars and vectors are
supported as we are still working on the target type design
@@ -164,18 +164,18 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
return Result;
}
-// Calculate the size of a legacy cbuffer type based on
+// Calculate the size of a legacy cbuffer type in bytes based on
hekota wrote:
Cbuffer & pac
@@ -54,69 +54,110 @@ void addDxilValVersion(StringRef ValVersionStr,
llvm::Module &M) {
auto *DXILValMD = M.getOrInsertNamedMetadata(DXILValKey);
DXILValMD->addOperand(Val);
}
+
void addDisableOptimizations(llvm::Module &M) {
hekota wrote:
Intentional wh
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/119755
>From 8cebb59304a1f893d94f2a758bc47a62f27c1b8b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 12 Dec 2024 11:37:46 -0800
Subject: [PATCH 1/2] [HLSL] Codegen for simple `cbuffer` blocks without
embedded a
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -164,18 +164,18 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool
CBuffer,
return Result;
}
-// Calculate the size of a legacy cbuffer type based on
+// Calculate the size of a legacy cbuffer type in bytes based on
//
https://learn.microsoft.com/en-us/window
@@ -868,8 +868,54 @@ static Expr *constructTypedBufferConstraintExpr(Sema &S,
SourceLocation NameLoc,
return TypedResExpr;
}
-static ConceptDecl *constructTypedBufferConceptDecl(Sema &S,
-NamespaceDecl *NSD) {
+static Expr
https://github.com/hekota approved this pull request.
LGTM! Please add [HLSL] to the title.
https://github.com/llvm/llvm-project/pull/119643
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump
-ast-dump-filter=__is_structured_resource_element_compatible %s | FileCheck %s
+
+// CHECK: ConceptDecl 0x{{[0-9a-f]+}} <>
__is_structured_resource_element_compatible
+// CHECK: |-Temp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump
-ast-dump-filter=__is_structured_resource_element_compatible %s | FileCheck %s
+
+// CHECK: ConceptDecl 0x{{[0-9a-f]+}} <>
__is_structured_resource_element_compatible
+// CHECK: |-Temp
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/119755
>From 8cebb59304a1f893d94f2a758bc47a62f27c1b8b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 12 Dec 2024 11:37:46 -0800
Subject: [PATCH 1/3] [HLSL] Codegen for simple `cbuffer` blocks without
embedded a
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/120663
Adds `T Load(int)` method on `StructuredBuffer`, `RWStructuredBuffer` and
`RasterizerOrderedStructuredBuffer`.
Uses the existing `addLoadMethods` in HLSLExternalSemalSource so most of this
change is just tests.
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/120663
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/120663
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota converted_to_draft
https://github.com/llvm/llvm-project/pull/119755
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/119755
>From 8cebb59304a1f893d94f2a758bc47a62f27c1b8b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Thu, 12 Dec 2024 11:37:46 -0800
Subject: [PATCH 1/4] [HLSL] Codegen for simple `cbuffer` blocks without
embedded a
@@ -12487,6 +12487,7 @@ def err_hlsl_pointers_unsupported : Error<
"%select{pointers|references}0 are unsupported in HLSL">;
def err_hlsl_missing_resource_class : Error<"HLSL resource needs to have
[[hlsl::resource_class()]] attribute">;
def err_hlsl_attribute_needs_intangib
@@ -2,36 +2,36 @@
// RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -finclude-default-header
-fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=SPIRV
// NOTE: The type name number and whether the struct is packed or not will
mostly
-// likely change once s
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/117017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/116699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump
-DEMPTY %s | FileCheck -check-prefix=EMPTY %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s
| FileCheck %s
+
hekota wrote:
FYI, we ar
@@ -531,6 +531,16 @@ void
HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
.addArraySubscriptOperators()
.completeDefinition();
});
+
+ Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ByteAddressBuffer")
+ .Record;
+ on
@@ -1,22 +1,22 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute
-finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s
// NOTE: The number in type name and whether the struct is packed or not will
mostly
-// likely change once subscript ope
@@ -1,22 +1,22 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute
-finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s
// NOTE: The number in type name and whether the struct is packed or not will
mostly
-// likely change once subscript ope
@@ -4738,6 +4738,12 @@ def GetDeviceSideMangledName : LangBuiltin<"CUDA_LANG"> {
}
// HLSL
+def HLSLTypedBufferPointer : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_resource_getpointer"];
hekota wrote:
Is this for all buffer types or just t
https://github.com/hekota approved this pull request.
Few nits, otherwise LGTM!
https://github.com/llvm/llvm-project/pull/117017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,28 +1,28 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute
-finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s
-check-prefixes=DXIL
// NOTE: The number in type name and whether the struct is packed or not will
mostly
-// likely cha
@@ -12487,6 +12487,7 @@ def err_hlsl_pointers_unsupported : Error<
"%select{pointers|references}0 are unsupported in HLSL">;
def err_hlsl_missing_resource_class : Error<"HLSL resource needs to have
[[hlsl::resource_class()]] attribute">;
def err_hlsl_attribute_needs_intangib
@@ -2,36 +2,36 @@
// RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -finclude-default-header
-fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=SPIRV
// NOTE: The type name number and whether the struct is packed or not will
mostly
-// likely change once s
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/117017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() {
case Decl::ObjCCategoryImpl:
return this;
+ case Decl::CXXRecord:
+if (auto *OPD = dyn_cast(this))
+ if (auto *Def = OPD->getDefinition())
+return Def;
+return this;
default:
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
hekota wrote:
Rename to ByteAddressBuffer**s**-constructor**s**.hlsl - test cases for oth
@@ -531,6 +531,16 @@ void
HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
.addArraySubscriptOperators()
.completeDefinition();
});
+
+ Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ByteAddressBuffer")
+ .Record;
+ on
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() {
case Decl::ObjCCategoryImpl:
return this;
+ case Decl::CXXRecord:
+if (auto *OPD = dyn_cast(this))
+ if (auto *Def = OPD->getDefinition())
+return Def;
+return this;
default:
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() {
case Decl::ObjCCategoryImpl:
return this;
+ case Decl::CXXRecord:
+if (auto *OPD = dyn_cast(this))
+ if (auto *Def = OPD->getDefinition())
+return Def;
+return this;
default:
@@ -67,6 +67,7 @@ struct BuiltinTypeDeclBuilder {
Record = CXXRecordDecl::Create(AST, TagDecl::TagKind::Class, HLSLNamespace,
SourceLocation(), SourceLocation(), &II,
PrevDecl, true);
+Record->startDe
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/114148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/116699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -536,89 +536,84 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
}
}
-void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
- llvm::GlobalVariable *GV) {
- // If the global variable has resource binding, add i
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -536,89 +536,84 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
}
}
-void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
- llvm::GlobalVariable *GV) {
- // If the global variable has resource binding, add i
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/123411
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/122820
>From 71ddb5a2b4cc8a9609410b436e896484401f5e90 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 13 Jan 2025 15:03:12 -0800
Subject: [PATCH 1/7] [HLSL] cbuffer: Create host layout struct and add
resource ha
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/122820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/123411
>From ac04912dbe81d2eeebef5a8d1eb895f3ad723cb9 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Fri, 17 Jan 2025 13:31:01 -0800
Subject: [PATCH 1/4] [HLSL] Add address space `hlsl_constant(2)` for constant
buff
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/122820
>From 71ddb5a2b4cc8a9609410b436e896484401f5e90 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 13 Jan 2025 15:03:12 -0800
Subject: [PATCH 1/8] [HLSL] cbuffer: Create host layout struct and add
resource ha
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
601 - 700 of 862 matches
Mail list logo