Tweak debug output from SlotIndexes.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Feb 2011 20:29:41 +0000 (20:29 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Feb 2011 20:29:41 +0000 (20:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124814 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SlotIndexes.cpp

index 277cce3db880f0621ed25f70677fc790ba792c13..6e3fa90e4341eb0caafda31a358f93f1412bd597 100644 (file)
@@ -158,6 +158,7 @@ void SlotIndexes::renumberIndexes() {
   // resulting numbering will match what would have been generated by the
   // pass during the initial numbering of the function if the new instructions
   // had been present.
+  DEBUG(dbgs() << "\n*** Renumbering SlotIndexes ***\n");
 
   functionSize = 0;
   unsigned index = 0;
@@ -203,7 +204,10 @@ void SlotIndexes::dump() const {
 
 // Print a SlotIndex to a raw_ostream.
 void SlotIndex::print(raw_ostream &os) const {
-  os << entry().getIndex() << "LudS"[getSlot()];
+  if (isValid())
+    os << entry().getIndex() << "LudS"[getSlot()];
+  else
+    os << "invalid";
 }
 
 // Dump a SlotIndex to stderr.