diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-12-07 01:30:32 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-12-07 01:30:32 +0000 |
commit | e81561909d128c6e2d8033cb5465a49b2596b26a (patch) | |
tree | 6f2845604d482bc86d8d12aae500292c561d8cd7 /lib/CodeGen | |
parent | 85c671b90870705ba7e10baf99aa306c843f1325 (diff) | |
download | external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.zip external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.gz external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.bz2 |
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 37 | ||||
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 16 | ||||
-rw-r--r-- | lib/CodeGen/ELFWriter.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 24 | ||||
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 4 |
9 files changed, 51 insertions, 57 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 1b25b01..4caa2c1 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -25,7 +25,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" -#include <ostream> #include <cerrno> using namespace llvm; @@ -668,8 +667,8 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, const char *Code) { if (LastMI != MI) { ++Counter; LastMI = MI; } O << Counter; } else { - llvm_cerr << "Unknown special formatter '" << Code - << "' for machine instr: " << *MI; + cerr << "Unknown special formatter '" << Code + << "' for machine instr: " << *MI; exit(1); } } @@ -737,8 +736,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { case '(': // $( -> same as GCC's { character. ++LastEmitted; // Consume '(' character. if (CurVariant != -1) { - llvm_cerr << "Nested variants found in inline asm string: '" - << AsmStr << "'\n"; + cerr << "Nested variants found in inline asm string: '" + << AsmStr << "'\n"; exit(1); } CurVariant = 0; // We're in the first variant now. @@ -746,8 +745,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { case '|': ++LastEmitted; // consume '|' character. if (CurVariant == -1) { - llvm_cerr << "Found '|' character outside of variant in inline asm " - << "string: '" << AsmStr << "'\n"; + cerr << "Found '|' character outside of variant in inline asm " + << "string: '" << AsmStr << "'\n"; exit(1); } ++CurVariant; // We're in the next variant. @@ -755,8 +754,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { case ')': // $) -> same as GCC's } char. ++LastEmitted; // consume ')' character. if (CurVariant == -1) { - llvm_cerr << "Found '}' character outside of variant in inline asm " - << "string: '" << AsmStr << "'\n"; + cerr << "Found '}' character outside of variant in inline asm " + << "string: '" << AsmStr << "'\n"; exit(1); } CurVariant = -1; @@ -774,8 +773,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { char *IDEnd; long Val = strtol(IDStart, &IDEnd, 10); // We only accept numbers for IDs. if (!isdigit(*IDStart) || (Val == 0 && errno == EINVAL)) { - llvm_cerr << "Bad $ operand number in inline asm string: '" - << AsmStr << "'\n"; + cerr << "Bad $ operand number in inline asm string: '" + << AsmStr << "'\n"; exit(1); } LastEmitted = IDEnd; @@ -788,8 +787,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { if (*LastEmitted == ':') { ++LastEmitted; // Consume ':' character. if (*LastEmitted == 0) { - llvm_cerr << "Bad ${:} expression in inline asm string: '" - << AsmStr << "'\n"; + cerr << "Bad ${:} expression in inline asm string: '" + << AsmStr << "'\n"; exit(1); } @@ -798,16 +797,16 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { } if (*LastEmitted != '}') { - llvm_cerr << "Bad ${} expression in inline asm string: '" - << AsmStr << "'\n"; + cerr << "Bad ${} expression in inline asm string: '" + << AsmStr << "'\n"; exit(1); } ++LastEmitted; // Consume '}' character. } if ((unsigned)Val >= NumOperands-1) { - llvm_cerr << "Invalid $ operand number in inline asm string: '" - << AsmStr << "'\n"; + cerr << "Invalid $ operand number in inline asm string: '" + << AsmStr << "'\n"; exit(1); } @@ -841,8 +840,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { } } if (Error) { - llvm_cerr << "Invalid operand found in inline asm: '" - << AsmStr << "'\n"; + cerr << "Invalid operand found in inline asm: '" + << AsmStr << "'\n"; MI->dump(); exit(1); } diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index ac6987b..8f62396 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -31,10 +31,8 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetFrameInfo.h" - #include <ostream> #include <string> - using namespace llvm; using namespace llvm::dwarf; @@ -139,7 +137,7 @@ public: } #ifndef NDEBUG - void print(llvm_ostream &O) const { + void print(OStream &O) const { if (O.stream()) print(*O.stream()); } void print(std::ostream &O) const { @@ -247,7 +245,7 @@ public: void Emit(const Dwarf &DW) const; #ifndef NDEBUG - void print(llvm_ostream &O) { + void print(OStream &O) { if (O.stream()) print(*O.stream()); } void print(std::ostream &O); @@ -337,7 +335,7 @@ public: void Profile(FoldingSetNodeID &ID) ; #ifndef NDEBUG - void print(llvm_ostream &O, unsigned IncIndent = 0) { + void print(OStream &O, unsigned IncIndent = 0) { if (O.stream()) print(*O.stream(), IncIndent); } void print(std::ostream &O, unsigned IncIndent = 0); @@ -388,7 +386,7 @@ public: virtual void Profile(FoldingSetNodeID &ID) = 0; #ifndef NDEBUG - void print(llvm_ostream &O) { + void print(OStream &O) { if (O.stream()) print(*O.stream()); } virtual void print(std::ostream &O) = 0; @@ -2861,14 +2859,14 @@ void DIEAbbrev::print(std::ostream &O) { << "\n"; } } -void DIEAbbrev::dump() { print(llvm_cerr); } +void DIEAbbrev::dump() { print(cerr); } #endif //===----------------------------------------------------------------------===// #ifndef NDEBUG void DIEValue::dump() { - print(llvm_cerr); + print(cerr); } #endif @@ -3079,7 +3077,7 @@ void DIE::print(std::ostream &O, unsigned IncIndent) { } void DIE::dump() { - print(llvm_cerr); + print(cerr); } #endif diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp index 702102f..ee9cecd 100644 --- a/lib/CodeGen/ELFWriter.cpp +++ b/lib/CodeGen/ELFWriter.cpp @@ -39,7 +39,6 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/Streams.h" -#include <ostream> using namespace llvm; //===----------------------------------------------------------------------===// @@ -104,9 +103,9 @@ void ELFCodeEmitter::startFunction(MachineFunction &F) { ELFWriter::ELFSection::SHF_EXECINSTR | ELFWriter::ELFSection::SHF_ALLOC); OutBuffer = &ES->SectionData; - llvm_cerr << "FIXME: This code needs to be updated for changes in the" - << " CodeEmitter interfaces. In particular, this should set " - << "BufferBegin/BufferEnd/CurBufferPtr, not deal with OutBuffer!"; + cerr << "FIXME: This code needs to be updated for changes in the" + << " CodeEmitter interfaces. In particular, this should set " + << "BufferBegin/BufferEnd/CurBufferPtr, not deal with OutBuffer!"; abort(); // Upgrade the section alignment if required. diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index d70a277..753f459 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -274,12 +274,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { switch (Callee->getIntrinsicID()) { case Intrinsic::not_intrinsic: - llvm_cerr << "Cannot lower a call to a non-intrinsic function '" - << Callee->getName() << "'!\n"; + cerr << "Cannot lower a call to a non-intrinsic function '" + << Callee->getName() << "'!\n"; abort(); default: - llvm_cerr << "Error: Code generator does not support intrinsic function '" - << Callee->getName() << "'!\n"; + cerr << "Error: Code generator does not support intrinsic function '" + << Callee->getName() << "'!\n"; abort(); // The setjmp/longjmp intrinsics should only exist in the code if it was @@ -356,9 +356,9 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::stackrestore: { static bool Warned = false; if (!Warned) - llvm_cerr << "WARNING: this target does not support the llvm.stack" - << (Callee->getIntrinsicID() == Intrinsic::stacksave ? - "save" : "restore") << " intrinsic.\n"; + cerr << "WARNING: this target does not support the llvm.stack" + << (Callee->getIntrinsicID() == Intrinsic::stacksave ? + "save" : "restore") << " intrinsic.\n"; Warned = true; if (Callee->getIntrinsicID() == Intrinsic::stacksave) CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); @@ -367,9 +367,9 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::returnaddress: case Intrinsic::frameaddress: - llvm_cerr << "WARNING: this target does not support the llvm." - << (Callee->getIntrinsicID() == Intrinsic::returnaddress ? - "return" : "frame") << "address intrinsic.\n"; + cerr << "WARNING: this target does not support the llvm." + << (Callee->getIntrinsicID() == Intrinsic::returnaddress ? + "return" : "frame") << "address intrinsic.\n"; CI->replaceAllUsesWith(ConstantPointerNull::get( cast<PointerType>(CI->getType()))); break; @@ -380,8 +380,8 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::pcmarker: break; // Simply strip out pcmarker on unsupported architectures case Intrinsic::readcyclecounter: { - llvm_cerr << "WARNING: this target does not support the llvm.readcyclecoun" - << "ter intrinsic. It is being lowered to a constant 0\n"; + cerr << "WARNING: this target does not support the llvm.readcyclecoun" + << "ter intrinsic. It is being lowered to a constant 0\n"; CI->replaceAllUsesWith(ConstantInt::get(Type::ULongTy, 0)); break; } diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index d178a6f..e2a3bba 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -23,7 +23,6 @@ #include "llvm/Support/Streams.h" #include "llvm/Target/MRegisterInfo.h" #include <algorithm> -#include <iostream> #include <map> using namespace llvm; @@ -472,10 +471,10 @@ std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) { } void LiveRange::dump() const { - llvm_cerr << *this << "\n"; + cerr << *this << "\n"; } -void LiveInterval::print(llvm_ostream OS, const MRegisterInfo *MRI) const { +void LiveInterval::print(OStream OS, const MRegisterInfo *MRI) const { if (MRI && MRegisterInfo::isPhysicalRegister(reg)) OS << MRI->getName(reg); else @@ -508,5 +507,5 @@ void LiveInterval::print(llvm_ostream OS, const MRegisterInfo *MRI) const { } void LiveInterval::dump() const { - llvm_cerr << *this << "\n"; + cerr << *this << "\n"; } diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index eeabbd1..2175d35 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -419,9 +419,9 @@ addIntervalsForSpills(const LiveInterval &li, VirtRegMap &vrm, int slot) { void LiveIntervals::printRegName(unsigned reg) const { if (MRegisterInfo::isPhysicalRegister(reg)) - llvm_cerr << mri_->getName(reg); + cerr << mri_->getName(reg); else - llvm_cerr << "%reg" << reg; + cerr << "%reg" << reg; } /// isReDefinedByTwoAddr - Returns true if the Reg re-definition is due to diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 04bd265..716b40f 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -18,7 +18,6 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/Streams.h" -#include <iostream> using namespace llvm; /// MachineInstr ctor - This constructor creates a dummy MachineInstr with @@ -201,7 +200,7 @@ void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) { } void MachineInstr::dump() const { - llvm_cerr << " " << *this; + cerr << " " << *this; } static inline void OutputReg(std::ostream &os, unsigned RegNo, diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 186072c..79d3b64 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -112,11 +112,11 @@ void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *OldMI, } void VirtRegMap::print(std::ostream &OS) const { - llvm_ostream LOS(OS); + OStream LOS(OS); print(LOS); } -void VirtRegMap::print(llvm_ostream &OS) const { +void VirtRegMap::print(OStream &OS) const { const MRegisterInfo* MRI = MF.getTarget().getRegisterInfo(); OS << "********** REGISTER MAP **********\n"; @@ -135,7 +135,7 @@ void VirtRegMap::print(llvm_ostream &OS) const { } void VirtRegMap::dump() const { - llvm_ostream OS = DOUT; + OStream OS = DOUT; print(OS); } diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index c3fe951..342d800 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -19,12 +19,12 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/Support/Streams.h" #include <map> namespace llvm { class MachineInstr; class TargetInstrInfo; - class llvm_ostream; class VirtRegMap { public: @@ -145,7 +145,7 @@ namespace llvm { } void print(std::ostream &OS) const; - void print(llvm_ostream &OS) const; + void print(OStream &OS) const; void dump() const; }; |