LLVM: lib/MC/MCAsmInfoGOFF.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
19
20using namespace llvm;
21
29
36 OS << Name << " CATTR ";
37 OS << "ALIGN(" << static_cast<unsigned>(Alignment) << "),"
38 << "FILL(" << static_cast<unsigned>(FillByteValue) << ")";
39 switch (LoadBehavior) {
41 OS << ",DEFLOAD";
42 break;
44 OS << ",NOLOAD";
45 break;
46 default:
47 break;
48 }
49 switch (Executable) {
51 OS << ",EXECUTABLE";
52 break;
54 OS << ",NOTEXECUTABLE";
55 break;
56 default:
57 break;
58 }
59 if (IsReadOnly)
60 OS << ",READONLY";
62 OS << ',';
63 OS << "RMODE(";
64 switch (Rmode) {
68 OS << "24";
69 break;
71 OS << "31";
72 break;
74 OS << "64";
75 break;
76 }
77 OS << ')';
78 }
79 if (SortKey)
80 OS << ",PRIORITY(" << SortKey << ")";
81 if (!PartName.empty())
82 OS << ",PART(" << PartName << ")";
83 OS << '\n';
84}
85
90 OS << Name << " XATTR ";
93 OS << "REFERENCE(" << (Executable == GOFF::ESD_EXE_CODE ? "CODE" : "DATA")
94 << "),";
96 OS << "SCOPE(";
97 switch (BindingScope) {
99 OS << "SECTION";
100 break;
102 OS << "MODULE";
103 break;
105 OS << "LIBRARY";
106 break;
108 OS << "EXPORT";
109 break;
110 default:
111 break;
112 }
113 OS << ')';
114 }
115 OS << '\n';
116}
117
118void MCAsmInfoGOFF::printSwitchToSection(const MCSection &Section,
119 uint32_t Subsection, const Triple &T,
121 auto &Sec =
122 const_cast<MCSectionGOFF &>(static_cast<const MCSectionGOFF &>(Section));
123 switch (Sec.SymbolType) {
125 OS << Sec.getName() << " CSECT\n";
126 Sec.Emitted = true;
127 break;
128 }
130 printSwitchToSection(*Sec.getParent(), Subsection, T, OS);
131 if (!Sec.Emitted) {
132 emitCATTR(OS, Sec.getName(), Sec.EDAttributes.Rmode,
133 Sec.EDAttributes.Alignment, Sec.EDAttributes.LoadBehavior,
135 Sec.EDAttributes.FillByteValue, StringRef());
136 Sec.Emitted = true;
137 } else
138 OS << Sec.getName() << " CATTR\n";
139 break;
140 }
142 MCSectionGOFF *ED = Sec.getParent();
143 printSwitchToSection(*ED->getParent(), Subsection, T, OS);
144 if (!Sec.Emitted) {
149 Sec.getName());
150 emitXATTR(OS, Sec.getName(), Sec.PRAttributes.Linkage,
151 Sec.PRAttributes.Executable, Sec.PRAttributes.BindingScope);
152 ED->Emitted = true;
153 Sec.Emitted = true;
154 } else
155 OS << ED->getName() << " CATTR PART(" << Sec.getName() << ")\n";
156 break;
157 }
158 default:
160 }
161}
static void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode, GOFF::ESDAlignment Alignment, GOFF::ESDLoadingBehavior LoadBehavior, GOFF::ESDExecutable Executable, bool IsReadOnly, uint32_t SortKey, uint8_t FillByteValue, StringRef PartName)
Definition MCAsmInfoGOFF.cpp:30
static void emitXATTR(raw_ostream &OS, StringRef Name, GOFF::ESDLinkageType Linkage, GOFF::ESDExecutable Executable, GOFF::ESDBindingScope BindingScope)
Definition MCAsmInfoGOFF.cpp:86
This file defines certain target specific asm properties for GOFF (z/OS) based targets.
This file declares the MCSectionGOFF class, which contains all of the necessary machine code sections...
MCAsmInfoGOFF()
Definition MCAsmInfoGOFF.cpp:22
const char * Data64bitsDirective
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ....
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
bool HasDotTypeDotSizeDirective
True if the target has .type and .size directives, this is true for most ELF targets.
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
GOFF::EDAttr getEDAttributes() const
GOFF::EDAttr EDAttributes
MCSectionGOFF * getParent() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
StringRef getName() const
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ ESD_ST_ElementDefinition
@ ESD_ST_SectionDefinition
This is an optimization pass for GlobalISel generic memory operations.
GOFF::ESDAlignment Alignment
GOFF::ESDLoadingBehavior LoadBehavior