[clang] [HLSL] Remove dead code in Type.cpp [NFC] (PR #146365)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 08:23:17 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Steven Perron (s-perron)

<details>
<summary>Changes</summary>

In a case statement for Type::HLSLInlineSpirv, the first statment
returns, and the remaining statement are never executed. This removes
the dead code.

https://github.com/llvm/llvm-project/pull/134034/files/7d8e36944370bc50bd74ce6254f93649bc1f35a8#r2166484730


---
Full diff: https://github.com/llvm/llvm-project/pull/146365.diff


1 Files Affected:

- (modified) clang/lib/AST/Type.cpp (-9) 


``````````diff
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 2c1158e8f9b9a..e5a1ab2ff8906 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -4870,15 +4870,6 @@ LinkageInfo LinkageComputer::computeTypeLinkageInfo(const Type *T) {
                                       ->getCanonicalTypeInternal());
   case Type::HLSLInlineSpirv:
     return LinkageInfo::external();
-    {
-      const auto *ST = cast<HLSLInlineSpirvType>(T);
-      LinkageInfo LV = LinkageInfo::external();
-      for (auto &Operand : ST->getOperands()) {
-        if (Operand.isConstant() || Operand.isType())
-          LV.merge(computeTypeLinkageInfo(Operand.getResultType()));
-      }
-      return LV;
-    }
   }
 
   llvm_unreachable("unhandled type class");

``````````

</details>


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


More information about the cfe-commits mailing list