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/optimizing_compiler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index cb40a51aee..1bf1586d37 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -817,7 +817,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, jit::Jit* jit = Runtime::Current()->GetJit(); if (jit != nullptr) { ProfilingInfo* info = jit->GetCodeCache()->GetProfilingInfo(method, Thread::Current()); - DCHECK(compilation_kind != CompilationKind::kBaseline || info != nullptr) + DCHECK_IMPLIES(compilation_kind == CompilationKind::kBaseline, info != nullptr) << "Compiling a method baseline should always have a ProfilingInfo"; graph->SetProfilingInfo(info); } @@ -1107,7 +1107,7 @@ CompiledMethod* OptimizingCompiler::Compile(const dex::CodeItem* code_item, // regressing. std::string method_name = dex_file.PrettyMethod(method_idx); bool shouldCompile = method_name.find("$opt$") != std::string::npos; - DCHECK((compiled_method != nullptr) || !shouldCompile) << "Didn't compile " << method_name; + DCHECK_IMPLIES(compiled_method == nullptr, !shouldCompile) << "Didn't compile " << method_name; } return compiled_method; -- cgit v1.2.3-59-g8ed1b