From 7c3952f423b8213083d60596a5f0bf4237ca3f7b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 19 Feb 2015 18:21:24 -0800 Subject: ART: Add -Wunused Until the global CFLAGS are fixed, add Wunused. Fix declarations in the optimizing compiler. Change-Id: Ic4553f08e809dc54f3d82af57ac592622c98e000 --- compiler/optimizing/graph_visualizer.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index c59273753e..cabfa488c0 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -17,8 +17,10 @@ #include "graph_visualizer.h" #include "code_generator.h" +#include "licm.h" #include "nodes.h" #include "optimization.h" +#include "register_allocator.h" #include "ssa_liveness_analysis.h" namespace art { @@ -188,6 +190,10 @@ class HGraphVisualizerPrinter : public HGraphVisitor { output_ << " " << phi->GetRegNumber(); } + bool IsPass(const char* name) { + return strcmp(pass_name_, name) == 0; + } + void PrintInstruction(HInstruction* instruction) { output_ << instruction->DebugName(); instruction->Accept(this); @@ -211,7 +217,7 @@ class HGraphVisualizerPrinter : public HGraphVisitor { } output_ << "])"; } - if (pass_name_ == kLivenessPassName + if (IsPass(SsaLivenessAnalysis::kLivenessPassName) && is_after_pass_ && instruction->GetLifetimePosition() != kNoLifetime) { output_ << " (liveness: " << instruction->GetLifetimePosition(); @@ -221,7 +227,7 @@ class HGraphVisualizerPrinter : public HGraphVisitor { interval.Dump(output_); } output_ << ")"; - } else if (pass_name_ == kRegisterAllocatorPassName && is_after_pass_) { + } else if (IsPass(RegisterAllocator::kRegisterAllocatorPassName) && is_after_pass_) { LocationSummary* locations = instruction->GetLocations(); if (locations != nullptr) { output_ << " ( "; @@ -236,7 +242,7 @@ class HGraphVisualizerPrinter : public HGraphVisitor { } } output_ << " (liveness: " << instruction->GetLifetimePosition() << ")"; - } else if (pass_name_ == kLoopInvariantCodeMotionPassName) { + } else if (IsPass(LICM::kLoopInvariantCodeMotionPassName)) { output_ << " ( loop_header:"; HLoopInformation* info = instruction->GetBlock()->GetLoopInformation(); if (info == nullptr) { -- cgit v1.2.3-59-g8ed1b