Added naming to inserted phi copy values - for easy debugging
authorRuchira Sasanka <sasanka@students.uiuc.edu>
Thu, 15 Nov 2001 20:46:40 +0000 (20:46 +0000)
committerRuchira Sasanka <sasanka@students.uiuc.edu>
Thu, 15 Nov 2001 20:46:40 +0000 (20:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1325 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/CodeGen/MachineInstr.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp

index f32165eda1bb407bcda2e5e53ed70a31d77a58bb..f27ad710e0a18c328c746414b8547aa9187f70a7 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Method.h"
 #include "llvm/iOther.h"
 #include "llvm/Target/MachineRegInfo.h"
+#include <string.h>
 
 
 //******************** Internal Data Declarations ************************/
@@ -252,6 +253,11 @@ void InsertCode4AllPhisInMeth(Method *method, TargetMachine &target) {
        Value *PhiCpRes = 
          new Value(PN->getType(), PN->getValueType() );
 
+       string *Name = new string("PhiCp:");
+       (*Name) += (int) PhiCpRes;
+       PhiCpRes->setName( *Name );
+  
+
        // for each incoming value of the phi, insert phi elimination
        //
         for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) {
index 383bd2a32d9ce7175f5a12c48ab576fcca55264e..de77f6ab6cb938cfb629593f8cd23206514848b5 100644 (file)
@@ -95,8 +95,8 @@ operator<< (ostream& os, const MachineInstr& minstr)
   
   for (unsigned i=0, N=minstr.getNumOperands(); i < N; i++) {
     os << "\t" << minstr.getOperand(i);
-    if( minstr.getOperand(i).opIsDef() ) os << "*";
-
+    if( minstr.getOperand(i).opIsDef() ) 
+      os << "*";
   }
   
 #undef DEBUG_VAL_OP_ITERATOR
@@ -122,7 +122,7 @@ operator<< (ostream& os, const MachineInstr& minstr)
     for(unsigned z=0; z < NumOfImpRefs; z++) {
       os << minstr.getImplicitRef(z);
       if( minstr.implicitRefIsDefined(z)) os << "*";
-      cout << "\t";
+      os << "\t";
     }
   }
 
index f32165eda1bb407bcda2e5e53ed70a31d77a58bb..f27ad710e0a18c328c746414b8547aa9187f70a7 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Method.h"
 #include "llvm/iOther.h"
 #include "llvm/Target/MachineRegInfo.h"
+#include <string.h>
 
 
 //******************** Internal Data Declarations ************************/
@@ -252,6 +253,11 @@ void InsertCode4AllPhisInMeth(Method *method, TargetMachine &target) {
        Value *PhiCpRes = 
          new Value(PN->getType(), PN->getValueType() );
 
+       string *Name = new string("PhiCp:");
+       (*Name) += (int) PhiCpRes;
+       PhiCpRes->setName( *Name );
+  
+
        // for each incoming value of the phi, insert phi elimination
        //
         for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) {