diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-11 10:30:02 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-11 10:32:12 +0100 |
commit | 8a16d97fb8f031822b206e65f9109a071da40563 (patch) | |
tree | 9dbbf5feaac15d2e4f54fbfc3c204fcdd6e8317a /compiler/optimizing/live_ranges_test.cc | |
parent | c7f6b86c269727fe031146b9c18652d40916d46f (diff) | |
download | art-8a16d97fb8f031822b206e65f9109a071da40563.tar.gz art-8a16d97fb8f031822b206e65f9109a071da40563.tar.bz2 art-8a16d97fb8f031822b206e65f9109a071da40563.zip |
Fix valgrind errors.
For now just stack allocate the code generator. Will think
about cleaning up the root problem later (CodeGenerator being an
arena object).
Change-Id: I161a6f61c5f27ea88851b446f3c1e12ee9c594d7
Diffstat (limited to 'compiler/optimizing/live_ranges_test.cc')
-rw-r--r-- | compiler/optimizing/live_ranges_test.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index a6e5ca9e46..21e634de04 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -16,6 +16,7 @@ #include "builder.h" #include "code_generator.h" +#include "code_generator_x86.h" #include "dex_file.h" #include "dex_instruction.h" #include "nodes.h" @@ -58,8 +59,8 @@ TEST(LiveRangesTest, CFG1) { ArenaAllocator allocator(&pool); HGraph* graph = BuildGraph(data, &allocator); - CodeGenerator* codegen = CodeGenerator::Create(&allocator, graph, InstructionSet::kX86); - SsaLivenessAnalysis liveness(*graph, codegen); + x86::CodeGeneratorX86 codegen(graph); + SsaLivenessAnalysis liveness(*graph, &codegen); liveness.Analyze(); LiveInterval* interval = liveness.GetInstructionFromSsaIndex(0)->GetLiveInterval(); @@ -104,8 +105,8 @@ TEST(LiveRangesTest, CFG2) { ArenaPool pool; ArenaAllocator allocator(&pool); HGraph* graph = BuildGraph(data, &allocator); - CodeGenerator* codegen = CodeGenerator::Create(&allocator, graph, InstructionSet::kX86); - SsaLivenessAnalysis liveness(*graph, codegen); + x86::CodeGeneratorX86 codegen(graph); + SsaLivenessAnalysis liveness(*graph, &codegen); liveness.Analyze(); LiveInterval* interval = liveness.GetInstructionFromSsaIndex(0)->GetLiveInterval(); @@ -153,8 +154,8 @@ TEST(LiveRangesTest, CFG3) { ArenaPool pool; ArenaAllocator allocator(&pool); HGraph* graph = BuildGraph(data, &allocator); - CodeGenerator* codegen = CodeGenerator::Create(&allocator, graph, InstructionSet::kX86); - SsaLivenessAnalysis liveness(*graph, codegen); + x86::CodeGeneratorX86 codegen(graph); + SsaLivenessAnalysis liveness(*graph, &codegen); liveness.Analyze(); // Test for the 4 constant. @@ -229,8 +230,8 @@ TEST(LiveRangesTest, Loop) { ArenaPool pool; ArenaAllocator allocator(&pool); HGraph* graph = BuildGraph(data, &allocator); - CodeGenerator* codegen = CodeGenerator::Create(&allocator, graph, InstructionSet::kX86); - SsaLivenessAnalysis liveness(*graph, codegen); + x86::CodeGeneratorX86 codegen(graph); + SsaLivenessAnalysis liveness(*graph, &codegen); liveness.Analyze(); // Test for the 0 constant. |