[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp LevelRaise.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 1 17:16:15 PDT 2003


Changes in directory llvm/lib/Transforms:

ExprTypeConvert.cpp updated: 1.75 -> 1.76
LevelRaise.cpp updated: 1.83 -> 1.84

---
Log message:

DEBUG got moved to Support/Debug.h



---
Diffs of the changes:

Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.75 llvm/lib/Transforms/ExprTypeConvert.cpp:1.76
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.75	Thu Jul 24 12:31:56 2003
+++ llvm/lib/Transforms/ExprTypeConvert.cpp	Fri Aug  1 17:15:00 2003
@@ -13,7 +13,7 @@
 #include "llvm/ConstantHandling.h"
 #include "llvm/Analysis/Expressions.h"
 #include "Support/STLExtras.h"
-#include "Support/Statistic.h"
+#include "Support/Debug.h"
 #include <algorithm>
 using std::cerr;
 


Index: llvm/lib/Transforms/LevelRaise.cpp
diff -u llvm/lib/Transforms/LevelRaise.cpp:1.83 llvm/lib/Transforms/LevelRaise.cpp:1.84
--- llvm/lib/Transforms/LevelRaise.cpp:1.83	Tue May 20 16:01:14 2003
+++ llvm/lib/Transforms/LevelRaise.cpp	Fri Aug  1 17:15:00 2003
@@ -16,11 +16,11 @@
 #include "llvm/Analysis/Expressions.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "Support/STLExtras.h"
-#include "Support/Statistic.h"
 #include "Support/CommandLine.h"
+#include "Support/Debug.h"
+#include "Support/Statistic.h"
+#include "Support/STLExtras.h"
 #include <algorithm>
-using std::cerr;
 
 // StartInst - This enables the -raise-start-inst=foo option to cause the level
 // raising pass to start at instruction "foo", which is immensely useful for
@@ -274,7 +274,7 @@
       if (ExpressionConvertibleToType(Src, DestTy, ConvertedTypes, TD)) {
         PRINT_PEEPHOLE3("CAST-SRC-EXPR-CONV:in ", Src, CI, BB->getParent());
           
-        DEBUG(cerr << "\nCONVERTING SRC EXPR TYPE:\n");
+        DEBUG(std::cerr << "\nCONVERTING SRC EXPR TYPE:\n");
         { // ValueMap must be destroyed before function verified!
           ValueMapCache ValueMap;
           Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD);
@@ -283,7 +283,8 @@
             CI->replaceAllUsesWith(CPV);
           
           PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", E);
-          DEBUG(cerr << "DONE CONVERTING SRC EXPR TYPE: \n" << BB->getParent());
+          DEBUG(std::cerr << "DONE CONVERTING SRC EXPR TYPE: \n"
+                          << BB->getParent());
         }
 
         DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
@@ -302,14 +303,14 @@
       if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) {
         PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent());
 
-        DEBUG(cerr << "\nCONVERTING EXPR TYPE:\n");
+        DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n");
         { // ValueMap must be destroyed before function verified!
           ValueMapCache ValueMap;
           ConvertValueToNewType(CI, Src, ValueMap, TD);  // This will delete CI!
         }
 
         PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src);
-        DEBUG(cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent());
+        DEBUG(std::cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent());
 
         DEBUG(assert(verifyFunction(*BB->getParent()) == false &&
                      "Function broken!"));
@@ -556,11 +557,11 @@
   bool Changed = false;
   for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB)
     for (BasicBlock::iterator BI = BB->begin(); BI != BB->end();) {
-      DEBUG(cerr << "Processing: " << *BI);
+      DEBUG(std::cerr << "Processing: " << *BI);
       if (dceInstruction(BI) || doConstantPropagation(BI)) {
         Changed = true; 
         ++NumDCEorCP;
-        DEBUG(cerr << "***\t\t^^-- Dead code eliminated!\n");
+        DEBUG(std::cerr << "***\t\t^^-- Dead code eliminated!\n");
       } else if (PeepholeOptimize(BB, BI)) {
         Changed = true;
       } else {
@@ -574,7 +575,8 @@
 
 // runOnFunction - Raise a function representation to a higher level.
 bool RPR::runOnFunction(Function &F) {
-  DEBUG(cerr << "\n\n\nStarting to work on Function '" << F.getName() << "'\n");
+  DEBUG(std::cerr << "\n\n\nStarting to work on Function '" << F.getName()
+                  << "'\n");
 
   // Insert casts for all incoming pointer pointer values that are treated as
   // arrays...
@@ -596,7 +598,7 @@
   }
 
   do {
-    DEBUG(cerr << "Looping: \n" << F);
+    DEBUG(std::cerr << "Looping: \n" << F);
 
     // Iterate over the function, refining it, until it converges on a stable
     // state





More information about the llvm-commits mailing list