Author: Zahira Ammarguellat
Date: 2025-04-04T15:21:47-04:00
New Revision: ebb0e6cb2555186fa0417ecb54925aa659346771

URL: 
https://github.com/llvm/llvm-project/commit/ebb0e6cb2555186fa0417ecb54925aa659346771
DIFF: 
https://github.com/llvm/llvm-project/commit/ebb0e6cb2555186fa0417ecb54925aa659346771.diff

LOG: [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`.

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp 
b/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp
index c249244b1a1b2..8e5a528bc5d3e 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<StringLiteral>(Lhs);
-  const auto *RStrl = dyn_cast<StringLiteral>(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<CXXBoolLiteralExpr>(Lhs);
   const auto *Rbl = dyn_cast<CXXBoolLiteralExpr>(Rhs);
   if (Lbl && Rbl)


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

Reply via email to