LLVM API Documentation

MCNullStreamer.cpp
Go to the documentation of this file.
00001 //===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #include "llvm/MC/MCStreamer.h"
00011 #include "llvm/MC/MCContext.h"
00012 #include "llvm/MC/MCInst.h"
00013 #include "llvm/MC/MCSectionMachO.h"
00014 #include "llvm/MC/MCSymbol.h"
00015 
00016 using namespace llvm;
00017 
00018 namespace {
00019 
00020   class MCNullStreamer : public MCStreamer {
00021   public:
00022     MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
00023 
00024     /// @name MCStreamer Interface
00025     /// @{
00026 
00027     bool EmitSymbolAttribute(MCSymbol *Symbol,
00028                              MCSymbolAttr Attribute) override {
00029       return true;
00030     }
00031 
00032     void EmitCOFFSecRel32(MCSymbol const *Symbol) override {}
00033     void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
00034                           unsigned ByteAlignment) override {}
00035     void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = nullptr,
00036                       uint64_t Size = 0, unsigned ByteAlignment = 0) override {}
00037     void EmitGPRel32Value(const MCExpr *Value) override {}
00038   };
00039 
00040 }
00041 
00042 MCStreamer *llvm::createNullStreamer(MCContext &Context) {
00043   return new MCNullStreamer(Context);
00044 }