summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2022-02-18 14:10:25 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2022-02-25 08:18:14 +0000
commit872ec72de447b2803894e17253399a54a4c10e1f (patch)
tree244ca496149b8e1d9d4c786609c91da7f93f8736 /compiler/optimizing/nodes.cc
parent0805e9083aa761094575cd3c4d1eff41bbcf5b74 (diff)
Update compiler/ implications to use (D)CHECK_IMPLIES
Follow-up to aosp/1988868 in which we added the (D)CHECK_IMPLIES macro. This CL uses it on compiler/ occurrences found by a regex. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: If63aed969bfb8b31d6fbbcb3bca2b04314c894b7
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 00bfc92c2f..0018a5b970 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -719,7 +719,8 @@ void HGraph::ComputeTryBlockInformation() {
// the first predecessor can never be a back edge and therefore it must have
// been visited already and had its try membership set.
HBasicBlock* first_predecessor = block->GetPredecessors()[0];
- DCHECK(!block->IsLoopHeader() || !block->GetLoopInformation()->IsBackEdge(*first_predecessor));
+ DCHECK_IMPLIES(block->IsLoopHeader(),
+ !block->GetLoopInformation()->IsBackEdge(*first_predecessor));
const HTryBoundary* try_entry = first_predecessor->ComputeTryEntryOfSuccessors();
if (try_entry != nullptr &&
(block->GetTryCatchInformation() == nullptr ||
@@ -2468,7 +2469,7 @@ void HBasicBlock::DisconnectAndDelete() {
// control-flow instructions.
for (HBasicBlock* predecessor : predecessors_) {
// We should not see any back edges as they would have been removed by step (3).
- DCHECK(!IsInLoop() || !GetLoopInformation()->IsBackEdge(*predecessor));
+ DCHECK_IMPLIES(IsInLoop(), !GetLoopInformation()->IsBackEdge(*predecessor));
HInstruction* last_instruction = predecessor->GetLastInstruction();
if (last_instruction->IsTryBoundary() && !IsCatchBlock()) {
@@ -3069,7 +3070,7 @@ static void CheckAgainstUpperBound(ReferenceTypeInfo rti, ReferenceTypeInfo uppe
DCHECK(upper_bound_rti.IsSupertypeOf(rti))
<< " upper_bound_rti: " << upper_bound_rti
<< " rti: " << rti;
- DCHECK(!upper_bound_rti.GetTypeHandle()->CannotBeAssignedFromOtherTypes() || rti.IsExact())
+ DCHECK_IMPLIES(upper_bound_rti.GetTypeHandle()->CannotBeAssignedFromOtherTypes(), rti.IsExact())
<< " upper_bound_rti: " << upper_bound_rti
<< " rti: " << rti;
}