[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp LeakDetector.cpp PassManager.cpp TypeSymbolTable.cpp Verifier.cpp

Bill Wendling isanbard at gmail.com
Wed Dec 6 17:32:01 PST 2006



Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.226 -> 1.227
LeakDetector.cpp updated: 1.16 -> 1.17
PassManager.cpp updated: 1.33 -> 1.34
TypeSymbolTable.cpp updated: 1.4 -> 1.5
Verifier.cpp updated: 1.169 -> 1.170
---
Log message:

Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


---
Diffs of the changes:  (+27 -29)

 AsmWriter.cpp       |   10 +++++-----
 LeakDetector.cpp    |   19 +++++++++----------
 PassManager.cpp     |    2 +-
 TypeSymbolTable.cpp |   20 ++++++++++----------
 Verifier.cpp        |    5 ++---
 5 files changed, 27 insertions(+), 29 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.226 llvm/lib/VMCore/AsmWriter.cpp:1.227
--- llvm/lib/VMCore/AsmWriter.cpp:1.226	Wed Dec  6 00:40:49 2006
+++ llvm/lib/VMCore/AsmWriter.cpp	Wed Dec  6 19:30:31 2006
@@ -829,7 +829,7 @@
     case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
     case GlobalValue::ExternalLinkage:     break;
     case GlobalValue::GhostLinkage:
-      llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n";
+      cerr << "GhostLinkage not allowed in AsmWriter!\n";
       abort();
     }
 
@@ -928,7 +928,7 @@
     case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;      
     case GlobalValue::ExternalLinkage: break;
     case GlobalValue::GhostLinkage:
-      llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n";
+      cerr << "GhostLinkage not allowed in AsmWriter!\n";
       abort();
     }
 
@@ -1328,18 +1328,18 @@
 
 // Value::dump - allow easy printing of  Values from the debugger.
 // Located here because so much of the needed functionality is here.
-void Value::dump() const { print(std::cerr); llvm_cerr << '\n'; }
+void Value::dump() const { print(std::cerr); cerr << '\n'; }
 
 // Type::dump - allow easy printing of  Values from the debugger.
 // Located here because so much of the needed functionality is here.
-void Type::dump() const { print(std::cerr); llvm_cerr << '\n'; }
+void Type::dump() const { print(std::cerr); cerr << '\n'; }
 
 //===----------------------------------------------------------------------===//
 //                         SlotMachine Implementation
 //===----------------------------------------------------------------------===//
 
 #if 0
-#define SC_DEBUG(X) llvm_cerr << X
+#define SC_DEBUG(X) cerr << X
 #else
 #define SC_DEBUG(X)
 #endif


Index: llvm/lib/VMCore/LeakDetector.cpp
diff -u llvm/lib/VMCore/LeakDetector.cpp:1.16 llvm/lib/VMCore/LeakDetector.cpp:1.17
--- llvm/lib/VMCore/LeakDetector.cpp:1.16	Mon Nov 27 20:09:03 2006
+++ llvm/lib/VMCore/LeakDetector.cpp	Wed Dec  6 19:30:31 2006
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/LeakDetector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Value.h"
 #include <set>
@@ -21,12 +21,12 @@
 namespace {
   template <class T>
   struct VISIBILITY_HIDDEN PrinterTrait {
-    static void print(const T* P) { llvm_cerr << P; }
+    static void print(const T* P) { cerr << P; }
   };
 
   template<>
   struct VISIBILITY_HIDDEN PrinterTrait<Value> {
-    static void print(const Value* P) { llvm_cerr << *P; }
+    static void print(const Value* P) { cerr << *P; }
   };
 
   template <typename T>
@@ -59,15 +59,14 @@
       assert(Cache == 0 && "No value should be cached anymore!");
 
       if (!Ts.empty()) {
-        llvm_cerr
-            << "Leaked " << Name << " objects found: " << Message << ":\n";
+        cerr << "Leaked " << Name << " objects found: " << Message << ":\n";
         for (typename std::set<const T*>::iterator I = Ts.begin(),
                E = Ts.end(); I != E; ++I) {
-          llvm_cerr << "\t";
+          cerr << "\t";
           PrinterTrait<T>::print(*I);
-          llvm_cerr << "\n";
+          cerr << "\n";
         }
-        llvm_cerr << '\n';
+        cerr << '\n';
 
         return true;
       }
@@ -123,8 +122,8 @@
   // use non-short-circuit version so that both checks are performed
   if (getObjects().hasGarbage(Message) |
       getLLVMObjects().hasGarbage(Message))
-    llvm_cerr << "\nThis is probably because you removed an object, but didn't "
-              << "delete it.  Please check your code for memory leaks.\n";
+    cerr << "\nThis is probably because you removed an object, but didn't "
+         << "delete it.  Please check your code for memory leaks.\n";
 
   // Clear out results so we don't get duplicate warnings on
   // next call...


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.33 llvm/lib/VMCore/PassManager.cpp:1.34
--- llvm/lib/VMCore/PassManager.cpp:1.33	Mon Nov 27 20:09:03 2006
+++ llvm/lib/VMCore/PassManager.cpp	Wed Dec  6 19:30:31 2006
@@ -442,7 +442,7 @@
 bool FunctionPassManager_New::run(Function &F) {
   std::string errstr;
   if (MP->materializeFunction(&F, &errstr)) {
-    llvm_cerr << "Error reading bytecode file: " << errstr << "\n";
+    cerr << "Error reading bytecode file: " << errstr << "\n";
     abort();
   }
   return FPM->runOnFunction(F);


Index: llvm/lib/VMCore/TypeSymbolTable.cpp
diff -u llvm/lib/VMCore/TypeSymbolTable.cpp:1.4 llvm/lib/VMCore/TypeSymbolTable.cpp:1.5
--- llvm/lib/VMCore/TypeSymbolTable.cpp:1.4	Mon Nov 27 20:09:03 2006
+++ llvm/lib/VMCore/TypeSymbolTable.cpp	Wed Dec  6 19:30:31 2006
@@ -66,7 +66,7 @@
 
 #if DEBUG_SYMBOL_TABLE
   dump();
-  llvm_cerr << " Removing Value: " << Result->getName() << "\n";
+  cerr << " Removing Value: " << Result->getName() << "\n";
 #endif
 
   tmap.erase(Entry);
@@ -75,7 +75,7 @@
   // list...
   if (Result->isAbstract()) {
 #if DEBUG_ABSTYPE
-    llvm_cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
+    cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
 #endif
     cast<DerivedType>(Result)->removeAbstractTypeUser(this);
   }
@@ -95,8 +95,8 @@
 
 #if DEBUG_SYMBOL_TABLE
   dump();
-  llvm_cerr << " Inserting type: " << UniqueName << ": "
-            << T->getDescription() << "\n";
+  cerr << " Inserting type: " << UniqueName << ": "
+       << T->getDescription() << "\n";
 #endif
 
   // Insert the tmap entry
@@ -106,7 +106,7 @@
   if (T->isAbstract()) {
     cast<DerivedType>(T)->addAbstractTypeUser(this);
 #if DEBUG_ABSTYPE
-    llvm_cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
+    cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
 #endif
   }
 }
@@ -152,14 +152,14 @@
   for (iterator I = begin(), E = end(); I != E; ++I) {
     if (I->second == (Type*)OldType) {  // FIXME when Types aren't const.
 #if DEBUG_ABSTYPE
-      llvm_cerr << "Removing type " << OldType->getDescription() << "\n";
+      cerr << "Removing type " << OldType->getDescription() << "\n";
 #endif
       OldType->removeAbstractTypeUser(this);
 
       I->second = (Type*)NewType;  // TODO FIXME when types aren't const
       if (NewType->isAbstract()) {
 #if DEBUG_ABSTYPE
-        llvm_cerr << "Added type " << NewType->getDescription() << "\n";
+        cerr << "Added type " << NewType->getDescription() << "\n";
 #endif
         cast<DerivedType>(NewType)->addAbstractTypeUser(this);
       }
@@ -179,13 +179,13 @@
 }
 
 static void DumpTypes(const std::pair<const std::string, const Type*>& T ) {
-  llvm_cerr << "  '" << T.first << "' = ";
+  cerr << "  '" << T.first << "' = ";
   T.second->dump();
-  llvm_cerr << "\n";
+  cerr << "\n";
 }
 
 void TypeSymbolTable::dump() const {
-  llvm_cerr << "TypeSymbolPlane: ";
+  cerr << "TypeSymbolPlane: ";
   for_each(tmap.begin(), tmap.end(), DumpTypes);
 }
 


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.169 llvm/lib/VMCore/Verifier.cpp:1.170
--- llvm/lib/VMCore/Verifier.cpp:1.169	Wed Dec  6 00:16:21 2006
+++ llvm/lib/VMCore/Verifier.cpp	Wed Dec  6 19:30:31 2006
@@ -60,7 +60,6 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Compiler.h"
 #include <algorithm>
-#include <sstream>
 #include <cstdarg>
 using namespace llvm;
 
@@ -156,11 +155,11 @@
         switch (action) {
           case AbortProcessAction:
             msgs << "compilation aborted!\n";
-            llvm_cerr << msgs.str();
+            cerr << msgs.str();
             abort();
           case PrintMessageAction:
             msgs << "verification continues.\n";
-            llvm_cerr << msgs.str();
+            cerr << msgs.str();
             return false;
           case ReturnStatusAction:
             msgs << "compilation terminated.\n";






More information about the llvm-commits mailing list