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

Unified Diff: src/IceOperand.cpp

Issue 570713006: Subzero: Refactor Operand::dump(). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use a more general dump function Created 6 years, 3 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/IceOperand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index b718ba50f445c15e801e3517d674022de3bf7e96..1f232dd61a39b2a1332b6ee5eaced5b11271d317 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -201,8 +201,11 @@ void Variable::emit(const Cfg *Func) const {
Func->getTarget()->emitVariable(this, Func);
}
-void Variable::dump(const Cfg *Func) const {
- Ostream &Str = Func->getContext()->getStrDump();
+void Variable::dump(const Cfg *Func, Ostream &Str) const {
+ if (Func == NULL) {
+ Str << "%" << getName();
+ return;
+ }
const CfgNode *CurrentNode = Func->getCurrentNode();
(void)CurrentNode; // used only in assert()
assert(CurrentNode == NULL || DefNode == NULL || DefNode == CurrentNode);
@@ -241,8 +244,7 @@ void ConstantRelocatable::emit(GlobalContext *Ctx) const {
}
}
-void ConstantRelocatable::dump(GlobalContext *Ctx) const {
- Ostream &Str = Ctx->getStrDump();
+void ConstantRelocatable::dump(const Cfg *, Ostream &Str) const {
Str << "@" << Name;
if (Offset)
Str << "+" << Offset;
« no previous file with comments | « src/IceOperand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698