From ebb0e6cb2555186fa0417ecb54925aa659346771 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Fri, 4 Apr 2025 12:21:47 -0700 Subject: [PATCH] [NFC] Remove dead code detected by code sanitizer. (#134385) The code sanitizer is failing with this error: `Execution cannot reach this statement.` The execution code path would early exit at line 928 if `(Lil && Ril) = true`. --- .../clang-tidy/misc/RedundantExpressionCheck.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp b/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp index c249244b1a1b..8e5a528bc5d3 100644 --- a/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp @@ -927,18 +927,6 @@ static bool areExprsSameMacroOrLiteral(const BinaryOperator *BinOp, if (Lil && Ril) return Lil->getValue() == Ril->getValue(); - const auto *LStrl = dyn_cast(Lhs); - const auto *RStrl = dyn_cast(Rhs); - if (Lil && Ril) { - const llvm::StringRef L = Lexer::getSourceText( - CharSourceRange::getTokenRange(LStrl->getBeginLoc()), SM, - Context->getLangOpts(), 0); - const llvm::StringRef R = Lexer::getSourceText( - CharSourceRange::getTokenRange(RStrl->getBeginLoc()), SM, - Context->getLangOpts(), 0); - return L.compare(R) == 0; - } - const auto *Lbl = dyn_cast(Lhs); const auto *Rbl = dyn_cast(Rhs); if (Lbl && Rbl)