LLVM 22.0.0git
MCSymbolGOFF.h
Go to the documentation of this file.
1//===-- llvm/MC/MCSymbolGOFF.h - GOFF Machine Code Symbols ------*- 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 contains the MCSymbolGOFF class
11///
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_MC_MCSYMBOLGOFF_H
14#define LLVM_MC_MCSYMBOLGOFF_H
15
20#include "llvm/MC/MCSymbol.h"
22
23namespace llvm {
24
25class MCSymbolGOFF : public MCSymbol {
26 // Associated data area of the section. Needs to be emitted first.
27 MCSectionGOFF *ADA = nullptr;
28
31
32 enum SymbolFlags : uint16_t {
33 SF_Hidden = 0x01, // Symbol is hidden, aka not exported.
34 SF_Weak = 0x02, // Symbol is weak.
35 };
36
37public:
40
41 void setADA(MCSectionGOFF *AssociatedDataArea) {
42 ADA = AssociatedDataArea;
43 AssociatedDataArea->RequiresNonZeroLength = true;
44 }
45 MCSectionGOFF *getADA() const { return ADA; }
46
47 bool isExternal() const { return IsExternal; }
48 void setExternal(bool Value) const { IsExternal = Value; }
49
50 void setHidden(bool Value = true) {
51 modifyFlags(Value ? SF_Hidden : 0, SF_Hidden);
52 }
53 bool isHidden() const { return getFlags() & SF_Hidden; }
54 bool isExported() const { return !isHidden(); }
55
56 void setWeak(bool Value = true) { modifyFlags(Value ? SF_Weak : 0, SF_Weak); }
57 bool isWeak() const { return getFlags() & SF_Weak; }
58
60 GOFF::ESDExecutable getCodeData() const { return CodeData; }
61
63 GOFF::ESDLinkageType getLinkage() const { return Linkage; }
64
71
76
78
79 bool isInEDSection() const {
80 return isInSection() && static_cast<MCSectionGOFF &>(getSection()).isED();
81 }
82};
83} // end namespace llvm
84
85#endif
This file declares the MCSectionGOFF class, which contains all of the necessary machine code sections...
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:69
MCSymbolGOFF(const MCSymbolTableEntry *Name, bool IsTemporary)
GOFF::ESDExecutable getCodeData() const
void setWeak(bool Value=true)
void setExternal(bool Value) const
bool isExported() const
GOFF::ESDBindingStrength getBindingStrength() const
bool isHidden() const
bool isInEDSection() const
void setHidden(bool Value=true)
GOFF::ESDBindingScope getBindingScope() const
bool isExternal() const
void setCodeData(GOFF::ESDExecutable Value)
void setADA(MCSectionGOFF *AssociatedDataArea)
bool setSymbolAttribute(MCSymbolAttr Attribute)
GOFF::ESDLinkageType getLinkage() const
bool isWeak() const
void setLinkage(GOFF::ESDLinkageType Value)
MCSectionGOFF * getADA() const
MCSymbol(const MCSymbolTableEntry *Name, bool isTemporary)
Definition MCSymbol.h:146
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Definition MCSymbol.h:233
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition MCSymbol.h:237
void modifyFlags(uint32_t Value, uint32_t Mask) const
Modify the flags via a mask.
Definition MCSymbol.h:375
uint32_t getFlags() const
Get the (implementation defined) symbol flags.
Definition MCSymbol.h:366
unsigned IsExternal
True if this symbol is visible outside this translation unit.
Definition MCSymbol.h:87
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
Definition MCSymbol.h:251
unsigned IsTemporary
IsTemporary - True if this is an assembler temporary label, which typically does not survive in the ....
Definition MCSymbol.h:78
const MCExpr * Value
If non-null, the value for a variable symbol.
Definition MCSymbol.h:130
ESDExecutable
Definition GOFF.h:109
@ ESD_EXE_Unspecified
Definition GOFF.h:110
ESDBindingScope
Definition GOFF.h:134
@ ESD_BSC_Library
Definition GOFF.h:138
@ ESD_BSC_ImportExport
Definition GOFF.h:139
@ ESD_BSC_Section
Definition GOFF.h:136
ESDLinkageType
Definition GOFF.h:142
@ ESD_LT_XPLink
Definition GOFF.h:142
ESDBindingStrength
Definition GOFF.h:122
@ ESD_BST_Strong
Definition GOFF.h:123
@ ESD_BST_Weak
Definition GOFF.h:124
This is an optimization pass for GlobalISel generic memory operations.
StringMapEntry< MCSymbolTableValue > MCSymbolTableEntry
MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator new).