Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: src/IceCfgNode.cpp

Issue 787333005: Subzero: Pull the node name out of the node structure. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a comment Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceConverter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 59035f87b82ea311354b347100e5b5dcc286ea2c..920f373783285335317a93e03cb5d5afd21bebda 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -22,15 +22,15 @@
namespace Ice {
-CfgNode::CfgNode(Cfg *Func, SizeT LabelNumber, IceString Name)
- : Func(Func), Number(LabelNumber), Name(Name), HasReturn(false),
+CfgNode::CfgNode(Cfg *Func, SizeT LabelNumber)
+ : Func(Func), Number(LabelNumber), NameIndex(-1), HasReturn(false),
NeedsPlacement(false), InstCountEstimate(0) {}
// Returns the name the node was created with. If no name was given,
// it synthesizes a (hopefully) unique name.
IceString CfgNode::getName() const {
- if (!Name.empty())
- return Name;
+ if (NameIndex >= 0)
+ return Func->getNodeName(NameIndex);
return "__" + std::to_string(getIndex());
}
@@ -219,8 +219,9 @@ void CfgNode::deletePhis() {
// out-edge list, this node's in-edge list, and the Phi instruction's
// operand list.
CfgNode *CfgNode::splitIncomingEdge(CfgNode *Pred, SizeT EdgeIndex) {
- CfgNode *NewNode =
- Func->makeNode("split_" + Pred->getName() + "_" + getName() + "_" +
+ CfgNode *NewNode = Func->makeNode();
+ if (ALLOW_DUMP)
+ NewNode->setName("split_" + Pred->getName() + "_" + getName() + "_" +
std::to_string(EdgeIndex));
// The new node is added to the end of the node list, and will later
// need to be sorted into a reasonable topological order.
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceConverter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698