Added SEA IR def -> use edges (along the use -> def).
The edges are stored in the "tail" object and will be used for type information propagation.
The .dot generation nowhas a switch to enable or disable displaying these edges.
Change-Id: Iaf3ce1d1efcda6f5d65c42c69bb1573786c90309
diff --git a/compiler/sea_ir/sea.h b/compiler/sea_ir/sea.h
index c64703a..040ad8a 100644
--- a/compiler/sea_ir/sea.h
+++ b/compiler/sea_ir/sea.h
@@ -35,6 +35,17 @@
VISITING = -2
};
+// Stores options for turning a SEA IR graph to a .dot file.
+class DotConversion {
+ public:
+ static bool SaveUseEdges() {
+ return save_use_edges_;
+ }
+
+ private:
+ static const bool save_use_edges_ = false; // TODO: Enable per-sea graph configuration.
+};
+
class Region;
class InstructionNode;
@@ -53,6 +64,7 @@
result += StringId() +" [label=\"signature:";
result += art::StringPrintf("r%d", GetResultRegister());
result += "\"] // signature node\n";
+ ToDotSSAEdges(result);
}
int GetResultRegister() const {
@@ -98,6 +110,7 @@
definition_edges_[predecessor_id] = new std::vector<InstructionNode*>();
}
definition_edges_[predecessor_id]->push_back(definition);
+ definition->AddSSAUse(this);
}
// Returns the instruction that defines the phi register from predecessor