From fcfaed4ae6d718ebfe18eef7f5ddbef2a23ef413 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 2 Jun 2021 09:52:45 -0700 Subject: [PATCH] Remove redundant comparisons (NFC) --- llvm/lib/IR/DebugInfo.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 331bf8a..06c511f 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -388,7 +388,7 @@ static bool isDILocationReachable(SmallPtrSetImpl &Visited, MDNode *N = dyn_cast_or_null(MD); if (!N) return false; - if (Reachable.count(N) || isa(N)) + if (isa(N) || Reachable.count(N)) return true; if (!Visited.insert(N).second) return false; @@ -415,8 +415,7 @@ static MDNode *stripDebugLocFromLoopID(MDNode *N) { // count_if avoids an early exit. if (!std::count_if(N->op_begin() + 1, N->op_end(), [&Visited, &DILocationReachable](const MDOperand &Op) { - return isa(Op.get()) || - isDILocationReachable( + return isDILocationReachable( Visited, DILocationReachable, Op.get()); })) return N; @@ -426,8 +425,7 @@ static MDNode *stripDebugLocFromLoopID(MDNode *N) { if (std::all_of( N->op_begin() + 1, N->op_end(), [&Visited, &DILocationReachable](const MDOperand &Op) { - return isa(Op.get()) || - isDILocationReachable(Visited, DILocationReachable, + return isDILocationReachable(Visited, DILocationReachable, Op.get()); })) return nullptr; -- 2.7.4