2009-08-14 01:36:34 +02:00
|
|
|
//===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "llvm/MC/MCStreamer.h"
|
|
|
|
|
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/MC/MCInst.h"
|
|
|
|
#include "llvm/MC/MCSectionMachO.h"
|
|
|
|
#include "llvm/MC/MCSymbol.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
class MCNullStreamer : public MCStreamer {
|
|
|
|
public:
|
|
|
|
MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
|
|
|
|
|
|
|
|
/// @name MCStreamer Interface
|
|
|
|
/// @{
|
|
|
|
|
2009-08-18 18:46:29 +02:00
|
|
|
virtual void SwitchSection(const MCSection *Section) {
|
|
|
|
CurSection = Section;
|
|
|
|
}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
|
|
|
virtual void EmitLabel(MCSymbol *Symbol) {}
|
|
|
|
|
|
|
|
virtual void EmitAssemblerFlag(AssemblerFlag Flag) {}
|
|
|
|
|
2009-08-31 10:09:28 +02:00
|
|
|
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
|
|
|
virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) {}
|
|
|
|
|
|
|
|
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
|
|
|
|
|
|
|
|
virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
|
2009-08-30 08:17:16 +02:00
|
|
|
unsigned ByteAlignment) {}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
2009-08-28 07:48:22 +02:00
|
|
|
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
2009-08-30 08:17:16 +02:00
|
|
|
unsigned Size = 0, unsigned ByteAlignment = 0) {}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
2009-11-06 11:58:06 +01:00
|
|
|
virtual void EmitBytes(StringRef Data) {}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
2009-08-31 10:09:28 +02:00
|
|
|
virtual void EmitValue(const MCExpr *Value, unsigned Size) {}
|
2009-08-14 01:36:34 +02:00
|
|
|
|
|
|
|
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
|
|
|
unsigned ValueSize = 1,
|
|
|
|
unsigned MaxBytesToEmit = 0) {}
|
|
|
|
|
2009-08-31 10:09:28 +02:00
|
|
|
virtual void EmitValueToOffset(const MCExpr *Offset,
|
2009-08-14 01:36:34 +02:00
|
|
|
unsigned char Value = 0) {}
|
|
|
|
|
|
|
|
virtual void EmitInstruction(const MCInst &Inst) {}
|
|
|
|
|
|
|
|
virtual void Finish() {}
|
|
|
|
|
|
|
|
/// @}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
MCStreamer *llvm::createNullStreamer(MCContext &Context) {
|
|
|
|
return new MCNullStreamer(Context);
|
|
|
|
}
|