-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[HLSL] reenable add packoffset in AST #91474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang @llvm/pr-subscribers-hlsl Author: Xiang Li (python3kgae) ChangesFix the test fail caused by missing -fnative-half-type. For #57914 Full diff: https://github.com/llvm/llvm-project/pull/91474.diff 2 Files Affected:
diff --git a/clang/test/AST/HLSL/packoffset.hlsl b/clang/test/AST/HLSL/packoffset.hlsl
index 9cfd88eeec330..060288c2f7f76 100644
--- a/clang/test/AST/HLSL/packoffset.hlsl
+++ b/clang/test/AST/HLSL/packoffset.hlsl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -ast-dump -x hlsl %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -fnative-half-type -ast-dump -x hlsl %s | FileCheck %s
// CHECK: HLSLBufferDecl {{.*}} cbuffer A
diff --git a/clang/test/SemaHLSL/packoffset-invalid.hlsl b/clang/test/SemaHLSL/packoffset-invalid.hlsl
index c5983f6fd7e07..526a511edf1f2 100644
--- a/clang/test/SemaHLSL/packoffset-invalid.hlsl
+++ b/clang/test/SemaHLSL/packoffset-invalid.hlsl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -verify %s
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -fnative-half-type -verify %s
// expected-warning@+1{{cannot mix packoffset elements with nonpackoffset elements in a cbuffer}}
cbuffer Mix
|
688a258
to
163dd41
Compare
When reapplying a change that was reverted, please include enough information in the description so that it can be understood without having to dig up the old change. Something like:
|
Update. Thanks a lot. |
This reapplies c5509fe "[HLSL] Support packoffset attribute in AST (#89836)" with a fix for the test failure caused by missing -fnative-half-type.
Since we have to parse the attribute manually in ParseHLSLAnnotations, we could create the ParsedAttribute with an integer offset parameter instead of string. This approach avoids parsing the string if the offset is saved as a string in HLSLPackOffsetAttr.
For #57914