MCNullStreamer.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/ADT/StringRef.h"
  9. #include "llvm/MC/MCInst.h"
  10. #include "llvm/MC/MCStreamer.h"
  11. #include "llvm/MC/MCSymbol.h"
  12. using namespace llvm;
  13. namespace {
  14. class MCNullStreamer : public MCStreamer {
  15. public:
  16. MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
  17. /// @name MCStreamer Interface
  18. /// @{
  19. bool hasRawTextSupport() const override { return true; }
  20. void emitRawTextImpl(StringRef String) override {}
  21. bool emitSymbolAttribute(MCSymbol *Symbol,
  22. MCSymbolAttr Attribute) override {
  23. return true;
  24. }
  25. void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
  26. unsigned ByteAlignment) override {}
  27. void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
  28. uint64_t Size = 0, unsigned ByteAlignment = 0,
  29. SMLoc Loc = SMLoc()) override {}
  30. void emitGPRel32Value(const MCExpr *Value) override {}
  31. void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
  32. void EmitCOFFSymbolStorageClass(int StorageClass) override {}
  33. void EmitCOFFSymbolType(int Type) override {}
  34. void EndCOFFSymbolDef() override {}
  35. void
  36. emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage,
  37. MCSymbolAttr Visibility) override {}
  38. };
  39. }
  40. MCStreamer *llvm::createNullStreamer(MCContext &Context) {
  41. return new MCNullStreamer(Context);
  42. }