[llvm] [DirectX] Add DXIL_MODULE_FLAG for ShaderFlags. (PR #83217)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 12:41:53 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 50136ca11f62050b34876a920fcd87d2aefccfdb be269bdb68f9fcd5b7d4d3785f8a4925198d34bc -- llvm/include/llvm/BinaryFormat/DXContainer.h llvm/include/llvm/ObjectYAML/DXContainerYAML.h llvm/lib/ObjectYAML/DXContainerYAML.cpp llvm/lib/Target/DirectX/DXContainerGlobals.cpp llvm/lib/Target/DirectX/DXILShaderFlags.cpp llvm/lib/Target/DirectX/DXILShaderFlags.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
index e4229a301d..9169d2c954 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
@@ -51,12 +51,12 @@ void ComputedShaderFlags::print(raw_ostream &OS) const {
   if (FlagVal == 0)
     return;
   OS << "; Note: shader requires additional functionality:\n";
-#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleNum, FlagName, Str)                 \
+#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleNum, FlagName, Str)          \
   if (FlagName)                                                                \
     OS << ";       " Str "\n";
 #include "llvm/BinaryFormat/DXContainerConstants.def"
   OS << "; Note: extra DXIL module flags:\n";
-#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str)                                   \
+#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str)                         \
   if (FlagName)                                                                \
     OS << ";       " Str "\n";
 #include "llvm/BinaryFormat/DXContainerConstants.def"
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.h b/llvm/lib/Target/DirectX/DXILShaderFlags.h
index 7e269374f0..1df7d27de1 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.h
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.h
@@ -28,7 +28,7 @@ class GlobalVariable;
 namespace dxil {
 
 struct ComputedShaderFlags {
-#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)                 \
+#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)          \
   bool FlagName : 1;
 #define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) bool FlagName : 1;
 #include "llvm/BinaryFormat/DXContainerConstants.def"
@@ -45,16 +45,16 @@ struct ComputedShaderFlags {
   }
   operator uint64_t() const {
     uint64_t FlagValue = 0;
-#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)                 \
+#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)          \
   FlagValue |= FlagName ? getMask(DxilModuleBit) : 0ull;
-#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str)                                   \
+#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str)                         \
   FlagValue |= FlagName ? getMask(DxilModuleBit) : 0ull;
 #include "llvm/BinaryFormat/DXContainerConstants.def"
     return FlagValue;
   }
   uint64_t getFeatureFlags() const {
     uint64_t FeatureFlags = 0;
-#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)                 \
+#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str)          \
   FeatureFlags |= FlagName ? getMask(FeatureBit) : 0ull;
 #include "llvm/BinaryFormat/DXContainerConstants.def"
     return FeatureFlags;

``````````

</details>


https://github.com/llvm/llvm-project/pull/83217


More information about the llvm-commits mailing list