#include "llvm/Type.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
+#include "llvm/MC/MCStreamer.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Support/CommandLine.h"
bool X86ATTAsmPrinter::doInitialization(Module &M) {
if (TAI->doesSupportDebugInformation() || TAI->doesSupportExceptionHandling())
MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+
+ if (NewAsmPrinter) {
+ Context = new MCContext();
+ // FIXME: Send this to "O" instead of outs(). For now, we force it to
+ // stdout to make it easy to compare.
+ Streamer = createAsmStreamer(*Context, outs());
+ }
+
return AsmPrinter::doInitialization(M);
}
DW->EndModule();
}
+ if (NewAsmPrinter) {
+ Streamer->Finish();
+
+ delete Streamer;
+ delete Context;
+ Streamer = 0;
+ Context = 0;
+ }
+
return AsmPrinter::doFinalization(M);
}
namespace llvm {
class MachineJumpTableInfo;
+class MCContext;
class MCInst;
+class MCStreamer;
class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
MachineModuleInfo *MMI;
const X86Subtarget *Subtarget;
+
+ MCContext *Context;
+ MCStreamer *Streamer;
public:
explicit X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
const TargetAsmInfo *T, CodeGenOpt::Level OL,
bool V)
: AsmPrinter(O, TM, T, OL, V), MMI(0) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
+ Context = 0;
+ Streamer = 0;
}
virtual const char *getPassName() const {