54 lines · cpp
1//===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/ADT/StringRef.h"10#include "llvm/MC/MCDirectives.h"11#include "llvm/MC/MCStreamer.h"12namespace llvm {13class MCContext;14class MCExpr;15class MCSection;16class MCSymbol;17} // namespace llvm18 19using namespace llvm;20 21namespace {22 23class MCNullStreamer : public MCStreamer {24public:25 MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}26 27 /// @name MCStreamer Interface28 /// @{29 30 bool hasRawTextSupport() const override { return true; }31 void emitRawTextImpl(StringRef String) override {}32 33 bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override {34 return true;35 }36 37 void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,38 Align ByteAlignment) override {}39 void emitSubsectionsViaSymbols() override {};40 void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}41 void emitCOFFSymbolStorageClass(int StorageClass) override {}42 void emitCOFFSymbolType(int Type) override {}43 void endCOFFSymbolDef() override {}44 void emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol,45 MCSymbolAttr Linkage,46 MCSymbolAttr Visibility) override {}47};48 49} // namespace50 51MCStreamer *llvm::createNullStreamer(MCContext &Context) {52 return new MCNullStreamer(Context);53}54