MCNullStreamer.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/MCDirectives.h"
  10. #include "llvm/MC/MCStreamer.h"
  11. #include "llvm/Support/SMLoc.h"
  12. namespace llvm {
  13. class MCContext;
  14. class MCExpr;
  15. class MCSection;
  16. class MCSymbol;
  17. } // namespace llvm
  18. using namespace llvm;
  19. namespace {
  20. class MCNullStreamer : public MCStreamer {
  21. public:
  22. MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
  23. /// @name MCStreamer Interface
  24. /// @{
  25. bool hasRawTextSupport() const override { return true; }
  26. void emitRawTextImpl(StringRef String) override {}
  27. bool emitSymbolAttribute(MCSymbol *Symbol,
  28. MCSymbolAttr Attribute) override {
  29. return true;
  30. }
  31. void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
  32. Align ByteAlignment) override {}
  33. void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
  34. uint64_t Size = 0, Align ByteAlignment = Align(1),
  35. SMLoc Loc = SMLoc()) override {}
  36. void emitGPRel32Value(const MCExpr *Value) override {}
  37. void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}
  38. void emitCOFFSymbolStorageClass(int StorageClass) override {}
  39. void emitCOFFSymbolType(int Type) override {}
  40. void endCOFFSymbolDef() override {}
  41. void
  42. emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage,
  43. MCSymbolAttr Visibility) override {}
  44. };
  45. }
  46. MCStreamer *llvm::createNullStreamer(MCContext &Context) {
  47. return new MCNullStreamer(Context);
  48. }