[llvm] [DirectX][NFC] Refine DXIL Type abstraction framework in DXIL.td (PR #81692)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 17:25:17 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 1ec81976e4937ea9a09cefd41f25b3c5d1394f2c 22c1a06c4af18ad0cfce02a3db78d4e6a4f601be -- llvm/utils/TableGen/DXILEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp
index 1c1407e96c..002256e775 100644
--- a/llvm/utils/TableGen/DXILEmitter.cpp
+++ b/llvm/utils/TableGen/DXILEmitter.cpp
@@ -82,21 +82,22 @@ struct DXILOperationDesc {
*/
static ParameterKind getDXILTypeNameToKind(StringRef typeNameStr) {
auto paramKind = StringSwitch<ParameterKind>(typeNameStr)
- .Case("VoidTy", ParameterKind::VOID)
- .Case("Float16Ty", ParameterKind::HALF)
- .Case("Float32Ty", ParameterKind::FLOAT)
- .Case("Float64Ty", ParameterKind::DOUBLE)
- .Case("Int1Ty", ParameterKind::I1)
- .Case("Int8Ty", ParameterKind::I8)
- .Case("Int16Ty", ParameterKind::I16)
- .Case("Int32Ty", ParameterKind::I32)
- .Case("Int64Ty", ParameterKind::I64)
- .Case("OverloadTy", ParameterKind::OVERLOAD)
- .Case("HandleTy", ParameterKind::DXIL_HANDLE)
- .Case("CbufferTy", ParameterKind::CBUFFER_RET)
- .Case("ResourceTy", ParameterKind::RESOURCE_RET)
- .Default(ParameterKind::INVALID);
- assert( paramKind != ParameterKind::INVALID && "Unsupported DXIL Type specified");
+ .Case("VoidTy", ParameterKind::VOID)
+ .Case("Float16Ty", ParameterKind::HALF)
+ .Case("Float32Ty", ParameterKind::FLOAT)
+ .Case("Float64Ty", ParameterKind::DOUBLE)
+ .Case("Int1Ty", ParameterKind::I1)
+ .Case("Int8Ty", ParameterKind::I8)
+ .Case("Int16Ty", ParameterKind::I16)
+ .Case("Int32Ty", ParameterKind::I32)
+ .Case("Int64Ty", ParameterKind::I64)
+ .Case("OverloadTy", ParameterKind::OVERLOAD)
+ .Case("HandleTy", ParameterKind::DXIL_HANDLE)
+ .Case("CbufferTy", ParameterKind::CBUFFER_RET)
+ .Case("ResourceTy", ParameterKind::RESOURCE_RET)
+ .Default(ParameterKind::INVALID);
+ assert(paramKind != ParameterKind::INVALID &&
+ "Unsupported DXIL Type specified");
return paramKind;
}
@@ -137,7 +138,8 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
DXILParameter::DXILParameter(const Record *R) {
Name = R->getValueAsString("Name");
Pos = R->getValueAsInt("Pos");
- Kind = getDXILTypeNameToKind(R->getValue("ParamType")->getValue()->getAsString());
+ Kind = getDXILTypeNameToKind(
+ R->getValue("ParamType")->getValue()->getAsString());
if (R->getValue("Doc"))
Doc = R->getValueAsString("Doc");
IsConst = R->getValueAsBit("IsConstant");
``````````
</details>
https://github.com/llvm/llvm-project/pull/81692
More information about the llvm-commits
mailing list