* Code Cleanups
* Introduce RAV to allow stream I/O instead of using printValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1710 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index f35af9e..6e2c1b0 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -563,11 +563,8 @@
 
     // not possible to have a null LR since all args (even consts)  
     // must be defined before
-    if( !LR ) {          
-      if( DEBUG_RA) {
-	cerr << " ERROR: In call instr, no LR for arg:  " ;
-	printValue(CallArg); cerr << "\n";
-      }
+    if (!LR) {          
+      cerr << " ERROR: In call instr, no LR for arg: " << RAV(CallArg) << "\n";
       assert(0 && "NO LR for call arg");  
     }
     
@@ -624,16 +621,12 @@
 
   const Value *RetVal = getCallInstRetVal( CallMI );
 
-  if( RetVal ) {
+  if (RetVal) {
+    LiveRange *RetValLR = LRI.getLiveRangeForValue( RetVal );
 
-    LiveRange * RetValLR = LRI.getLiveRangeForValue( RetVal );
-
-    if( !RetValLR ) {
-      cerr << "\nNo LR for:";
-      printValue( RetVal );
-      cerr << "\n";
-      assert( RetValLR && "ERR:No LR for non-void return value");
-      //return;
+    if (!RetValLR) {
+      cerr << "\nNo LR for:" << RAV(RetVal) << "\n";
+      assert(0 && "ERR:No LR for non-void return value");
     }
 
     unsigned RegClassID = (RetValLR->getRegClass())->getID();    
@@ -755,13 +748,9 @@
 
     // not possible to have a null LR since all args (even consts)  
     // must be defined before
-    if( !LR ) {          
-      if( DEBUG_RA) {
-	cerr << " ERROR: In call instr, no LR for arg:  " ;
-	printValue(CallArg); cerr << "\n";
-      }
+    if (!LR) {          
+      cerr << " ERROR: In call instr, no LR for arg:  " << RAV(CallArg) << "\n";
       assert(0 && "NO LR for call arg");  
-      // continue;
     }
 
 
@@ -942,13 +931,10 @@
 
     LiveRange *const LR = LRI.getLiveRangeForValue( RetVal ); 
 
-    if( !LR ) {
-     cerr << "\nNo LR for:";
-     printValue( RetVal );
-     cerr << "\n";
-     assert( LR && "No LR for return value of non-void method");
-     //return;
-   }
+    if (!LR) {
+      cerr << "\nNo LR for:" << RAV(RetVal) << "\n";
+      assert(0 && "No LR for return value of non-void method");
+    }
 
     unsigned RegClassID = (LR->getRegClass())->getID();
       
@@ -981,12 +967,10 @@
 
     LiveRange *LR = LRI.getLiveRangeForValue(RetVal); 
 
-    if( ! LR ) {
-	cerr << "\nNo LR for:";
-	printValue( RetVal );
-	cerr << "\n";
-	// assert( LR && "No LR for return value of non-void method");
-	return;
+    if (!LR) {
+      cerr << "\nNo LR for:" << RAV(RetVal) << "\n";
+      // assert( LR && "No LR for return value of non-void method");
+      return;
     }
 
     unsigned RegClassID =  getRegClassIDOfValue(RetVal);