Skip to content

Conversation

@s-perron
Copy link
Contributor

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

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
@s-perron s-perron requested a review from AaronBallman June 30, 2025 15:22
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jun 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 30, 2025

@llvm/pr-subscribers-clang

Author: Steven Perron (s-perron)

Changes

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

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@s-perron
Copy link
Contributor Author

The test failures are unrelated to this change.

@s-perron s-perron merged commit de7c2f2 into llvm:main Jun 30, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants