[PATCH] D18992: Refactor debugging code, NFC.

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 12:48:21 PDT 2016


george.burgess.iv added a subscriber: george.burgess.iv.
george.burgess.iv accepted this revision.
george.burgess.iv added a reviewer: george.burgess.iv.
george.burgess.iv added a comment.
This revision is now accepted and ready to land.

Just a few comments, and this LGTM. Thanks for the patch!


================
Comment at: lib/CodeGen/StackColoring.cpp:195
@@ +194,3 @@
+LLVM_DUMP_METHOD void StackColoring::dumpBV(const char *tag, const BitVector &BV) const {
+  DEBUG(dbgs()<< tag << " : { ");
+  for (unsigned i=0; i < BV.size(); ++i)
----------------
Nit: Please clang-format this, and the other `DEBUG` statements nearby (specifically, I think there should be a space between `dbgs()` and `<<`).

================
Comment at: lib/CodeGen/StackColoring.cpp:196
@@ +195,3 @@
+  DEBUG(dbgs()<< tag << " : { ");
+  for (unsigned i=0; i < BV.size(); ++i)
+    DEBUG(dbgs()<<BV.test(i)<<" ");
----------------
Nit: `for (unsigned I = 0, E = BV.size(); I != E; ++I)`

================
Comment at: lib/CodeGen/StackColoring.cpp:221
@@ +220,3 @@
+LLVM_DUMP_METHOD void StackColoring::dumpIntervals() const {
+  for (unsigned I = 0; I < Intervals.size(); ++I) {
+    DEBUG(dbgs() << "Interval[" << I << "]:\n");
----------------
Nit: `for (unsigned I = 0, E = Intervals.size(); I != E; ++I)`

================
Comment at: lib/CodeGen/StackColoring.cpp:223
@@ -226,1 +222,3 @@
+    DEBUG(dbgs() << "Interval[" << I << "]:\n");
+    Intervals[I]->dump();
   }
----------------
ISTM `LiveInterval::dump` will unconditionally dump things to `dbgs()`. So, maybe we should wrap this dump in `DEBUG`, too?


http://reviews.llvm.org/D18992





More information about the llvm-commits mailing list