From a8013fd4f2630aa45b5a3c320660ac9590523537 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Mon, 4 Apr 2016 15:34:31 +0100 Subject: Please Clang wrt stack frames in HInliner::TryBuildAndInlineHelper. This change enables Clang to compile ART on MIPS64 without complaining about stack frames larger than what `-Wframe-larger-than` allows. Change-Id: I72f424922d9cb3d01f7b8ba4e5cb9170b82870d9 --- compiler/optimizing/inliner.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/inliner.cc') diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 7068e8bf9b..33803c1093 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -1061,14 +1061,19 @@ bool HInliner::TryBuildAndInlineHelper(HInvoke* invoke_instruction, caller_instruction_counter); callee_graph->SetArtMethod(resolved_method); - OptimizingCompilerStats inline_stats; + // When they are needed, allocate `inline_stats` on the heap instead + // of on the stack, as Clang might produce a stack frame too large + // for this function, that would not fit the requirements of the + // `-Wframe-larger-than` option. + std::unique_ptr inline_stats = + (stats_ == nullptr) ? nullptr : MakeUnique(); HGraphBuilder builder(callee_graph, &dex_compilation_unit, &outer_compilation_unit_, resolved_method->GetDexFile(), *code_item, compiler_driver_, - &inline_stats, + inline_stats.get(), resolved_method->GetQuickenedInfo(), dex_cache, handles_); -- cgit v1.2.3-59-g8ed1b