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

Unified Diff: src/IceCfg.h

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 | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.h
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 970b8383c785c05884d29a7e32bf1e5ef954069d..c313a8998ca3df0251b7e91f5dfa2357694f5f1b 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -59,9 +59,17 @@ public:
void setEntryNode(CfgNode *EntryNode) { Entry = EntryNode; }
CfgNode *getEntryNode() const { return Entry; }
// Create a node and append it to the end of the linearized list.
- CfgNode *makeNode(const IceString &Name = "");
+ CfgNode *makeNode();
SizeT getNumNodes() const { return Nodes.size(); }
const NodeList &getNodes() const { return Nodes; }
+ // Adds a name to the list and returns its index, suitable for the
+ // argument to getNodeName(). No checking for duplicates is done.
+ int32_t addNodeName(const IceString &Name) {
+ int32_t Index = NodeNames.size();
+ NodeNames.push_back(Name);
+ return Index;
+ }
+ const IceString &getNodeName(int32_t Index) const { return NodeNames[Index]; }
// Manage instruction numbering.
InstNumberT newInstNumber() { return NextInstNumber++; }
@@ -175,6 +183,7 @@ private:
IceString ErrorMessage;
CfgNode *Entry; // entry basic block
NodeList Nodes; // linearized node list; Entry should be first
+ std::vector<IceString> NodeNames;
InstNumberT NextInstNumber;
VarList Variables;
VarList Args; // subset of Variables, in argument order
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698