62 using namespace dwarf;
69 for (
const auto &MFE: ModuleFlags) {
75 if (Key ==
"Objective-C Image Info Version") {
76 Version = mdconst::extract<ConstantInt>(MFE.Val)->getZExtValue();
77 }
else if (Key ==
"Objective-C Garbage Collection" ||
78 Key ==
"Objective-C GC Only" ||
79 Key ==
"Objective-C Is Simulated" ||
80 Key ==
"Objective-C Class Properties" ||
81 Key ==
"Objective-C Image Swift Version") {
82 Flags |= mdconst::extract<ConstantInt>(MFE.Val)->getZExtValue();
83 }
else if (Key ==
"Objective-C Image Info Section") {
84 Section = cast<MDString>(MFE.Val)->getString();
103 auto &
C = getContext();
115 unsigned Encoding = getPersonalityEncoding();
117 return getContext().getOrCreateSymbol(
StringRef(
"DW.ref.") +
129 cast<MCSymbolELF>(getContext().getOrCreateSymbol(NameData));
152 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV,
".DW.stub", TM);
164 Encoding & ~DW_EH_PE_indirect, Streamer);
184 if (Name.
empty() || Name[0] !=
'.')
return K;
187 if (Name ==
".bss" ||
197 if (Name ==
".tdata" ||
203 if (Name ==
".tbss" ||
219 if (Name ==
".init_array")
222 if (Name ==
".fini_array")
225 if (Name ==
".preinit_array")
268 C->
getName() +
"' cannot be lowered.");
301 if (
Attrs.hasAttribute(
"bss-section") && Kind.
isBSS()) {
302 SectionName =
Attrs.getAttribute(
"bss-section").getValueAsString();
303 }
else if (
Attrs.hasAttribute(
"rodata-section") && Kind.
isReadOnly()) {
304 SectionName =
Attrs.getAttribute(
"rodata-section").getValueAsString();
305 }
else if (
Attrs.hasAttribute(
"data-section") && Kind.
isData()) {
306 SectionName =
Attrs.getAttribute(
"data-section").getValueAsString();
320 Group =
C->getName();
328 if (AssociatedSymbol) {
329 UniqueID = NextUniqueID++;
335 0, Group, UniqueID, AssociatedSymbol);
358 return ".data.rel.ro";
364 unsigned *NextUniqueID,
const MCSymbolELF *AssociatedSymbol) {
365 unsigned EntrySize = 0;
391 Group =
C->getName();
401 cast<GlobalVariable>(GO));
403 std::string SizeSpec =
".rodata.str" +
utostr(EntrySize) +
".";
404 Name = SizeSpec +
utostr(Align);
406 Name =
".rodata.cst";
407 Name +=
utostr(EntrySize);
412 if (
const auto *
F = dyn_cast<Function>(GO)) {
413 const auto &OptionalPrefix =
F->getSectionPrefix();
415 Name += *OptionalPrefix;
418 if (EmitUniqueSection && UniqueSectionNames) {
423 if (EmitUniqueSection && !UniqueSectionNames) {
424 UniqueID = *NextUniqueID;
431 EntrySize, Group, UniqueID, AssociatedSymbol);
440 bool EmitUniqueSection =
false;
450 if (AssociatedSymbol) {
451 EmitUniqueSection =
true;
456 getContext(), GO, Kind, getMangler(), TM, EmitUniqueSection, Flags,
457 &NextUniqueID, AssociatedSymbol);
468 if (!EmitUniqueSection)
469 return ReadOnlySection;
472 getMangler(), TM, EmitUniqueSection,
478 bool UsesLabelDifference,
const Function &
F)
const {
488 unsigned &
Align)
const {
490 return MergeableConst4Section;
492 return MergeableConst8Section;
494 return MergeableConst16Section;
496 return MergeableConst32Section;
498 return ReadOnlySection;
501 return DataRelROSection;
505 bool IsCtor,
unsigned Priority,
518 Name =
".init_array";
521 Name =
".fini_array";
523 if (Priority != 65535) {
534 if (Priority != 65535) {
536 Name +=
utostr(65535 - Priority);
545 unsigned Priority,
const MCSymbol *KeySym)
const {
551 unsigned Priority,
const MCSymbol *KeySym)
const {
578 UseInitArray = UseInitArray_;
626 for (
const auto &Option : LinkerOptions->operands()) {
628 for (
const auto &Piece : cast<MDNode>(Option)->operands())
629 StrOptions.
push_back(cast<MDString>(Piece)->getString());
634 unsigned VersionVal = 0;
635 unsigned ImageInfoFlags = 0;
641 if (SectionVal.
empty())
645 unsigned TAA = 0, StubSize = 0;
647 std::string ErrorCode =
649 TAA, TAAParsed, StubSize);
650 if (!ErrorCode.empty())
660 getOrCreateSymbol(
StringRef(
"L_OBJC_IMAGE_INFO")));
672 "' cannot be lowered.");
679 unsigned TAA = 0, StubSize = 0;
684 std::string ErrorCode =
686 TAA, TAAParsed, StubSize);
687 if (!ErrorCode.empty()) {
690 "' has an invalid section specifier '" +
709 "' section type or attributes does not match previous"
710 " section specifier");
738 cast<GlobalVariable>(GO)) < 32)
746 cast<GlobalVariable>(GO)) < 32)
786 unsigned &
Align)
const {
822 Encoding & ~DW_EH_PE_indirect, Streamer);
889 MCSymbol *Stub = Ctx.getOrCreateSymbol(Name);
894 StubValueTy(const_cast<MCSymbol *>(Sym),
true );
925 bool CannotUsePrivateLabel =
true;
929 CannotUsePrivateLabel =
978 assert(C &&
"expected GV to have a Comdat!");
984 "' does not exist.");
988 "' is not a key for its COMDAT.");
996 if (
const auto *GA = dyn_cast<GlobalAlias>(ComdatKey))
998 if (ComdatKey == GV) {
999 switch (
C->getSelectionKind()) {
1034 COMDATSymName = Sym->
getName();
1061 bool EmitUniquedSection;
1082 if (EmitUniquedSection)
1083 UniqueID = NextUniqueID++;
1089 COMDATSymName, Selection, UniqueID);
1094 Selection, UniqueID);
1119 bool CannotUsePrivateLabel =
false;
1123 CannotUsePrivateLabel =
true;
1134 if (!EmitUniqueSection)
1148 unsigned UniqueID = NextUniqueID++;
1162 for (
const auto &Option : LinkerOptions->operands()) {
1163 for (
const auto &Piece : cast<MDNode>(Option)->operands()) {
1165 std::string Directive(
" ");
1166 Directive.append(cast<MDString>(Piece)->getString());
1177 if (Section.
empty())
1181 auto *S =
C.getCOFFSection(
1217 unsigned Priority,
const MCSymbol *KeySym)
const {
1223 unsigned Priority,
const MCSymbol *KeySym)
const {
1244 C->
getName() +
"' cannot be lowered.");
1259 unsigned Flags,
unsigned *NextUniqueID) {
1267 if (
const auto *
F = dyn_cast<Function>(GO)) {
1268 const auto &OptionalPrefix =
F->getSectionPrefix();
1270 Name += *OptionalPrefix;
1273 if (EmitUniqueSection && UniqueSectionNames) {
1278 if (EmitUniqueSection && !UniqueSectionNames) {
1279 UniqueID = *NextUniqueID;
1294 bool EmitUniqueSection =
false;
1302 EmitUniqueSection, 0,
1307 bool UsesLabelDifference,
const Function &
F)
const {
void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const override
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
Tracking metadata reference owned by Metadata.
static SectionKind getData()
bool isMergeableConst() const
StringRef getPrivateGlobalPrefix() const
static MCSectionELF * selectELFSectionForGlobal(MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, bool EmitUniqueSection, unsigned Flags, unsigned *NextUniqueID, const MCSymbolELF *AssociatedSymbol)
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
This represents a section on a Mach-O system (used by Mac OS X).
MCSectionWasm * getWasmSection(const Twine &Section, unsigned Type, unsigned Flags)
MCSection * getSectionForJumpTable(const Function &F, const TargetMachine &TM) const override
const MCSymbol & getSymbol() const
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
MCSection * getStaticCtorSection(unsigned Priority, const MCSymbol *KeySym) const override
cl::opt< bool > UniqueSectionNames("unique-section-names", cl::desc("Give unique names to every section"), cl::init(true))
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
.type _foo, STT_OBJECT # aka
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
void emitLinkerFlagsForGlobal(raw_ostream &OS, const GlobalValue *GV) const override
virtual void AddBlankLine()
AddBlankLine - Emit a blank line to a .s file to pretty it up.
MCSection * ConstDataSection
MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const override
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
MCSection * SixteenByteConstantSection
MCSymbol * getSymbol(const GlobalValue *GV) const
MCSection * TextSection
Section directive for standard text.
MCSection * StaticCtorSection
This section contains the static constructor pointer list.
MCSection * ConstTextCoalSection
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Mangler & getMangler() const
MCSection * DataCoalSection
Type * getValueType() const
static void checkMachOComdat(const GlobalValue *GV)
bool isMergeable2ByteCString() const
MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const override
bool isReadOnlyWithRel() const
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
The data referenced by the COMDAT must be the same size.
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const
True if the section is atomized using the symbols in it.
std::string getInstrProfSectionName(InstrProfSectKind IPSK, Triple::ObjectFormatType OF, bool AddSegmentInfo=true)
Return the name of the profile section corresponding to IPSK.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym) const override
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const override
Given a constant with the SectionKind, return a section that it should be placed in.
MCSection * getSectionForJumpTable(const Function &F, const TargetMachine &TM) const override
const MCExpr * getIndirectSymViaGOTPCRel(const MCSymbol *Sym, const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
Get MachO PC relative GOT entry relocation.
const Comdat * getComdat() const
static bool isThumb(const MCSubtargetInfo &STI)
bool isMergeableCString() const
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
StringRef getName() const
Return a constant reference to the value's name.
MCSectionCOFF * getAssociativeCOFFSection(MCSectionCOFF *Sec, const MCSymbol *KeySym, unsigned UniqueID=GenericSectionID)
Gets or creates a section equivalent to Sec that is associated with the section containing KeySym...
const Triple & getTargetTriple() const
Adds a requirement that another module flag be present and have a specified value after linking is pe...
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
static SectionKind getBSS()
unsigned getPointerABIAlignment(unsigned AS=0) const
Layout pointer alignment FIXME: The defaults need to be removed once all of the backends/clients are ...
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
MCSection * SectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const
This method computes the appropriate section to emit the specified global variable or function defini...
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
Base class for the full range of assembler expressions which are needed for parsing.
const MCExpr * getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const
const Module * getModule() const
The linker may choose any COMDAT.
const GlobalObject * getBaseObject() const
const MCExpr * lowerRelativeReference(const GlobalValue *LHS, const GlobalValue *RHS, const TargetMachine &TM) const override
MCSection * EightByteConstantSection
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
StringRef getName() const
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
bool hasPrivateLinkage() const
static const GlobalValue * getComdatGVForCOFF(const GlobalValue *GV)
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Context object for machine code objects.
bool isMergeable4ByteCString() const
bool isMergeableConst32() const
MCSection * DataCommonSection
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
PointerTy getPointer() const
MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
MCSection * StaticDtorSection
This section contains the static destructor pointer list.
MCSection * getStaticDtorSection(unsigned Priority, const MCSymbol *KeySym) const override
static void GetObjCImageInfo(Module &M, unsigned &Version, unsigned &Flags, StringRef &Section)
StringRef getSection() const
Get the custom section of this global if it has one.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
static std::string utostr(uint64_t X, bool isNeg=false)
unsigned getStubSize() const
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
void emitModuleMetadata(MCStreamer &Streamer, Module &M, const TargetMachine &TM) const override
Emit the module flags that specify the garbage collection information.
AttributeSet getAttributes() const
Return the attribute set for this global.
static SectionKind getThreadData()
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MCContext & getContext() const
This file contains the declaration of the Comdat class, which represents a single COMDAT in LLVM...
const Triple & getTargetTriple() const
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
MCSection * DataSection
Section directive for standard data.
bool isMergeableConst16() const
void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const override
static bool isWeakForLinker(LinkageTypes Linkage)
Whether the definition of this global may be replaced at link time.
const MCSymbol * getAssociatedSymbol() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
S_ATTR_NO_DEAD_STRIP - No dead stripping.
void emitModuleMetadata(MCStreamer &Streamer, Module &M, const TargetMachine &TM) const override
Emit Obj-C garbage collection and linker options.
static const Comdat * getWasmComdat(const GlobalValue *GV)
No other Module may specify this COMDAT.
Streaming machine code generation interface.
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
static std::string ParseSectionSpecifier(StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, bool &TAAParsed, unsigned &StubSize)
Parse the section specifier indicated by "Spec".
PointerIntPair - This class implements a pair of a pointer and small integer.
const Comdat * getComdat() const
This is an important base class in LLVM.
void getModuleFlagsMetadata(SmallVectorImpl< ModuleFlagEntry > &Flags) const
Returns the module flags in the provided vector.
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
This represents a section on wasm.
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
Return an MCExpr to use for a reference to the specified type info global variable from exception han...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool hasAttribute(unsigned Value) const
bool isThreadData() const
static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K)
bool isMergeable1ByteCString() const
void InitializeELF(bool UseInitArray_)
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
void emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV, const Triple &TT, Mangler &Mangler)
SectionKind - This is a simple POD value that classifies the properties of a section.
MCSection * UStringSection
MCSection * getDrectveSection() const
SelectionKind getSelectionKind() const
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const override
Given a constant with the SectionKind, return a section that it should be placed in.
Ty & getObjFileInfo()
Keep track of various per-function pieces of information for backends that would like to do so...
The data referenced by the COMDAT must be the same.
bool isExecuteOnly() const
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
bool getFunctionSections() const
Return true if functions should be emitted into their own section, corresponding to -ffunction-sectio...
const MCSymbolRefExpr * getSymB() const
StubValueTy & getGVStubEntry(MCSymbol *Sym)
static const char * getCOFFSectionNameForUniqueGlobal(SectionKind Kind)
StubValueTy & getGVStubEntry(MCSymbol *Sym)
MCSection * getStaticDtorSection(unsigned Priority, const MCSymbol *KeySym) const override
virtual const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const
Return an MCExpr to use for a reference to the specified global variable from exception handling info...
bool isThreadLocal() const
unsigned getPreferredAlignment(const GlobalVariable *GV) const
Returns the preferred alignment of the specified global.
Triple - Helper class for working with autoconf configuration names.
bool getDataSections() const
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections...
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
The mach-o version of this method defaults to returning a stub reference.
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, const Function &F) const override
static const MCSymbolELF * getAssociatedSymbol(const GlobalObject *GO, const TargetMachine &TM)
bool hasExternalLinkage() const
const MDOperand & getOperand(unsigned I) const
bool hasGlobalUnnamedAddr() const
static SectionKind getThreadBSS()
bool isFunctionTy() const
True if this is an instance of FunctionType.
static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo, const MCSection &Section)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
static MCSectionWasm * selectWasmSectionForGlobal(MCContext &Ctx, const GlobalObject *GO, SectionKind Kind, Mangler &Mang, const TargetMachine &TM, bool EmitUniqueSection, unsigned Flags, unsigned *NextUniqueID)
static SectionKind getMetadata()
MCSection * DataBSSSection
static const Comdat * getELFComdat(const GlobalValue *GV)
The linker will choose the largest COMDAT.
bool getUniqueSectionNames() const
bool isMergeableConst8() const
TargetLoweringObjectFileMachO()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static StringRef getSectionPrefixForGlobal(SectionKind Kind)
Return the section prefix name used by options FunctionsSections and DataSections.
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
MCSection * FourByteConstantSection
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
static std::vector< std::string > Flags
const MCExpr * lowerRelativeReference(const GlobalValue *LHS, const GlobalValue *RHS, const TargetMachine &TM) const override
bool hasImplicitSection() const
Check if section name is present.
PointerType * getType() const
Global values are always pointers.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
NamedMDNode * getNamedMetadata(const Twine &Name) const
Return the first NamedMDNode in the module with the specified name.
StringRef getName() const
getName - Get the symbol name.
MCSection * getStaticCtorSection(unsigned Priority, const MCSymbol *KeySym) const override
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
virtual void EmitLinkerOptions(ArrayRef< std::string > Kind)
Emit the given list Options of strings as linker options into the output.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
static int getSelectionForCOFF(const GlobalValue *GV)
void emitModuleMetadata(MCStreamer &Streamer, Module &M, const TargetMachine &TM) const override
Emit Obj-C garbage collection and linker options.
COFFYAML::WeakExternalCharacteristics Characteristics
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
static unsigned getCOFFSectionFlags(SectionKind K, const TargetMachine &TM)
This represents a section on linux, lots of unix variants and some bare metal systems.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets...
bool hasLocalLinkage() const
StringRef getValueAsString() const
Return the attribute's value as a string.
MCSymbol * getSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix, const TargetMachine &TM) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffi...
MCSection * TLSBSSSection
Section directive for Thread Local uninitialized data.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCSection * TextCoalSection
int64_t getConstant() const
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
unsigned getTypeAndAttributes() const
static MCSectionELF * getStaticStructorSection(MCContext &Ctx, bool UseInitArray, bool IsCtor, unsigned Priority, const MCSymbol *KeySym)
Module * getParent()
Get the module that this global value is contained inside of...
MCSection * CStringSection
bool isMergeableConst4() const
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool isWindowsItaniumEnvironment() const
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
This class implements an extremely fast bulk output stream that can only output to a stream...
bool SupportIndirectSymViaGOTPCRel
Primary interface to the complete machine description for the target machine.
MCSection * BSSSection
Section that is default initialized to zero.
StringRef - Represent a constant reference to a string, i.e.
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
static unsigned getELFSectionFlags(SectionKind K)
static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)
Classify the specified global variable into a set of target independent categories embodied in Sectio...
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
static SectionKind getReadOnly()
static unsigned getELFSectionType(StringRef Name, SectionKind K)
This class can be derived from and used by targets to hold private target-specific information for ea...
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type. ...
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
This class contains meta information specific to a module.
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, const Function &F) const override