1 //===- MCSectionXCOFF.h - XCOFF Machine Code Sections -----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares the MCSectionXCOFF class.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_MC_MCSECTIONXCOFF_H
14 #define LLVM_MC_MCSECTIONXCOFF_H
16 #include "llvm/ADT/Twine.h"
17 #include "llvm/BinaryFormat/XCOFF.h"
18 #include "llvm/MC/MCSection.h"
24 // This class represents an XCOFF `Control Section`, more commonly referred to
25 // as a csect. A csect represents the smallest possible unit of data/code which
26 // will be relocated as a single block.
27 class MCSectionXCOFF final : public MCSection {
28 friend class MCContext;
31 XCOFF::StorageMappingClass MappingClass;
33 MCSectionXCOFF(StringRef Section, XCOFF::StorageMappingClass SMC,
34 SectionKind K, MCSymbol *Begin)
35 : MCSection(SV_XCOFF, K, Begin), Name(Section), MappingClass(SMC) {}
40 static bool classof(const MCSection *S) {
41 return S->getVariant() == SV_XCOFF;
44 StringRef getSectionName() const { return Name; }
45 XCOFF::StorageMappingClass getMappingClass() const { return MappingClass; }
47 void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
49 const MCExpr *Subsection) const override;
50 bool UseCodeAlign() const override;
51 bool isVirtualSection() const override;
54 } // end namespace llvm