https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bob80905 approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
> As a general comment, your approach of just checking for the existence of the
> binding attribute may not in itself be sufficient. Consider this PR:
> https://github.com/llvm/llvm-project/pull/135287/files There is a potential
> case where the binding attribute has a slot = -1,
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
bogner wrote:
Good catch! Added some tests with arrays and updated this to
bob80905 wrote:
As a general comment, your approach of just checking for the existence of the
binding attribute may not in itself be sufficient.
Consider this PR:
https://github.com/llvm/llvm-project/pull/135287/files
There is a potential case where the binding attribute has a slot = -1,
signif
@@ -14,6 +14,12 @@ RWBuffer c;
// No warning - explicit binding.
RWBuffer d : register(u0);
+// No warning - explicit binding.
+RWBuffer dd : register(space1);
bogner wrote:
Yes, you're correct. I've updated the latest, though this is commented out now
becau
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -Wno-error=hlsl-implicit-binding -triple
dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// expected-warning@+1 {{resource has implicit register binding}}
+cbuffer cb0 {
+ int a;
+}
+
+// No warning - this is an elemen
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/135909
>From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Wed, 2 Apr 2025 11:34:00 -0700
Subject: [PATCH 1/6] [HLSL] Add a warning for implicit bindings
Implicit bindings
@@ -14,6 +14,12 @@ RWBuffer c;
// No warning - explicit binding.
RWBuffer d : register(u0);
+// No warning - explicit binding.
+RWBuffer dd : register(space1);
bob80905 wrote:
Shouldn't there be a warning here?
Though the space param is being explicitly bound
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
+SemaRef.Diag(VD->getLocation(), diag::warn_hlsl_implicit_binding);
bob
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/135909
>From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Wed, 2 Apr 2025 11:34:00 -0700
Subject: [PATCH 1/2] [HLSL] Add a warning for implicit bindings
Implicit bindings
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
+SemaRef.Diag(VD->getLocation(), diag::warn_hlsl_implicit_binding);
bog
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD)
{
<< static_cast(RT);
}
}
+
+ if (!HasBinding && VD->getType()->isHLSLResourceRecord())
inbelic wrote:
I do also see the function `isResourceRecordTypeOrArrayOf`
@@ -1,12 +1,9 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \
-// RUN: -finclude-default-header -emit-pch -o %t %S/Inputs/pch.hlsl
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \
-// RUN: -finclude-default-header -include-pch %t -ast-
https://github.com/damyanp edited
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
LGTM, assuming we don't need to do / test the "only specifying a space" case.
https://github.com/llvm/llvm-project/pull/135909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
@@ -1,12 +1,9 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \
-// RUN: -finclude-default-header -emit-pch -o %t %S/Inputs/pch.hlsl
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \
-// RUN: -finclude-default-header -include-pch %t -ast-
@@ -1,13 +1,12 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl
-finclude-default-header -emit-pch -o %t %S/Inputs/pch_with_buf.hlsl
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \
-// RUN: -finclude-default-header -include-pch %t -ast-d
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -Wno-error=hlsl-implicit-binding -triple
dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// expected-warning@+1 {{resource has implicit register binding}}
+cbuffer cb0 {
+ int a;
+}
+
+// No warning - this is an elemen
20 matches
Mail list logo