1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Remove redundant comparisons (NFC)

This commit is contained in:
Adrian Prantl 2021-06-02 09:52:45 -07:00
parent 511556e3ea
commit 38a9864e9c

View File

@ -388,7 +388,7 @@ static bool isDILocationReachable(SmallPtrSetImpl<Metadata *> &Visited,
MDNode *N = dyn_cast_or_null<MDNode>(MD); MDNode *N = dyn_cast_or_null<MDNode>(MD);
if (!N) if (!N)
return false; return false;
if (Reachable.count(N) || isa<DILocation>(N)) if (isa<DILocation>(N) || Reachable.count(N))
return true; return true;
if (!Visited.insert(N).second) if (!Visited.insert(N).second)
return false; return false;
@ -415,8 +415,7 @@ static MDNode *stripDebugLocFromLoopID(MDNode *N) {
// count_if avoids an early exit. // count_if avoids an early exit.
if (!std::count_if(N->op_begin() + 1, N->op_end(), if (!std::count_if(N->op_begin() + 1, N->op_end(),
[&Visited, &DILocationReachable](const MDOperand &Op) { [&Visited, &DILocationReachable](const MDOperand &Op) {
return isa<DILocation>(Op.get()) || return isDILocationReachable(
isDILocationReachable(
Visited, DILocationReachable, Op.get()); Visited, DILocationReachable, Op.get());
})) }))
return N; return N;
@ -426,8 +425,7 @@ static MDNode *stripDebugLocFromLoopID(MDNode *N) {
if (std::all_of( if (std::all_of(
N->op_begin() + 1, N->op_end(), N->op_begin() + 1, N->op_end(),
[&Visited, &DILocationReachable](const MDOperand &Op) { [&Visited, &DILocationReachable](const MDOperand &Op) {
return isa<DILocation>(Op.get()) || return isDILocationReachable(Visited, DILocationReachable,
isDILocationReachable(Visited, DILocationReachable,
Op.get()); Op.get());
})) }))
return nullptr; return nullptr;