MCDXContainerStreamer.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MCDXContainerStreamer.h - MCDXContainerStreamer 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. // The DXContainer format isn't a fully featured object format. It doesn't
  16. // support symbols, and initially it will not support instruction data since it
  17. // is used as a bitcode container for DXIL.
  18. //
  19. //===----------------------------------------------------------------------===//
  20. #ifndef LLVM_MC_MCDXCONTAINERSTREAMER_H
  21. #define LLVM_MC_MCDXCONTAINERSTREAMER_H
  22. #include "llvm/MC/MCAsmBackend.h"
  23. #include "llvm/MC/MCCodeEmitter.h"
  24. #include "llvm/MC/MCObjectStreamer.h"
  25. #include "llvm/MC/MCObjectWriter.h"
  26. namespace llvm {
  27. class MCInst;
  28. class raw_ostream;
  29. class MCDXContainerStreamer : public MCObjectStreamer {
  30. public:
  31. MCDXContainerStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
  32. std::unique_ptr<MCObjectWriter> OW,
  33. std::unique_ptr<MCCodeEmitter> Emitter)
  34. : MCObjectStreamer(Context, std::move(TAB), std::move(OW),
  35. std::move(Emitter)) {}
  36. bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override { return false; }
  37. void emitCommonSymbol(MCSymbol *, uint64_t, Align) override {}
  38. void emitZerofill(MCSection *, MCSymbol *Symbol = nullptr, uint64_t Size = 0,
  39. Align ByteAlignment = Align(1),
  40. SMLoc Loc = SMLoc()) override {}
  41. private:
  42. void emitInstToData(const MCInst &, const MCSubtargetInfo &) override;
  43. };
  44. } // end namespace llvm
  45. #endif // LLVM_MC_MCDXCONTAINERSTREAMER_H
  46. #ifdef __GNUC__
  47. #pragma GCC diagnostic pop
  48. #endif