diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 331bf8a1ecc8..06c511f8530a 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;