LLVM 19.0.0git
MCSectionGOFF.h
Go to the documentation of this file.
1//===-- llvm/MC/MCSectionGOFF.h - GOFF Machine Code Sections ----*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file declares the MCSectionGOFF class, which contains all of the
11/// necessary machine code sections for the GOFF file format.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_MC_MCSECTIONGOFF_H
16#define LLVM_MC_MCSECTIONGOFF_H
17
19#include "llvm/MC/MCSection.h"
21
22namespace llvm {
23
24class MCExpr;
25
26class MCSectionGOFF final : public MCSection {
27private:
28 MCSection *Parent;
29 const MCExpr *SubsectionId;
30
31 friend class MCContext;
33 : MCSection(SV_GOFF, Name, K, nullptr), Parent(P), SubsectionId(Sub) {}
34
35public:
36 void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
38 const MCExpr *Subsection) const override {
39 OS << "\t.section\t\"" << getName() << "\"\n";
40 }
41
42 bool useCodeAlign() const override { return false; }
43
44 bool isVirtualSection() const override { return false; }
45
46 MCSection *getParent() const { return Parent; }
47 const MCExpr *getSubsectionId() const { return SubsectionId; }
48
49 static bool classof(const MCSection *S) { return S->getVariant() == SV_GOFF; }
50};
51} // end namespace llvm
52
53#endif
#define P(N)
raw_pwrite_stream & OS
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
Context object for machine code objects.
Definition: MCContext.h:81
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
MCSection * getParent() const
Definition: MCSectionGOFF.h:46
bool isVirtualSection() const override
Check whether this section is "virtual", that is has no actual object file contents.
Definition: MCSectionGOFF.h:44
void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const override
Definition: MCSectionGOFF.h:36
const MCExpr * getSubsectionId() const
Definition: MCSectionGOFF.h:47
bool useCodeAlign() const override
Return true if a .align directive should use "optimized nops" to fill instead of 0s.
Definition: MCSectionGOFF.h:42
static bool classof(const MCSection *S)
Definition: MCSectionGOFF.h:49
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
SectionVariant getVariant() const
Definition: MCSection.h:127
StringRef Name
Definition: MCSection.h:113
StringRef getName() const
Definition: MCSection.h:124
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18