aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-08-21 00:14:44 +0000
committerOwen Anderson <resistor@mac.com>2008-08-21 00:14:44 +0000
commit847b99b2df4534498b514c439324e7c60de5c3b7 (patch)
treea72c740cc8590cd63825fcf08f71c5e2f625ca55 /lib/Target/Mips
parent091c331b18d2e8d40d35d7b9b0d422f832f2fdc5 (diff)
downloadexternal_llvm-847b99b2df4534498b514c439324e7c60de5c3b7.zip
external_llvm-847b99b2df4534498b514c439324e7c60de5c3b7.tar.gz
external_llvm-847b99b2df4534498b514c439324e7c60de5c3b7.tar.bz2
Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r--lib/Target/Mips/Mips.h3
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp10
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp2
-rw-r--r--lib/Target/Mips/MipsTargetMachine.h4
4 files changed, 11 insertions, 8 deletions
diff --git a/lib/Target/Mips/Mips.h b/lib/Target/Mips/Mips.h
index 0387c6a..1dc53ca 100644
--- a/lib/Target/Mips/Mips.h
+++ b/lib/Target/Mips/Mips.h
@@ -21,10 +21,11 @@ namespace llvm {
class MipsTargetMachine;
class FunctionPass;
class MachineCodeEmitter;
+ class raw_ostream;
FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
- FunctionPass *createMipsCodePrinterPass(std::ostream &OS,
+ FunctionPass *createMipsCodePrinterPass(raw_ostream &OS,
MipsTargetMachine &TM);
} // end namespace llvm;
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 6d502ac..02455cf 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -37,6 +37,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/raw_ostream.h"
#include <cctype>
using namespace llvm;
@@ -48,7 +49,7 @@ namespace {
const MipsSubtarget *Subtarget;
- MipsAsmPrinter(std::ostream &O, MipsTargetMachine &TM,
+ MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM,
const TargetAsmInfo *T):
AsmPrinter(O, TM, T) {
Subtarget = &TM.getSubtarget<MipsSubtarget>();
@@ -89,7 +90,7 @@ namespace {
/// assembly code for a MachineFunction to the given output stream,
/// using the given target machine description. This should work
/// regardless of whether the function is in SSA form.
-FunctionPass *llvm::createMipsCodePrinterPass(std::ostream &o,
+FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o,
MipsTargetMachine &tm)
{
return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo());
@@ -175,10 +176,9 @@ printSavedRegsBitmask(MachineFunction &MF)
void MipsAsmPrinter::
printHex32(unsigned int Value)
{
- O << "0x" << std::hex;
+ O << "0x";
for (int i = 7; i >= 0; i--)
- O << std::hex << ( (Value & (0xF << (i*4))) >> (i*4) );
- O << std::dec;
+ O << utohexstr( (Value & (0xF << (i*4))) >> (i*4) );
}
//===----------------------------------------------------------------------===//
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index bc2f281..b24e498 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -117,7 +117,7 @@ addPreEmitPass(PassManagerBase &PM, bool Fast)
// true if AssemblyEmitter is supported
bool MipsTargetMachine::
addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out)
+ raw_ostream &Out)
{
// Output assembly language.
PM.add(createMipsCodePrinterPass(Out, *this));
diff --git a/lib/Target/Mips/MipsTargetMachine.h b/lib/Target/Mips/MipsTargetMachine.h
index bdca77f..ac55647 100644
--- a/lib/Target/Mips/MipsTargetMachine.h
+++ b/lib/Target/Mips/MipsTargetMachine.h
@@ -22,6 +22,8 @@
#include "llvm/Target/TargetFrameInfo.h"
namespace llvm {
+ class raw_ostream;
+
class MipsTargetMachine : public LLVMTargetMachine {
MipsSubtarget Subtarget;
const TargetData DataLayout; // Calculates type size & alignment
@@ -58,7 +60,7 @@ namespace llvm {
virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
+ raw_ostream &Out);
};
/// MipselTargetMachine - Mipsel target machine.