Fix CompilationUnit's UniquePtr usage.
CompilationUnit defined in compiler_ir.h uses UniquePtr with
forward-declared MIRGraph, so the ctor/dtor must be defined
in a compilation unit that actually includes MIRGraph's
definition. Otherwise the build would depend on the order of
includes.
Change-Id: I53096c5f1c975843bad3c375d4ce72a9c0656264
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index 2f8521f..b8cd67e 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -108,6 +108,38 @@
// (1 << kDebugTimings) |
0;
+CompilationUnit::CompilationUnit(ArenaPool* pool)
+ : compiler_driver(NULL),
+ class_linker(NULL),
+ dex_file(NULL),
+ class_loader(NULL),
+ class_def_idx(0),
+ method_idx(0),
+ code_item(NULL),
+ access_flags(0),
+ invoke_type(kDirect),
+ shorty(NULL),
+ disable_opt(0),
+ enable_debug(0),
+ verbose(false),
+ compiler_backend(kNoBackend),
+ instruction_set(kNone),
+ num_dalvik_registers(0),
+ insns(NULL),
+ num_ins(0),
+ num_outs(0),
+ num_regs(0),
+ num_compiler_temps(0),
+ compiler_flip_match(false),
+ arena(pool),
+ mir_graph(NULL),
+ cg(NULL),
+ timings("QuickCompiler", true, false) {
+}
+
+CompilationUnit::~CompilationUnit() {
+}
+
// TODO: Add a cumulative version of logging, and combine with dex2oat --dump-timing
void CompilationUnit::StartTimingSplit(const char* label) {
if (enable_debug & (1 << kDebugTimings)) {