MCSPIRVStreamer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MCSPIRVStreamer.h - MCStreamer SPIR-V Object File Interface -*- C++ ===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Overrides MCObjectStreamer to disable all unnecessary features with stubs.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_MC_MCSPIRVSTREAMER_H
  18. #define LLVM_MC_MCSPIRVSTREAMER_H
  19. #include "llvm/MC/MCAsmBackend.h"
  20. #include "llvm/MC/MCCodeEmitter.h"
  21. #include "llvm/MC/MCObjectStreamer.h"
  22. #include "llvm/MC/MCObjectWriter.h"
  23. namespace llvm {
  24. class MCInst;
  25. class raw_ostream;
  26. class MCSPIRVStreamer : public MCObjectStreamer {
  27. public:
  28. MCSPIRVStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
  29. std::unique_ptr<MCObjectWriter> OW,
  30. std::unique_ptr<MCCodeEmitter> Emitter)
  31. : MCObjectStreamer(Context, std::move(TAB), std::move(OW),
  32. std::move(Emitter)) {}
  33. bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override {
  34. return false;
  35. }
  36. void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
  37. Align ByteAlignment) override {}
  38. void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
  39. uint64_t Size = 0, Align ByteAlignment = Align(1),
  40. SMLoc Loc = SMLoc()) override {}
  41. private:
  42. void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
  43. };
  44. } // end namespace llvm
  45. #endif
  46. #ifdef __GNUC__
  47. #pragma GCC diagnostic pop
  48. #endif