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

Unified Diff: src/IceCfgNode.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 | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.h
diff --git a/src/IceCfgNode.h b/src/IceCfgNode.h
index 279b07f5baf954df40d6b1bd0dc78a76e2e8bb7d..d60b0f014ae4ced1ac2445edd741cdcdd04440ff 100644
--- a/src/IceCfgNode.h
+++ b/src/IceCfgNode.h
@@ -26,17 +26,18 @@ class CfgNode {
CfgNode &operator=(const CfgNode &) = delete;
public:
- static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") {
- return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name);
+ static CfgNode *create(Cfg *Func, SizeT LabelIndex) {
+ return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex);
}
// Access the label number and name for this node.
SizeT getIndex() const { return Number; }
IceString getName() const;
- void setName(IceString &NewName) {
+ void setName(const IceString &NewName) {
// Make sure that the name can only be set once.
- assert(Name.empty());
- Name = NewName;
+ assert(NameIndex < 0);
+ if (!NewName.empty())
+ NameIndex = Func->addNodeName(NewName);
}
IceString getAsmName() const {
return ".L" + Func->getFunctionName() + "$" + getName();
@@ -87,10 +88,10 @@ public:
void dump(Cfg *Func) const;
private:
- CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name);
+ CfgNode(Cfg *Func, SizeT LabelIndex);
Cfg *const Func;
const SizeT Number; // label index
- IceString Name; // for dumping only
+ int32_t NameIndex; // index into Cfg::NodeNames table
bool HasReturn; // does this block need an epilog?
bool NeedsPlacement;
InstNumberT InstCountEstimate; // rough instruction count estimate
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceCfgNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698