1//===-- XCoreTargetObjectFile.cpp - XCore object files --------------------===// 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 7//===----------------------------------------------------------------------===// 44 ReadOnlySectionLarge =
60// TextSection - see MObjectFileInfo.cpp 61// StaticCtorSection - see MObjectFileInfo.cpp 62// StaticDtorSection - see MObjectFileInfo.cpp 87if (K.isMergeableCString() || K.isMergeableConst4() ||
88 K.isMergeableConst8() || K.isMergeableConst16())
91if (K.isMergeableCString())
100// Infer section flags from the section name if we can. 102if (IsCPRel && !Kind.isReadOnly())
126if (Kind.isBSS() || Kind.isCommon())
returnBSSSection;
131if (Kind.isReadOnly())
return UseCPRel? ReadOnlySectionLarge
132 : DataRelROSectionLarge;
133if (Kind.isBSS() || Kind.isCommon())
return BSSSectionLarge;
135return DataSectionLarge;
136if (Kind.isReadOnlyWithRel())
return DataRelROSectionLarge;
139assert((Kind.isThreadLocal() || Kind.isCommon()) &&
"Unknown section kind");
145Align &Alignment)
const{
149assert((Kind.isReadOnly() || Kind.isReadOnlyWithRel()) &&
150"Unknown section kind");
151// We assume the size of the object is never greater than CodeModelLargeSize. 152// To handle CodeModelLargeSize changes to AsmPrinter would be required. MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned getXCoreSectionType(SectionKind K)
static unsigned getXCoreSectionFlags(SectionKind K, bool IsCPRel)
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
StringRef getSection() const
Get the custom section of this global if it has one.
bool hasLocalLinkage() const
const DataLayout & getDataLayout() const
Get the data layout of the module this global belongs to.
Type * getValueType() const
Context object for machine code objects.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
MCSection * MergeableConst16Section
MCSection * MergeableConst4Section
MCSection * TextSection
Section directive for standard text.
MCSection * MergeableConst8Section
MCSection * DataRelROSection
MCSection * CStringSection
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
MCSection * BSSSection
Section that is default initialized to zero.
MCContext & getContext() const
MCSection * DataSection
Section directive for standard data.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
SectionKind - This is a simple POD value that classifies the properties of a section.
StringRef - Represent a constant reference to a string, i.e.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
Primary interface to the complete machine description for the target machine.
CodeModel::Model getCodeModel() const
Returns the code model.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
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...
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const override
Given a constant with the SectionKind, return a section that it should be placed in.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
@ C
The default llvm calling convention, compatible with C.
@ XCORE_SHF_DP_SECTION
All sections with the "d" flag are grouped together by the linker to form the data section and the dp...
@ XCORE_SHF_CP_SECTION
All sections with the "c" flag are grouped together by the linker to form the constant pool and the c...
This is an optimization pass for GlobalISel generic memory operations.
static const unsigned CodeModelLargeSize
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This struct is a compact representation of a valid (non-zero power of two) alignment.