diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-13 23:36:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-13 23:36:34 +0000 |
commit | 011e4db845b5c4166142338c77adc8ac03e5e041 (patch) | |
tree | 8d5b98d36b1b7ca07675d3458258d657efbaae93 /lib/MC/MCNullStreamer.cpp | |
parent | fdf229eda95a542fc34d5182e1a91a22789ba122 (diff) | |
download | external_llvm-011e4db845b5c4166142338c77adc8ac03e5e041.zip external_llvm-011e4db845b5c4166142338c77adc8ac03e5e041.tar.gz external_llvm-011e4db845b5c4166142338c77adc8ac03e5e041.tar.bz2 |
llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
- Currently unused.
- A few other random comment fixes lumped in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCNullStreamer.cpp')
-rw-r--r-- | lib/MC/MCNullStreamer.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/MC/MCNullStreamer.cpp b/lib/MC/MCNullStreamer.cpp new file mode 100644 index 0000000..3ac79cb --- /dev/null +++ b/lib/MC/MCNullStreamer.cpp @@ -0,0 +1,72 @@ +//===- 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" +#include "llvm/MC/MCValue.h" + +using namespace llvm; + +namespace { + + class MCNullStreamer : public MCStreamer { + public: + MCNullStreamer(MCContext &Context) : MCStreamer(Context) {} + + /// @name MCStreamer Interface + /// @{ + + virtual void SwitchSection(MCSection *Section) {} + + virtual void EmitLabel(MCSymbol *Symbol) {} + + virtual void EmitAssemblerFlag(AssemblerFlag Flag) {} + + virtual void EmitAssignment(MCSymbol *Symbol, const MCValue &Value, + bool MakeAbsolute = false) {} + + virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) {} + + virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {} + + virtual void EmitLocalSymbol(MCSymbol *Symbol, const MCValue &Value) {} + + virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size, + unsigned Pow2Alignment, bool IsLocal) {} + + virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = NULL, + unsigned Size = 0, unsigned Pow2Alignment = 0) {} + + virtual void EmitBytes(const StringRef &Data) {} + + virtual void EmitValue(const MCValue &Value, unsigned Size) {} + + virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0, + unsigned ValueSize = 1, + unsigned MaxBytesToEmit = 0) {} + + virtual void EmitValueToOffset(const MCValue &Offset, + unsigned char Value = 0) {} + + virtual void EmitInstruction(const MCInst &Inst) {} + + virtual void Finish() {} + + /// @} + }; + +} + +MCStreamer *llvm::createNullStreamer(MCContext &Context) { + return new MCNullStreamer(Context); +} |