give createAsmStreamer an 'isLittleEndian' argument.

llvm-svn: 93986
This commit is contained in:
Chris Lattner 2010-01-20 06:39:07 +00:00
parent 2b4364fe03
commit 38caaf14c1
4 changed files with 15 additions and 6 deletions

View File

@ -235,7 +235,7 @@ namespace llvm {
/// assembly for the native target, suitable for compiling with a native
/// assembler.
MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS,
const MCAsmInfo &MAI,
const MCAsmInfo &MAI, bool isLittleEndian,
MCInstPrinter *InstPrint = 0,
MCCodeEmitter *CE = 0);

View File

@ -58,7 +58,8 @@ AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
OutContext(*new MCContext()),
// FIXME: Pass instprinter to streamer.
OutStreamer(*createAsmStreamer(OutContext, O, *T, 0)),
OutStreamer(*createAsmStreamer(OutContext, O, *T,
TM.getTargetData()->isLittleEndian(), 0)),
LastMI(0), LastFn(0), Counter(~0U), PrevDLT(NULL) {
DW = 0; MMI = 0;

View File

@ -28,15 +28,19 @@ namespace {
class MCAsmStreamer : public MCStreamer {
raw_ostream &OS;
const MCAsmInfo &MAI;
bool IsLittleEndian;
MCInstPrinter *InstPrinter;
MCCodeEmitter *Emitter;
public:
MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const MCAsmInfo &tai,
MCInstPrinter *_Printer, MCCodeEmitter *_Emitter)
bool isLittleEndian, MCInstPrinter *_Printer,
MCCodeEmitter *_Emitter)
: MCStreamer(Context), OS(_OS), MAI(tai), InstPrinter(_Printer),
Emitter(_Emitter) {}
~MCAsmStreamer() {}
bool isLittleEndian() const { return IsLittleEndian; }
/// @name MCStreamer Interface
/// @{
@ -337,7 +341,8 @@ void MCAsmStreamer::Finish() {
}
MCStreamer *llvm::createAsmStreamer(MCContext &Context, raw_ostream &OS,
const MCAsmInfo &MAI, MCInstPrinter *IP,
const MCAsmInfo &MAI, bool isLittleEndian,
MCInstPrinter *IP,
MCCodeEmitter *CE) {
return new MCAsmStreamer(Context, OS, MAI, IP, CE);
return new MCAsmStreamer(Context, OS, MAI, isLittleEndian, IP, CE);
}

View File

@ -28,6 +28,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Signals.h"
#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetMachine.h" // FIXME.
#include "llvm/Target/TargetSelect.h"
@ -263,7 +264,9 @@ static int AssembleInput(const char *ProgName) {
IP.reset(TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *Out));
if (ShowEncoding)
CE.reset(TheTarget->createCodeEmitter(*TM));
Str.reset(createAsmStreamer(Ctx, *Out, *MAI, IP.get(), CE.get()));
Str.reset(createAsmStreamer(Ctx, *Out, *MAI,
TM->getTargetData()->isLittleEndian(),
IP.get(), CE.get()));
} else {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM));