https://github.com/s-perron created 
https://github.com/llvm/llvm-project/pull/146365

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


>From 7881acd7df1951f64fe8533c864b55ffce8b91c1 Mon Sep 17 00:00:00 2001
From: Steven Perron <stevenper...@google.com>
Date: Mon, 30 Jun 2025 11:20:38 -0400
Subject: [PATCH] [HLSL] Remove dead code in Type.cpp [NFC]

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
---
 clang/lib/AST/Type.cpp | 9 ---------
 1 file changed, 9 deletions(-)

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");

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to