Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:14

0001 //===-- llvm/MC/MCSectionGOFF.h - GOFF Machine Code Sections ----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// This file declares the MCSectionGOFF class, which contains all of the
0011 /// necessary machine code sections for the GOFF file format.
0012 ///
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_MC_MCSECTIONGOFF_H
0016 #define LLVM_MC_MCSECTIONGOFF_H
0017 
0018 #include "llvm/BinaryFormat/GOFF.h"
0019 #include "llvm/MC/MCSection.h"
0020 #include "llvm/Support/raw_ostream.h"
0021 
0022 namespace llvm {
0023 
0024 class MCExpr;
0025 
0026 class MCSectionGOFF final : public MCSection {
0027 private:
0028   MCSection *Parent;
0029   uint32_t Subsection;
0030 
0031   friend class MCContext;
0032   MCSectionGOFF(StringRef Name, SectionKind K, MCSection *P, uint32_t Sub)
0033       : MCSection(SV_GOFF, Name, K.isText(), /*IsVirtual=*/false, nullptr),
0034         Parent(P), Subsection(Sub) {}
0035 
0036 public:
0037   void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
0038                             raw_ostream &OS,
0039                             uint32_t /*Subsection*/) const override {
0040     OS << "\t.section\t\"" << getName() << "\"\n";
0041   }
0042 
0043   bool useCodeAlign() const override { return false; }
0044 
0045   MCSection *getParent() const { return Parent; }
0046   uint32_t getSubsection() const { return Subsection; }
0047 
0048   static bool classof(const MCSection *S) { return S->getVariant() == SV_GOFF; }
0049 };
0050 } // end namespace llvm
0051 
0052 #endif