diff options
author | 2013-07-26 12:05:03 -0700 | |
---|---|---|
committer | 2013-07-26 16:14:20 -0700 | |
commit | 6bee4459691c8e3b20fc706e74d52d08a4869731 (patch) | |
tree | a3d724b66f45b2cd37e3b3c5e7b29af8a0b50643 /compiler/sea_ir/instruction_nodes.h | |
parent | 0f055d11096cb02563e9c040cd03c791fd8f69a3 (diff) |
Improvements and clustering for the .dot file generation.
Dot clusters are used to show SEA IR regions.
Passing around dex_file for improved instruction text representation.
SeaGraph now stores the dex file.
Removed all .dot edges except ssa edges and inter-region control flow.
Changed color to gray for ssa edges and kept black for control flow.
Consistently labeled SSA edges with virtual register number.
Replaced stringstream with StringPrintf.
Change-Id: I67d9d92e594d3f2de94eec1c78a64f3972ae60b1
Diffstat (limited to 'compiler/sea_ir/instruction_nodes.h')
-rw-r--r-- | compiler/sea_ir/instruction_nodes.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/sea_ir/instruction_nodes.h b/compiler/sea_ir/instruction_nodes.h index 5c9cfe19dc..103c16f8ac 100644 --- a/compiler/sea_ir/instruction_nodes.h +++ b/compiler/sea_ir/instruction_nodes.h @@ -50,7 +50,7 @@ class InstructionNode: public SeaNode { // Returns the set of register numbers that are used by the instruction. virtual std::vector<int> GetUses(); // Appends to @result the .dot string representation of the instruction. - virtual void ToDot(std::string& result) const; + virtual void ToDot(std::string& result, const art::DexFile& dex_file) const; // Mark the current instruction as a downward exposed definition. void MarkAsDEDef(); // Rename the use of @reg_no to refer to the instruction @definition, @@ -126,7 +126,7 @@ class UnnamedConstInstructionNode: public ConstInstructionNode { return value_; } - void ToDot(std::string& result) const { + void ToDot(std::string& result, const art::DexFile& dex_file) const { std::ostringstream sstream; sstream << GetConstValue(); const std::string value_as_string(sstream.str()); @@ -140,11 +140,9 @@ class UnnamedConstInstructionNode: public ConstInstructionNode { for (std::map<int, InstructionNode* >::const_iterator def_it = definition_edges_.begin(); def_it != definition_edges_.end(); def_it++) { if (NULL != def_it->second) { - result += def_it->second->StringId() + " -> " + StringId() +"[color=red,label=\""; - std::stringstream ss; - ss << def_it->first; - result.append(ss.str()); - result += "\"] ; // ssa edge\n"; + result += def_it->second->StringId() + " -> " + StringId() +"[color=gray,label=\""; + result += art::StringPrintf("vR = %d", def_it->first); + result += "\"] ; // ssa edge\n"; } } } |