Skip to content

Commit f3baad3

Browse files
committed
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp. llvm-svn: 32298
1 parent d8e7451 commit f3baad3

File tree

111 files changed

+1843
-1678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1843
-1678
lines changed

llvm/examples/ModuleMaker/ModuleMaker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main() {
5353
BB->getInstList().push_back(new ReturnInst(Add));
5454

5555
// Output the bytecode file to stdout
56-
WriteBytecodeToFile(M, llvm_cout);
56+
WriteBytecodeToFile(M, cout);
5757

5858
// Delete the module and all of its contents.
5959
delete M;

llvm/include/llvm/ADT/BitSetVector.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <bitset>
3030
#include <vector>
3131
#include <functional>
32-
#include <ostream>
3332

3433
namespace llvm {
3534

@@ -174,11 +173,11 @@ class BitSetVector {
174173
///
175174
/// Printing and debugging support
176175
///
177-
void print(llvm_ostream &O) const {
176+
void print(OStream &O) const {
178177
if (O.stream()) print(*O.stream());
179178
}
180179
void print(std::ostream &O) const;
181-
void dump() const { print(llvm_cerr); }
180+
void dump() const { print(cerr); }
182181

183182
public:
184183
//
@@ -235,6 +234,9 @@ class BitSetVector {
235234
return (I.bitvec == bitvec &&
236235
I.currentWord == currentWord && I.currentBit == currentBit);
237236
}
237+
bool operator!=(const iterator& I) {
238+
return !(*this == I);
239+
}
238240

239241
protected:
240242
static iterator begin(BitSetVector& _bitvec) { return iterator(_bitvec); }
@@ -252,7 +254,7 @@ inline void BitSetVector::print(std::ostream& O) const
252254
O << "<" << (*I) << ">" << (I+1 == E? "\n" : ", ");
253255
}
254256

255-
inline llvm_ostream& operator<< (llvm_ostream& O, const BitSetVector& bset) {
257+
inline OStream& operator<< (OStream& O, const BitSetVector& bset) {
256258
bset.print(O);
257259
return O;
258260
}

llvm/include/llvm/ADT/EquivalenceClasses.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ namespace llvm {
4343
/// if (!I->isLeader()) continue; // Ignore non-leader sets.
4444
/// for (EquivalenceClasses<int>::member_iterator MI = EC.member_begin(I);
4545
/// MI != EC.member_end(); ++MI) // Loop over members in this set.
46-
/// llvm_cerr << *MI << " "; // Print member.
47-
/// llvm_cerr << "\n"; // Finish set.
46+
/// cerr << *MI << " "; // Print member.
47+
/// cerr << "\n"; // Finish set.
4848
/// }
4949
///
5050
/// This example prints:

llvm/include/llvm/Analysis/AliasSetTracker.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class AliasSet {
156156
iterator end() const { return iterator(); }
157157
bool empty() const { return PtrList == 0; }
158158

159-
void print(llvm_ostream &OS) const {
159+
void print(OStream &OS) const {
160160
if (OS.stream()) print(*OS.stream());
161161
}
162162
void print(std::ostream &OS) const;
@@ -248,7 +248,7 @@ class AliasSet {
248248
bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
249249
};
250250

251-
inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSet &AS) {
251+
inline OStream& operator<<(OStream &OS, const AliasSet &AS) {
252252
AS.print(OS);
253253
return OS;
254254
}
@@ -361,7 +361,7 @@ class AliasSetTracker {
361361
iterator begin() { return AliasSets.begin(); }
362362
iterator end() { return AliasSets.end(); }
363363

364-
void print(llvm_ostream &OS) const {
364+
void print(OStream &OS) const {
365365
if (OS.stream()) print(*OS.stream());
366366
}
367367
void print(std::ostream &OS) const;
@@ -390,7 +390,7 @@ class AliasSetTracker {
390390
AliasSet *findAliasSetForCallSite(CallSite CS);
391391
};
392392

393-
inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSetTracker &AST) {
393+
inline OStream& operator<<(OStream &OS, const AliasSetTracker &AST) {
394394
AST.print(OS);
395395
return OS;
396396
}

llvm/include/llvm/Analysis/CallGraph.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class CallGraph {
152152
///
153153
void initialize(Module &M);
154154

155-
void print(llvm_ostream &o, const Module *M) const {
155+
void print(OStream &o, const Module *M) const {
156156
if (o.stream()) print(*o.stream(), M);
157157
}
158158
virtual void print(std::ostream &o, const Module *M) const;
@@ -201,7 +201,7 @@ class CallGraphNode {
201201
/// dump - Print out this call graph node.
202202
///
203203
void dump() const;
204-
void print(llvm_ostream &OS) const {
204+
void print(OStream &OS) const {
205205
if (OS.stream()) print(*OS.stream());
206206
}
207207
void print(std::ostream &OS) const;

llvm/include/llvm/Analysis/DataStructure/DSGraph.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,12 @@ class DSGraph {
378378

379379
/// print - Print a dot graph to the specified ostream...
380380
///
381-
void print(llvm_ostream &O) const {
381+
void print(OStream &O) const {
382382
if (O.stream()) print(*O.stream());
383383
}
384384
void print(std::ostream &O) const;
385385

386-
/// dump - call print(llvm_cerr), for use from the debugger...
386+
/// dump - call print(cerr), for use from the debugger...
387387
///
388388
void dump() const;
389389

llvm/include/llvm/Analysis/DataStructure/DSNode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class DSNode {
362362
///
363363
void forwardNode(DSNode *To, unsigned Offset);
364364

365-
void print(llvm_ostream &O, const DSGraph *G) const {
365+
void print(OStream &O, const DSGraph *G) const {
366366
if (O.stream()) print(*O.stream(), G);
367367
}
368368
void print(std::ostream &O, const DSGraph *G) const;

llvm/include/llvm/Analysis/LoopInfo.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class Loop {
217217
/// the mapping in the LoopInfo class.
218218
void removeBlockFromLoop(BasicBlock *BB);
219219

220-
void print(llvm_ostream &O, unsigned Depth = 0) const {
220+
void print(OStream &O, unsigned Depth = 0) const {
221221
if (O.stream()) print(*O.stream(), Depth);
222222
}
223223
void print(std::ostream &O, unsigned Depth = 0) const;
@@ -283,7 +283,7 @@ class LoopInfo : public FunctionPass {
283283
virtual bool runOnFunction(Function &F);
284284

285285
virtual void releaseMemory();
286-
void print(llvm_ostream &O, const Module* = 0) const {
286+
void print(OStream &O, const Module* = 0) const {
287287
if (O.stream()) print(*O.stream());
288288
}
289289
void print(std::ostream &O, const Module* = 0) const;

llvm/include/llvm/Analysis/ScalarEvolution.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace llvm {
9797
/// print - Print out the internal representation of this scalar to the
9898
/// specified stream. This should really only be used for debugging
9999
/// purposes.
100-
void print(llvm_ostream &OS) const {
100+
void print(OStream &OS) const {
101101
if (OS.stream()) print(*OS.stream());
102102
}
103103
virtual void print(std::ostream &OS) const = 0;
@@ -107,7 +107,7 @@ namespace llvm {
107107
void dump() const;
108108
};
109109

110-
inline llvm_ostream &operator<<(llvm_ostream &OS, const SCEV &S) {
110+
inline OStream &operator<<(OStream &OS, const SCEV &S) {
111111
S.print(OS);
112112
return OS;
113113
}
@@ -128,7 +128,7 @@ namespace llvm {
128128
virtual bool isLoopInvariant(const Loop *L) const;
129129
virtual const Type *getType() const;
130130
virtual bool hasComputableLoopEvolution(const Loop *L) const;
131-
void print(llvm_ostream &OS) const {
131+
void print(OStream &OS) const {
132132
if (OS.stream()) print(*OS.stream());
133133
}
134134
virtual void print(std::ostream &OS) const;
@@ -242,7 +242,7 @@ namespace llvm {
242242
virtual bool runOnFunction(Function &F);
243243
virtual void releaseMemory();
244244
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
245-
void print(llvm_ostream &OS, const Module* = 0) const {
245+
void print(OStream &OS, const Module* = 0) const {
246246
if (OS.stream()) print(*OS.stream());
247247
}
248248
virtual void print(std::ostream &OS, const Module* = 0) const;

llvm/include/llvm/Analysis/Trace.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#ifndef LLVM_ANALYSIS_TRACE_H
1919
#define LLVM_ANALYSIS_TRACE_H
2020

21+
#include "llvm/Support/Streams.h"
2122
#include <vector>
2223
#include <cassert>
2324

2425
namespace llvm {
25-
class llvm_ostream;
2626
class BasicBlock;
2727
class Function;
2828
class Module;
@@ -106,7 +106,7 @@ class Trace {
106106

107107
/// print - Write trace to output stream.
108108
///
109-
void print (llvm_ostream &O) const;
109+
void print (OStream &O) const;
110110

111111
/// dump - Debugger convenience method; writes trace to standard error
112112
/// output stream.

llvm/include/llvm/Assembly/PrintModulePass.h

+8-10
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
namespace llvm {
2626

2727
class PrintModulePass : public ModulePass {
28-
llvm_ostream *Out; // ostream to print on
28+
OStream *Out; // ostream to print on
2929
bool DeleteStream; // Delete the ostream in our dtor?
3030
public:
31-
PrintModulePass() : Out(&llvm_cerr), DeleteStream(false) {}
32-
PrintModulePass(llvm_ostream *o, bool DS = false)
33-
: Out(o), DeleteStream(DS) {
34-
}
31+
PrintModulePass() : Out(&cerr), DeleteStream(false) {}
32+
PrintModulePass(OStream *o, bool DS = false)
33+
: Out(o), DeleteStream(DS) {}
3534

3635
~PrintModulePass() {
3736
if (DeleteStream) delete Out;
@@ -49,14 +48,13 @@ class PrintModulePass : public ModulePass {
4948

5049
class PrintFunctionPass : public FunctionPass {
5150
std::string Banner; // String to print before each function
52-
llvm_ostream *Out; // ostream to print on
51+
OStream *Out; // ostream to print on
5352
bool DeleteStream; // Delete the ostream in our dtor?
5453
public:
55-
PrintFunctionPass() : Banner(""), Out(&llvm_cerr), DeleteStream(false) {}
56-
PrintFunctionPass(const std::string &B, llvm_ostream *o = &llvm_cout,
54+
PrintFunctionPass() : Banner(""), Out(&cerr), DeleteStream(false) {}
55+
PrintFunctionPass(const std::string &B, OStream *o = &cout,
5756
bool DS = false)
58-
: Banner(B), Out(o), DeleteStream(DS) {
59-
}
57+
: Banner(B), Out(o), DeleteStream(DS) {}
6058

6159
inline ~PrintFunctionPass() {
6260
if (DeleteStream) delete Out;

llvm/include/llvm/Bytecode/WriteBytecodePass.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@
1717

1818
#include "llvm/Pass.h"
1919
#include "llvm/Bytecode/Writer.h"
20+
#include "llvm/Support/Streams.h"
2021

2122
namespace llvm {
2223

23-
class llvm_ostream;
24-
2524
class WriteBytecodePass : public ModulePass {
26-
llvm_ostream *Out; // ostream to print on
25+
OStream *Out; // ostream to print on
2726
bool DeleteStream;
2827
bool CompressFile;
2928
public:
3029
WriteBytecodePass()
31-
: Out(&llvm_cout), DeleteStream(false), CompressFile(true) {}
32-
WriteBytecodePass(llvm_ostream *o, bool DS = false, bool CF = true)
30+
: Out(&cout), DeleteStream(false), CompressFile(true) {}
31+
WriteBytecodePass(OStream *o, bool DS = false, bool CF = true)
3332
: Out(o), DeleteStream(DS), CompressFile(CF) {}
3433

3534
inline ~WriteBytecodePass() {

llvm/include/llvm/Bytecode/Writer.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
#ifndef LLVM_BYTECODE_WRITER_H
1616
#define LLVM_BYTECODE_WRITER_H
1717

18+
#include "llvm/Support/Streams.h"
19+
1820
namespace llvm {
19-
class llvm_ostream;
2021
class Module;
2122
/// WriteBytecodeToFile - Write the specified module to the specified output
2223
/// stream. If compress is set to true, try to use compression when writing
2324
/// out the file. This can never fail if M is a well-formed module.
24-
void WriteBytecodeToFile(const Module *M, llvm_ostream &Out,
25+
void WriteBytecodeToFile(const Module *M, OStream &Out,
2526
bool compress = true);
2627
} // End llvm namespace
2728

llvm/include/llvm/CodeGen/LiveInterval.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace llvm {
6262
};
6363

6464
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
65-
inline llvm_ostream& operator<<(llvm_ostream& os, const LiveRange &LR) {
65+
inline OStream& operator<<(OStream& os, const LiveRange &LR) {
6666
if (os.stream()) *os.stream() << LR;
6767
return os;
6868
}
@@ -258,9 +258,9 @@ namespace llvm {
258258
return beginNumber() < other.beginNumber();
259259
}
260260

261-
void print(llvm_ostream OS, const MRegisterInfo *MRI = 0) const;
261+
void print(OStream OS, const MRegisterInfo *MRI = 0) const;
262262
void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const {
263-
print(llvm_ostream(OS), MRI);
263+
print(OStream(OS), MRI);
264264
}
265265
void dump() const;
266266

@@ -271,7 +271,7 @@ namespace llvm {
271271
LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
272272
};
273273

274-
inline llvm_ostream &operator<<(llvm_ostream &OS, const LiveInterval &LI) {
274+
inline OStream &operator<<(OStream &OS, const LiveInterval &LI) {
275275
LI.print(OS);
276276
return OS;
277277
}

llvm/include/llvm/CodeGen/MachineBasicBlock.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class MachineBasicBlock {
189189

190190
// Debugging methods.
191191
void dump() const;
192-
void print(llvm_ostream &OS) const {
192+
void print(OStream &OS) const {
193193
if (OS.stream()) print(*OS.stream());
194194
}
195195
void print(std::ostream &OS) const;
@@ -226,7 +226,7 @@ class MachineBasicBlock {
226226
};
227227

228228
std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB);
229-
inline llvm_ostream& operator<<(llvm_ostream &OS, const MachineBasicBlock &MBB){
229+
inline OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB){
230230
if (OS.stream()) *OS.stream() << MBB;
231231
return OS;
232232
}

llvm/include/llvm/CodeGen/MachineConstantPool.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class MachineConstantPoolValue {
4949

5050
/// print - Implement operator<<...
5151
///
52-
void print(llvm_ostream &O) const {
52+
void print(OStream &O) const {
5353
if (O.stream()) print(*O.stream());
5454
}
5555
virtual void print(std::ostream &O) const = 0;
5656
};
5757

58-
inline llvm_ostream &operator<<(llvm_ostream &OS,
59-
const MachineConstantPoolValue &V) {
58+
inline OStream &operator<<(OStream &OS,
59+
const MachineConstantPoolValue &V) {
6060
V.print(OS);
6161
return OS;
6262
}
@@ -143,7 +143,7 @@ class MachineConstantPool {
143143
/// print - Used by the MachineFunction printer to print information about
144144
/// constant pool objects. Implemented in MachineFunction.cpp
145145
///
146-
void print(llvm_ostream &OS) const {
146+
void print(OStream &OS) const {
147147
if (OS.stream()) print(*OS.stream());
148148
}
149149
void print(std::ostream &OS) const;

llvm/include/llvm/CodeGen/MachineInstr.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ struct MachineOperand {
285285
IsDead = false;
286286
}
287287

288-
friend llvm_ostream& operator<<(llvm_ostream& os, const MachineOperand& mop) {
288+
friend OStream& operator<<(OStream& os, const MachineOperand& mop) {
289289
if (os.stream()) *os.stream() << mop;
290290
return os;
291291
}
@@ -397,12 +397,12 @@ class MachineInstr {
397397
//
398398
// Debugging support
399399
//
400-
void print(llvm_ostream &OS, const TargetMachine *TM) const {
400+
void print(OStream &OS, const TargetMachine *TM) const {
401401
if (OS.stream()) print(*OS.stream(), TM);
402402
}
403403
void print(std::ostream &OS, const TargetMachine *TM) const;
404404
void dump() const;
405-
friend llvm_ostream& operator<<(llvm_ostream& os, const MachineInstr& minstr){
405+
friend OStream& operator<<(OStream& os, const MachineInstr& minstr){
406406
if (os.stream()) *os.stream() << minstr;
407407
return os;
408408
}

0 commit comments

Comments
 (0)