mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Support for llvm_ostreams.
llvm-svn: 31988
This commit is contained in:
parent
e46a408fb9
commit
5def3648f4
@ -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:
|
||||
//
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user