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

Unified Diff: src/IceCfgNode.cpp

Issue 673783002: Subzero: Improve debugging controls, plus minor refactoring. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 2 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/IceClFlags.h » ('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 767c9c375286a893e3c725efb1da1de629f74f26..4e4d36bf7c69525352d2437dbe1585a0e166ea55 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -30,9 +30,7 @@ CfgNode::CfgNode(Cfg *Func, SizeT LabelNumber, IceString Name)
IceString CfgNode::getName() const {
if (!Name.empty())
return Name;
- char buf[30];
- snprintf(buf, llvm::array_lengthof(buf), "__%u", getIndex());
- return buf;
+ return "__" + std::to_string(getIndex());
}
// Adds an instruction to either the Phi list or the regular
@@ -65,7 +63,7 @@ void CfgNode::renumberInstructions() {
InstCountEstimate = Func->getNextInstNumber() - FirstNumber;
}
-// When a node is created, the OutEdges are immediately knows, but the
+// When a node is created, the OutEdges are immediately known, but the
// InEdges have to be built up incrementally. After the CFG has been
// constructed, the computePredecessors() pass finalizes it by
// creating the InEdges list.
@@ -557,7 +555,12 @@ void CfgNode::dump(Cfg *Func) const {
Str << " // LiveIn:";
for (SizeT i = 0; i < LiveIn.size(); ++i) {
if (LiveIn[i]) {
- Str << " %" << Liveness->getVariable(i, this)->getName();
+ Variable *Var = Liveness->getVariable(i, this);
+ Str << " %" << Var->getName();
+ if (Func->getContext()->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
+ Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
+ Var->getType());
+ }
}
}
Str << "\n";
@@ -577,7 +580,12 @@ void CfgNode::dump(Cfg *Func) const {
Str << " // LiveOut:";
for (SizeT i = 0; i < LiveOut.size(); ++i) {
if (LiveOut[i]) {
- Str << " %" << Liveness->getVariable(i, this)->getName();
+ Variable *Var = Liveness->getVariable(i, this);
+ Str << " %" << Var->getName();
+ if (Func->getContext()->isVerbose(IceV_RegOrigins) && Var->hasReg()) {
+ Str << ":" << Func->getTarget()->getRegName(Var->getRegNum(),
+ Var->getType());
+ }
}
}
Str << "\n";
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceClFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698