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

Unified Diff: src/IceCfgNode.cpp

Issue 798693003: Subzero: Don't store std::string objects inside Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes 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') | src/IceOperand.h » ('J')
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 aa8ba7a8fee016f4f37fd894feed9eada4c4c7a8..1623731e5470823b03d1b48951ea71300976923e 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -23,14 +23,14 @@
namespace Ice {
CfgNode::CfgNode(Cfg *Func, SizeT LabelNumber)
- : Func(Func), Number(LabelNumber), NameIndex(-1), HasReturn(false),
- NeedsPlacement(false), InstCountEstimate(0) {}
+ : Func(Func), Number(LabelNumber), NameIndex(Cfg::IdentifierIndexInvalid),
+ 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 (NameIndex >= 0)
- return Func->getNodeName(NameIndex);
+ return Func->getIdentifierName(NameIndex);
return "__" + std::to_string(getIndex());
}
@@ -437,8 +437,9 @@ void CfgNode::advancedPhiLowering() {
Operand *OtherSrc = Desc[J].Src;
if (Desc[J].NumPred && sameVarOrReg(Dest, OtherSrc)) {
SizeT VarNum = Func->getNumVariables();
- Variable *Tmp = Func->makeVariable(
- OtherSrc->getType(), "__split_" + std::to_string(VarNum));
+ Variable *Tmp = Func->makeVariable(OtherSrc->getType());
+ if (ALLOW_DUMP)
+ Tmp->setName(Func, "__split_" + std::to_string(VarNum));
Assignments.push_back(InstAssign::create(Func, Tmp, OtherSrc));
Desc[J].Src = Tmp;
Found = true;
@@ -970,7 +971,7 @@ void CfgNode::dump(Cfg *Func) const {
for (SizeT i = 0; i < LiveIn.size(); ++i) {
if (LiveIn[i]) {
Variable *Var = Liveness->getVariable(i, this);
- Str << " %" << Var->getName();
+ Str << " %" << Var->getName(Func);
if (Func->getContext()->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
Var->getType());
@@ -995,7 +996,7 @@ void CfgNode::dump(Cfg *Func) const {
for (SizeT i = 0; i < LiveOut.size(); ++i) {
if (LiveOut[i]) {
Variable *Var = Liveness->getVariable(i, this);
- Str << " %" << Var->getName();
+ Str << " %" << Var->getName(Func);
if (Func->getContext()->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
Var->getType());
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceConverter.cpp » ('j') | src/IceOperand.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698