summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/linearize_test.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-04-15 14:17:44 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-04-15 14:17:44 +0100
commit0d9f17de8f21a10702de1510b73e89d07b3b9bbf (patch)
tree3d58a2a165ee2bc5af0e813b1ffa893fba72ed6d /compiler/optimizing/linearize_test.cc
parent9bb3e8e10d7d9230a323511094a9e260062a1473 (diff)
downloadart-0d9f17de8f21a10702de1510b73e89d07b3b9bbf.zip
art-0d9f17de8f21a10702de1510b73e89d07b3b9bbf.tar.gz
art-0d9f17de8f21a10702de1510b73e89d07b3b9bbf.tar.bz2
Move the linear order to the HGraph.
Bug found by Zheng Xu: SsaLivenessAnalysis being a stack allocated object, we should not refer to it in later phases of the compiler. Specifically, the code generator was using the linear order, which was stored in the liveness analysis object. Change-Id: I574641f522b7b86fc43f3914166108efc72edb3b
Diffstat (limited to 'compiler/optimizing/linearize_test.cc')
-rw-r--r--compiler/optimizing/linearize_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/linearize_test.cc b/compiler/optimizing/linearize_test.cc
index 28c5555..7818c60 100644
--- a/compiler/optimizing/linearize_test.cc
+++ b/compiler/optimizing/linearize_test.cc
@@ -50,12 +50,12 @@ static void TestCode(const uint16_t* data, const int* expected_order, size_t num
std::unique_ptr<const X86InstructionSetFeatures> features_x86(
X86InstructionSetFeatures::FromCppDefines());
x86::CodeGeneratorX86 codegen(graph, *features_x86.get(), CompilerOptions());
- SsaLivenessAnalysis liveness(*graph, &codegen);
+ SsaLivenessAnalysis liveness(graph, &codegen);
liveness.Analyze();
- ASSERT_EQ(liveness.GetLinearOrder().Size(), number_of_blocks);
+ ASSERT_EQ(graph->GetLinearOrder().Size(), number_of_blocks);
for (size_t i = 0; i < number_of_blocks; ++i) {
- ASSERT_EQ(liveness.GetLinearOrder().Get(i)->GetBlockId(), expected_order[i]);
+ ASSERT_EQ(graph->GetLinearOrder().Get(i)->GetBlockId(), expected_order[i]);
}
}