2009-08-13 23:36:34 +00: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:
|
2014-01-26 06:06:37 +00:00
|
|
|
MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
|
2009-08-13 23:36:34 +00:00
|
|
|
|
|
|
|
/// @name MCStreamer Interface
|
|
|
|
/// @{
|
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void ChangeSection(const MCSection *Section,
|
|
|
|
const MCExpr *Subsection) override {
|
2009-08-18 16:46:29 +00:00
|
|
|
}
|
2009-08-13 23:36:34 +00:00
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitLabel(MCSymbol *Symbol) override {
|
2010-03-09 23:12:18 +00:00
|
|
|
assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
|
2013-04-17 21:18:16 +00:00
|
|
|
assert(getCurrentSection().first &&"Cannot emit before setting section!");
|
2013-09-19 23:21:01 +00:00
|
|
|
AssignSection(Symbol, getCurrentSection().first);
|
2010-03-09 23:12:18 +00:00
|
|
|
}
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitDebugLabel(MCSymbol *Symbol) override {
|
2012-12-16 04:00:45 +00:00
|
|
|
EmitLabel(Symbol);
|
|
|
|
}
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitAssemblerFlag(MCAssemblerFlag Flag) override {}
|
|
|
|
void EmitThumbFunc(MCSymbol *Func) override {}
|
|
|
|
|
|
|
|
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override {}
|
|
|
|
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override {}
|
|
|
|
void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
|
|
|
|
const MCSymbol *LastLabel,
|
|
|
|
const MCSymbol *Label,
|
|
|
|
unsigned PointerSize) override {}
|
|
|
|
|
|
|
|
bool EmitSymbolAttribute(MCSymbol *Symbol,
|
|
|
|
MCSymbolAttr Attribute) override {
|
2013-08-09 01:52:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
2009-08-13 23:36:34 +00:00
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override {}
|
|
|
|
|
|
|
|
void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
|
|
|
|
void EmitCOFFSymbolStorageClass(int StorageClass) override {}
|
|
|
|
void EmitCOFFSymbolType(int Type) override {}
|
|
|
|
void EndCOFFSymbolDef() override {}
|
|
|
|
void EmitCOFFSecRel32(MCSymbol const *Symbol) override {}
|
|
|
|
|
|
|
|
void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override {}
|
|
|
|
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
|
|
|
unsigned ByteAlignment) override {}
|
|
|
|
void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
|
|
|
unsigned ByteAlignment) override {}
|
|
|
|
void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
|
|
|
uint64_t Size = 0, unsigned ByteAlignment = 0) override {}
|
|
|
|
void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
|
|
|
uint64_t Size, unsigned ByteAlignment) override {}
|
|
|
|
void EmitBytes(StringRef Data) override {}
|
|
|
|
|
|
|
|
void EmitValueImpl(const MCExpr *Value, unsigned Size) override {}
|
|
|
|
void EmitULEB128Value(const MCExpr *Value) override {}
|
|
|
|
void EmitSLEB128Value(const MCExpr *Value) override {}
|
|
|
|
void EmitGPRel32Value(const MCExpr *Value) override {}
|
|
|
|
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
|
|
|
unsigned ValueSize = 1,
|
|
|
|
unsigned MaxBytesToEmit = 0) override {}
|
|
|
|
|
|
|
|
void EmitCodeAlignment(unsigned ByteAlignment,
|
|
|
|
unsigned MaxBytesToEmit = 0) override {}
|
|
|
|
|
|
|
|
bool EmitValueToOffset(const MCExpr *Offset,
|
|
|
|
unsigned char Value = 0) override { return false; }
|
|
|
|
|
|
|
|
void EmitFileDirective(StringRef Filename) override {}
|
2014-03-17 01:52:11 +00:00
|
|
|
unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
|
|
|
|
StringRef Filename,
|
|
|
|
unsigned CUID = 0) override {
|
|
|
|
return 0;
|
2010-11-16 21:20:32 +00:00
|
|
|
}
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
|
|
|
|
unsigned Column, unsigned Flags,
|
|
|
|
unsigned Isa, unsigned Discriminator,
|
|
|
|
StringRef FileName) override {}
|
|
|
|
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo&) override {}
|
2009-08-13 23:36:34 +00:00
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitBundleAlignMode(unsigned AlignPow2) override {}
|
|
|
|
void EmitBundleLock(bool AlignToEnd) override {}
|
|
|
|
void EmitBundleUnlock() override {}
|
2012-12-20 19:05:53 +00:00
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void FinishImpl() override {}
|
2012-02-22 23:49:50 +00:00
|
|
|
|
2014-03-08 07:02:02 +00:00
|
|
|
void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override {
|
2012-02-22 23:49:50 +00:00
|
|
|
RecordProcEnd(Frame);
|
|
|
|
}
|
2009-08-13 23:36:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2012-05-11 01:41:30 +00:00
|
|
|
|
2009-08-13 23:36:34 +00:00
|
|
|
MCStreamer *llvm::createNullStreamer(MCContext &Context) {
|
|
|
|
return new MCNullStreamer(Context);
|
|
|
|
}
|