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

Unified Diff: src/IceCfgNode.h

Issue 1838753002: Subzero: Remove IceString. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 months 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 f7e7b0e20ee07e190a13a94901874682ba04a85e..b81c5c204a890918d574b79e69cc9abb6c7b9c60 100644
--- a/src/IceCfgNode.h
+++ b/src/IceCfgNode.h
@@ -18,6 +18,7 @@
#include "IceDefs.h"
#include "IceInst.h" // InstList traits
+#include "IceStringPool.h"
namespace Ice {
@@ -27,8 +28,8 @@ class CfgNode {
CfgNode &operator=(const CfgNode &) = delete;
public:
- static CfgNode *create(Cfg *Func, SizeT LabelIndex) {
- return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex);
+ static CfgNode *create(Cfg *Func, SizeT Number) {
+ return new (Func->allocate<CfgNode>()) CfgNode(Func, Number);
}
Cfg *getCfg() const { return Func; }
@@ -36,14 +37,13 @@ public:
/// Access the label number and name for this node.
SizeT getIndex() const { return Number; }
void resetIndex(SizeT NewNumber) { Number = NewNumber; }
- IceString getName() const;
- void setName(const IceString &NewName) {
- // Make sure that the name can only be set once.
- assert(NameIndex == Cfg::IdentifierIndexInvalid);
- if (!NewName.empty())
- NameIndex = Func->addIdentifierName(NewName);
+ NodeString getName() const { return Name; }
+ void setName(const std::string &NewName) {
+ if (NewName.empty())
+ return;
+ Name = NodeString::createWithString(Func, NewName);
}
- IceString getAsmName() const {
+ std::string getAsmName() const {
return ".L" + Func->getFunctionName() + "$" + getName();
}
@@ -111,15 +111,13 @@ public:
void profileExecutionCount(VariableDeclaration *Var);
private:
- CfgNode(Cfg *Func, SizeT LabelIndex);
+ CfgNode(Cfg *Func, SizeT Number);
bool livenessValidateIntervals(Liveness *Liveness) const;
Cfg *const Func;
- SizeT Number; /// invariant: Func->Nodes[Number]==this
- const SizeT LabelNumber; /// persistent number for label generation
- Cfg::IdentifierIndexType NameIndex =
- Cfg::IdentifierIndexInvalid; /// index into Cfg::NodeNames table
- SizeT LoopNestDepth = 0; /// the loop nest depth of this node
- bool HasReturn = false; /// does this block need an epilog?
+ SizeT Number; /// invariant: Func->Nodes[Number]==this
+ NodeString Name;
+ SizeT LoopNestDepth = 0; /// the loop nest depth of this node
+ bool HasReturn = false; /// does this block need an epilog?
bool NeedsPlacement = false;
bool NeedsAlignment = false; /// is sandboxing required?
InstNumberT InstCountEstimate = 0; /// 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