diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-28 23:31:42 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-28 23:31:42 +0000 |
commit | d96662360f49f9b94d0faa7ea8dba8582bc1b364 (patch) | |
tree | b372456f8d5b78c0b763666f3dd19cefb5c94c55 /include | |
parent | f45148e113a213b8c91ce34a0b16aa35eb30c77a (diff) |
Support for llvm_ostreams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/BitSetVector.h | 4 | ||||
-rw-r--r-- | include/llvm/ADT/EquivalenceClasses.h | 4 | ||||
-rw-r--r-- | include/llvm/ADT/SCCIterator.h | 8 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSGraph.h | 5 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSNode.h | 3 | ||||
-rw-r--r-- | include/llvm/Assembly/PrintModulePass.h | 14 |
6 files changed, 22 insertions, 16 deletions
diff --git a/include/llvm/ADT/BitSetVector.h b/include/llvm/ADT/BitSetVector.h index 835d2e09b1..67e3a52d6c 100644 --- a/include/llvm/ADT/BitSetVector.h +++ b/include/llvm/ADT/BitSetVector.h @@ -29,7 +29,7 @@ #include <bitset> #include <vector> #include <functional> -#include <iostream> +#include <ostream> namespace llvm { @@ -178,7 +178,7 @@ public: if (O.stream()) print(*O.stream()); } void print(std::ostream &O) const; - void dump() const { print(std::cerr); } + void dump() const { print(llvm_cerr); } public: // diff --git a/include/llvm/ADT/EquivalenceClasses.h b/include/llvm/ADT/EquivalenceClasses.h index da86888395..b915c2aeae 100644 --- a/include/llvm/ADT/EquivalenceClasses.h +++ b/include/llvm/ADT/EquivalenceClasses.h @@ -43,8 +43,8 @@ namespace llvm { /// if (!I->isLeader()) continue; // Ignore non-leader sets. /// for (EquivalenceClasses<int>::member_iterator MI = EC.member_begin(I); /// MI != EC.member_end(); ++MI) // Loop over members in this set. -/// std::cerr << *MI << " "; // Print member. -/// std::cerr << "\n"; // Finish set. +/// llvm_cerr << *MI << " "; // Print member. +/// llvm_cerr << "\n"; // Finish set. /// } /// /// This example prints: diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index cbc4cd64fb..6b1260dd71 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -71,8 +71,8 @@ class scc_iterator SCCNodeStack.push_back(N); MinVisitNumStack.push_back(visitNum); VisitStack.push_back(std::make_pair(N, GT::child_begin(N))); - //DEBUG(std::cerr << "TarjanSCC: Node " << N << - // " : visitNum = " << visitNum << "\n"); + //DOUT << "TarjanSCC: Node " << N << + // " : visitNum = " << visitNum << "\n"; } // The stack-based DFS traversal; defined below. @@ -106,9 +106,9 @@ class scc_iterator if (!MinVisitNumStack.empty() && MinVisitNumStack.back() > minVisitNum) MinVisitNumStack.back() = minVisitNum; - //DEBUG(std::cerr << "TarjanSCC: Popped node " << visitingN << + //DOUT << "TarjanSCC: Popped node " << visitingN << // " : minVisitNum = " << minVisitNum << "; Node visit num = " << - // nodeVisitNumbers[visitingN] << "\n"); + // nodeVisitNumbers[visitingN] << "\n"; if (minVisitNum == nodeVisitNumbers[visitingN]) { // A full SCC is on the SCCNodeStack! It includes all nodes below diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index eb4388b6ad..61853587d7 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -378,9 +378,12 @@ public: /// print - Print a dot graph to the specified ostream... /// + void print(llvm_ostream &O) const { + if (O.stream()) print(*O.stream()); + } void print(std::ostream &O) const; - /// dump - call print(std::cerr), for use from the debugger... + /// dump - call print(llvm_cerr), for use from the debugger... /// void dump() const; diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index 45937a4106..5eb927b90e 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -362,6 +362,9 @@ public: /// void forwardNode(DSNode *To, unsigned Offset); + void print(llvm_ostream &O, const DSGraph *G) const { + if (O.stream()) print(*O.stream(), G); + } void print(std::ostream &O, const DSGraph *G) const; void dump() const; diff --git a/include/llvm/Assembly/PrintModulePass.h b/include/llvm/Assembly/PrintModulePass.h index 2a576d4d51..770682d256 100644 --- a/include/llvm/Assembly/PrintModulePass.h +++ b/include/llvm/Assembly/PrintModulePass.h @@ -20,16 +20,16 @@ #include "llvm/Pass.h" #include "llvm/Module.h" -#include <iostream> +#include "llvm/Support/Streams.h" namespace llvm { class PrintModulePass : public ModulePass { - std::ostream *Out; // ostream to print on + llvm_ostream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintModulePass() : Out(&std::cerr), DeleteStream(false) {} - PrintModulePass(std::ostream *o, bool DS = false) + PrintModulePass() : Out(&llvm_cerr), DeleteStream(false) {} + PrintModulePass(llvm_ostream *o, bool DS = false) : Out(o), DeleteStream(DS) { } @@ -49,11 +49,11 @@ public: class PrintFunctionPass : public FunctionPass { std::string Banner; // String to print before each function - std::ostream *Out; // ostream to print on + llvm_ostream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintFunctionPass() : Banner(""), Out(&std::cerr), DeleteStream(false) {} - PrintFunctionPass(const std::string &B, std::ostream *o = &std::cout, + PrintFunctionPass() : Banner(""), Out(&llvm_cerr), DeleteStream(false) {} + PrintFunctionPass(const std::string &B, llvm_ostream *o = &llvm_cout, bool DS = false) : Banner(B), Out(o), DeleteStream(DS) { } |