Allocate code generators on the arena.
Change-Id: If8cf0ee43711f6e13171443e3c057ff370ccfbaa
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 1a060b1..87832a2 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -166,15 +166,15 @@
DISALLOW_COPY_AND_ASSIGN(FieldAccessCallingConvention);
};
-class CodeGenerator {
+class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
public:
// Compiles the graph to executable instructions.
void Compile(CodeAllocator* allocator);
- static CodeGenerator* Create(HGraph* graph,
- InstructionSet instruction_set,
- const InstructionSetFeatures& isa_features,
- const CompilerOptions& compiler_options,
- OptimizingCompilerStats* stats = nullptr);
+ static std::unique_ptr<CodeGenerator> Create(HGraph* graph,
+ InstructionSet instruction_set,
+ const InstructionSetFeatures& isa_features,
+ const CompilerOptions& compiler_options,
+ OptimizingCompilerStats* stats = nullptr);
virtual ~CodeGenerator() {}
// Get the graph. This is the outermost graph, never the graph of a method being inlined.