MCSectionGOFF.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/MC/MCSectionGOFF.h - GOFF Machine Code Sections ----*- 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. /// \file
  15. /// This file declares the MCSectionGOFF class, which contains all of the
  16. /// necessary machine code sections for the GOFF file format.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_MC_MCSECTIONGOFF_H
  20. #define LLVM_MC_MCSECTIONGOFF_H
  21. #include "llvm/MC/MCSection.h"
  22. #include "llvm/Support/raw_ostream.h"
  23. namespace llvm {
  24. class MCExpr;
  25. class MCSectionGOFF final : public MCSection {
  26. private:
  27. friend class MCContext;
  28. MCSectionGOFF(StringRef Name, SectionKind K)
  29. : MCSection(SV_GOFF, Name, K, nullptr) {}
  30. public:
  31. void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
  32. raw_ostream &OS,
  33. const MCExpr *Subsection) const override {
  34. OS << "\t.section\t\"" << getName() << "\"\n";
  35. }
  36. bool UseCodeAlign() const override { return false; }
  37. bool isVirtualSection() const override { return false; }
  38. static bool classof(const MCSection *S) { return S->getVariant() == SV_GOFF; }
  39. };
  40. } // end namespace llvm
  41. #endif
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif