LLVM 22.0.0git
MCGOFFAttributes.h
Go to the documentation of this file.
1//===- MCGOFFAttributes.h - Attributes of GOFF symbols --------------------===//
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// Defines the various attribute collections defining GOFF symbols.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_MC_MCGOFFATTRIBUTES_H
14#define LLVM_MC_MCGOFFATTRIBUTES_H
15
16#include "llvm/ADT/StringRef.h"
18#include <cstdint>
19
20namespace llvm {
21namespace GOFF {
22// An "External Symbol Definition" in the GOFF file has a type, and depending on
23// the type a different subset of the fields is used.
24//
25// Unlike other formats, a 2 dimensional structure is used to define the
26// location of data. For example, the equivalent of the ELF .text section is
27// made up of a Section Definition (SD) and a class (Element Definition; ED).
28// The name of the SD symbol depends on the application, while the class has the
29// predefined name C_CODE/C_CODE64 in AMODE31 and AMODE64 respectively.
30//
31// Data can be placed into this structure in 2 ways. First, the data (in a text
32// record) can be associated with an ED symbol. To refer to data, a Label
33// Definition (LD) is used to give an offset into the data a name. When binding,
34// the whole data is pulled into the resulting executable, and the addresses
35// given by the LD symbols are resolved.
36//
37// The alternative is to use a Part Definition (PR). In this case, the data (in
38// a text record) is associated with the part. When binding, only the data of
39// referenced PRs is pulled into the resulting binary.
40//
41// Both approaches are used. SD, ED, and PR elements are modelled by nested
42// MCSectionGOFF instances, while LD elements are associated with MCSymbolGOFF
43// instances.
44
45// Attributes for SD symbols.
46struct SDAttr {
49};
50
51// Attributes for ED symbols.
52struct EDAttr {
53 bool IsReadOnly = false;
62};
63
64// Attributes for LD symbols.
65struct LDAttr {
66 bool IsRenamable = false;
72};
73
74// Attributes for PR symbols.
75struct PRAttr {
76 bool IsRenamable = false;
81};
82
83// Predefined GOFF class names.
84constexpr StringLiteral CLASS_CODE = "C_CODE64";
85constexpr StringLiteral CLASS_WSA = "C_WSA64";
86constexpr StringLiteral CLASS_DATA = "C_DATA64";
87constexpr StringLiteral CLASS_PPA2 = "C_@@QPPA2";
88
89} // namespace GOFF
90} // namespace llvm
91
92#endif
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition: StringRef.h:862
ESDLoadingBehavior
Definition: GOFF.h:127
@ ESD_LB_Initial
Definition: GOFF.h:128
constexpr StringLiteral CLASS_WSA
ESDBindingAlgorithm
Definition: GOFF.h:97
@ ESD_BA_Concatenate
Definition: GOFF.h:98
ESDTextStyle
Definition: GOFF.h:91
@ ESD_TS_ByteOriented
Definition: GOFF.h:92
ESDExecutable
Definition: GOFF.h:109
@ ESD_EXE_Unspecified
Definition: GOFF.h:110
ESDReserveQwords
Definition: GOFF.h:68
@ ESD_RQ_0
Definition: GOFF.h:69
ESDAlignment
Definition: GOFF.h:144
@ ESD_ALIGN_Doubleword
Definition: GOFF.h:148
constexpr StringLiteral CLASS_PPA2
ESDAmode
Definition: GOFF.h:75
ESDBindingScope
Definition: GOFF.h:134
@ ESD_BSC_Unspecified
Definition: GOFF.h:135
ESDLinkageType
Definition: GOFF.h:142
@ ESD_LT_XPLink
Definition: GOFF.h:142
ESDNameSpaceId
Definition: GOFF.h:61
@ ESD_NS_NormalName
Definition: GOFF.h:63
constexpr StringLiteral CLASS_DATA
ESDTaskingBehavior
Definition: GOFF.h:102
@ ESD_TA_Unspecified
Definition: GOFF.h:103
constexpr StringLiteral CLASS_CODE
ESDBindingStrength
Definition: GOFF.h:122
@ ESD_BST_Strong
Definition: GOFF.h:123
ESDRmode
Definition: GOFF.h:84
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
GOFF::ESDReserveQwords ReservedQwords
GOFF::ESDRmode Rmode
GOFF::ESDAlignment Alignment
GOFF::ESDTextStyle TextStyle
GOFF::ESDLoadingBehavior LoadBehavior
GOFF::ESDNameSpaceId NameSpace
GOFF::ESDBindingAlgorithm BindAlgorithm
GOFF::ESDAmode Amode
GOFF::ESDBindingStrength BindingStrength
GOFF::ESDExecutable Executable
GOFF::ESDBindingScope BindingScope
GOFF::ESDLinkageType Linkage
GOFF::ESDLinkageType Linkage
GOFF::ESDBindingScope BindingScope
GOFF::ESDExecutable Executable
GOFF::ESDTaskingBehavior TaskingBehavior
GOFF::ESDBindingScope BindingScope