From 0805e9083aa761094575cd3c4d1eff41bbcf5b74 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Wed, 16 Feb 2022 17:56:34 +0000 Subject: Add (D)CHECK_IMPLIES to ART logging Adds an _IMPLIES macro which is equivalent to checking a => b. This CL includes an example of how it could be useful to aid readability. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: If36ccf2a1d10ebd0b0c9f9635020dc78f5ae94ae --- compiler/optimizing/code_generator_x86_64.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index 1016652478..ff4ab59760 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -5195,8 +5195,7 @@ void InstructionCodeGeneratorX86_64::HandleFieldSet(HInstruction* instruction, if (byte_swap) { v = BSWAP(v); } - // `field_type == DataType::Type::kReference` implies `v == 0`. - DCHECK((field_type != DataType::Type::kReference) || (v == 0)); + DCHECK_IMPLIES(field_type == DataType::Type::kReference, v == 0); // Note: if heap poisoning is enabled, no need to poison // (negate) `v` if it is a reference, as it would be null. __ movl(field_addr, Immediate(v)); -- cgit v1.2.3-59-g8ed1b