From 872ec72de447b2803894e17253399a54a4c10e1f Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 18 Feb 2022 14:10:25 +0000 Subject: 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 --- compiler/optimizing/nodes.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/nodes.cc') 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; } -- cgit v1.2.3-59-g8ed1b