LLVM 23.0.0git
TargetLoweringObjectFile.cpp
Go to the documentation of this file.
1//===-- llvm/Target/TargetLoweringObjectFile.cpp - Object File Info -------===//
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// This file implements classes used to handle lowerings specific to common
10// object file formats.
11//
12//===----------------------------------------------------------------------===//
13
16#include "llvm/IR/Constants.h"
17#include "llvm/IR/DataLayout.h"
19#include "llvm/IR/Function.h"
20#include "llvm/IR/GlobalValue.h"
22#include "llvm/IR/Mangler.h"
23#include "llvm/IR/Module.h"
24#include "llvm/MC/MCAsmInfo.h"
25#include "llvm/MC/MCContext.h"
26#include "llvm/MC/MCExpr.h"
27#include "llvm/MC/MCStreamer.h"
28#include "llvm/MC/SectionKind.h"
32using namespace llvm;
33
34//===----------------------------------------------------------------------===//
35// Generic Code
36//===----------------------------------------------------------------------===//
37
38/// Initialize - this method must be called before any actual lowering is
39/// done. This specifies the current context for codegen, and gives the
40/// lowering implementations a chance to set up their default sections.
42 const TargetMachine &TM) {
43 // `Initialize` can be called more than once.
44 delete Mang;
45 Mang = new Mangler();
46 initMCObjectFileInfo(ctx, TM.isPositionIndependent(),
47 TM.getCodeModel() == CodeModel::Large);
48
49 // Reset various EH DWARF encodings.
52
53 this->TM = &TM;
54}
55
59
61 // If target does not have LEB128 directives, we would need the
62 // call site encoding to be udata4 so that the alternative path
63 // for not having LEB128 directives could work.
64 if (!getContext().getAsmInfo()->hasLEB128Directives())
66 return CallSiteEncoding;
67}
68
69static bool isNullOrUndef(const Constant *C) {
70 // Check that the constant isn't all zeros or undefs.
71 if (C->isNullValue() || isa<UndefValue>(C))
72 return true;
74 return false;
75 for (const auto *Operand : C->operand_values()) {
76 if (!isNullOrUndef(cast<Constant>(Operand)))
77 return false;
78 }
79 return true;
80}
81
82static bool isSuitableForBSS(const GlobalVariable *GV) {
83 const Constant *C = GV->getInitializer();
84
85 // Must have zero initializer.
86 if (!isNullOrUndef(C))
87 return false;
88
89 // Leave constant zeros in readonly constant sections, so they can be shared.
90 if (GV->isConstant())
91 return false;
92
93 // If the global has an explicit section specified, don't put it in BSS.
94 if (GV->hasSection())
95 return false;
96
97 // Otherwise, put it in BSS!
98 return true;
99}
100
101/// IsNullTerminatedString - Return true if the specified constant (which is
102/// known to have a type that is an array of 1/2/4 byte elements) ends with a
103/// nul value and contains no other nuls in it. Note that this is more general
104/// than ConstantDataSequential::isString because we allow 2 & 4 byte strings.
105static bool IsNullTerminatedString(const Constant *C) {
106 // First check: is we have constant array terminated with zero
108 uint64_t NumElts = CDS->getNumElements();
109 assert(NumElts != 0 && "Can't have an empty CDS");
110
111 if (CDS->getElementAsInteger(NumElts-1) != 0)
112 return false; // Not null terminated.
113
114 // Verify that the null doesn't occur anywhere else in the string.
115 for (uint64_t i = 0; i != NumElts - 1; ++i)
116 if (CDS->getElementAsInteger(i) == 0)
117 return false;
118 return true;
119 }
120
121 // Another possibility: [1 x i8] zeroinitializer
123 return cast<ArrayType>(C->getType())->getNumElements() == 1;
124
125 return false;
126}
127
129 const GlobalValue *GV, StringRef Suffix, const TargetMachine &TM) const {
130 assert(!Suffix.empty());
131
132 SmallString<60> NameStr;
133 NameStr += GV->getDataLayout().getPrivateGlobalPrefix();
134 TM.getNameWithPrefix(NameStr, GV, *Mang);
135 NameStr.append(Suffix.begin(), Suffix.end());
136 return getContext().getOrCreateSymbol(NameStr);
137}
138
140 const GlobalValue *GV, const TargetMachine &TM,
141 MachineModuleInfo *MMI) const {
142 return TM.getSymbol(GV);
143}
144
146 MCStreamer &Streamer, const DataLayout &, const MCSymbol *Sym,
147 const MachineModuleInfo *MMI) const {}
148
150 Module &M) const {
153 M.getModuleFlagsMetadata(ModuleFlags);
154
155 MDNode *CGProfile = nullptr;
156
157 for (const auto &MFE : ModuleFlags) {
158 StringRef Key = MFE.Key->getString();
159 if (Key == "CG Profile") {
160 CGProfile = cast<MDNode>(MFE.Val);
161 break;
162 }
163 }
164
165 if (!CGProfile)
166 return;
167
168 auto GetSym = [this](const MDOperand &MDO) -> MCSymbol * {
169 if (!MDO)
170 return nullptr;
171 auto *V = cast<ValueAsMetadata>(MDO);
172 const Function *F = cast<Function>(V->getValue()->stripPointerCasts());
173 if (F->hasDLLImportStorageClass())
174 return nullptr;
175 return TM->getSymbol(F);
176 };
177
178 for (const auto &Edge : CGProfile->operands()) {
179 MDNode *E = cast<MDNode>(Edge);
180 const MCSymbol *From = GetSym(E->getOperand(0));
181 const MCSymbol *To = GetSym(E->getOperand(1));
182 // Skip null functions. This can happen if functions are dead stripped after
183 // the CGProfile pass has been run.
184 if (!From || !To)
185 continue;
186 uint64_t Count = cast<ConstantAsMetadata>(E->getOperand(2))
187 ->getValue()
188 ->getUniqueInteger()
189 .getZExtValue();
192 }
193}
194
196 MCStreamer &Streamer, Module &M,
197 std::function<void(MCStreamer &Streamer)> COMDATSymEmitter) const {
198 NamedMDNode *FuncInfo = M.getNamedMetadata(PseudoProbeDescMetadataName);
199 if (!FuncInfo)
200 return;
201
202 // Emit a descriptor for every function including functions that have an
203 // available external linkage. We may not want this for imported functions
204 // that has code in another thinLTO module but we don't have a good way to
205 // tell them apart from inline functions defined in header files. Therefore
206 // we put each descriptor in a separate comdat section and rely on the
207 // linker to deduplicate.
208 auto &C = getContext();
209 for (const auto *Operand : FuncInfo->operands()) {
210 const auto *MD = cast<MDNode>(Operand);
211 auto *GUID = mdconst::extract<ConstantInt>(MD->getOperand(0));
212 auto *Hash = mdconst::extract<ConstantInt>(MD->getOperand(1));
213 auto *Name = cast<MDString>(MD->getOperand(2));
214 auto *S = C.getObjectFileInfo()->getPseudoProbeDescSection(
215 TM->getFunctionSections() ? Name->getString() : StringRef());
216
217 Streamer.switchSection(S);
218
219 // emit COFF COMDAT symbol.
220 if (COMDATSymEmitter)
221 COMDATSymEmitter(Streamer);
222
223 Streamer.emitInt64(GUID->getZExtValue());
224 Streamer.emitInt64(Hash->getZExtValue());
225 Streamer.emitULEB128IntValue(Name->getString().size());
226 Streamer.emitBytes(Name->getString());
227 }
228}
229
230static bool containsConstantPtrAuth(const Constant *C) {
232 return true;
233
235 return false;
236
237 for (const Value *Op : C->operands())
239 return true;
240
241 return false;
242}
243
244/// getKindForGlobal - This is a top-level target-independent classifier for
245/// a global object. Given a global variable and information from the TM, this
246/// function classifies the global in a target independent manner. This function
247/// may be overridden by the target implementation.
249 const TargetMachine &TM){
251 "Can only be used for global definitions");
252
253 // Functions are classified as text sections.
254 if (isa<Function>(GO))
255 return SectionKind::getText();
256
257 // Basic blocks are classified as text sections.
258 if (isa<BasicBlock>(GO))
259 return SectionKind::getText();
260
261 // Global variables require more detailed analysis.
262 const auto *GVar = cast<GlobalVariable>(GO);
263
264 // Handle thread-local data first.
265 if (GVar->isThreadLocal()) {
266 if (isSuitableForBSS(GVar) && !TM.Options.NoZerosInBSS) {
267 // Zero-initialized TLS variables with local linkage always get classified
268 // as ThreadBSSLocal.
269 if (GVar->hasLocalLinkage()) {
271 }
273 }
275 }
276
277 // Variables with common linkage always get classified as common.
278 if (GVar->hasCommonLinkage())
279 return SectionKind::getCommon();
280
281 // Most non-mergeable zero data can be put in the BSS section unless otherwise
282 // specified.
283 if (isSuitableForBSS(GVar) && !TM.Options.NoZerosInBSS) {
284 if (GVar->hasLocalLinkage())
286 else if (GVar->hasExternalLinkage())
288 return SectionKind::getBSS();
289 }
290
291 // Global variables with '!exclude' should get the exclude section kind if
292 // they have an explicit section and no other metadata.
293 if (GVar->hasSection())
294 if (MDNode *MD = GVar->getMetadata(LLVMContext::MD_exclude))
295 if (!MD->getNumOperands())
297
298 // If the global is marked constant, we can put it into a mergable section,
299 // a mergable string section, or general .data if it contains relocations.
300 if (GVar->isConstant()) {
301 // If the initializer for the global contains something that requires a
302 // relocation, then we may have to drop this into a writable data section
303 // even though it is marked const.
304 const Constant *C = GVar->getInitializer();
305 if (!C->needsRelocation()) {
306 // If the global is required to have a unique address, it can't be put
307 // into a mergable section: just drop it into the general read-only
308 // section instead.
309 if (!GVar->hasGlobalUnnamedAddr())
311
312 // If initializer is a null-terminated string, put it in a "cstring"
313 // section of the right width.
314 if (ArrayType *ATy = dyn_cast<ArrayType>(C->getType())) {
315 if (IntegerType *ITy =
316 dyn_cast<IntegerType>(ATy->getElementType())) {
317 if ((ITy->getBitWidth() == 8 || ITy->getBitWidth() == 16 ||
318 ITy->getBitWidth() == 32) &&
320 if (ITy->getBitWidth() == 8)
322 if (ITy->getBitWidth() == 16)
324
325 assert(ITy->getBitWidth() == 32 && "Unknown width");
327 }
328 }
329 }
330
331 // Otherwise, just drop it into a mergable constant section. If we have
332 // a section for this size, use it, otherwise use the arbitrary sized
333 // mergable section.
334 switch (
335 GVar->getDataLayout().getTypeAllocSize(C->getType())) {
336 case 4: return SectionKind::getMergeableConst4();
337 case 8: return SectionKind::getMergeableConst8();
338 case 16: return SectionKind::getMergeableConst16();
339 case 32: return SectionKind::getMergeableConst32();
340 default:
342 }
343
344 } else {
345 // The dynamic linker always needs to fix PtrAuth relocations up.
348
349 // In static, ROPI and RWPI relocation models, the linker will resolve
350 // all addresses, so the relocation entries will actually be constants by
351 // the time the app starts up. However, we can't put this into a
352 // mergable section, because the linker doesn't take relocations into
353 // consideration when it tries to merge entries in the section.
354 Reloc::Model ReloModel = TM.getRelocationModel();
355 if (ReloModel == Reloc::Static || ReloModel == Reloc::ROPI ||
356 ReloModel == Reloc::RWPI || ReloModel == Reloc::ROPI_RWPI ||
357 !C->needsDynamicRelocation())
359
360 // Otherwise, the dynamic linker needs to fix it up, put it in the
361 // writable data.rel section.
363 }
364 }
365
366 // Okay, this isn't a constant.
367 return SectionKind::getData();
368}
369
370/// This method computes the appropriate section to emit the specified global
371/// variable or function definition. This should not be passed external (or
372/// available externally) globals.
374 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
375 // Select section name.
376 if (GO->hasSection())
377 return getExplicitSectionGlobal(GO, Kind, TM);
378
379 if (auto *GVar = dyn_cast<GlobalVariable>(GO)) {
380 auto Attrs = GVar->getAttributes();
381 if ((Attrs.hasAttribute("bss-section") && Kind.isBSS()) ||
382 (Attrs.hasAttribute("data-section") && Kind.isData()) ||
383 (Attrs.hasAttribute("relro-section") && Kind.isReadOnlyWithRel()) ||
384 (Attrs.hasAttribute("rodata-section") && Kind.isReadOnly())) {
385 return getExplicitSectionGlobal(GO, Kind, TM);
386 }
387 }
388
389 // Use default section depending on the 'type' of global
390 return SelectSectionForGlobal(GO, Kind, TM);
391}
392
393/// This method computes the appropriate section to emit the specified global
394/// variable or function definition. This should not be passed external (or
395/// available externally) globals.
396MCSection *
401
403 const Function &F, const TargetMachine &TM) const {
404 return getSectionForJumpTable(F, TM, /*JTE=*/nullptr);
405}
406
408 const Function &F, const TargetMachine &TM,
409 const MachineJumpTableEntry *JTE) const {
410 Align Alignment(1);
411 return getSectionForConstant(F.getDataLayout(),
412 SectionKind::getReadOnly(), /*C=*/nullptr,
413 Alignment);
414}
415
417 bool UsesLabelDifference, const Function &F) const {
418 // In PIC mode, we need to emit the jump table to the same section as the
419 // function body itself, otherwise the label differences won't make sense.
420 // FIXME: Need a better predicate for this: what about custom entries?
421 if (UsesLabelDifference)
422 return true;
423
424 // We should also do if the section name is NULL or function is declared
425 // in discardable section
426 // FIXME: this isn't the right predicate, should be based on the MCSection
427 // for the function.
428 return F.isWeakForLinker();
429}
430
431/// Given a mergable constant with the specified size and relocation
432/// information, return a section that it should be placed in.
434 const DataLayout &DL, SectionKind Kind, const Constant *C,
435 Align &Alignment) const {
436 if (Kind.isReadOnly() && ReadOnlySection != nullptr)
437 return ReadOnlySection;
438
439 return DataSection;
440}
441
443 const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment,
444 StringRef SectionPrefix) const {
445 // Fallback to `getSectionForConstant` without `SectionPrefix` parameter if it
446 // is empty.
447 if (SectionPrefix.empty())
448 return getSectionForConstant(DL, Kind, C, Alignment);
450 "TargetLoweringObjectFile::getSectionForConstant that "
451 "accepts SectionPrefix is not implemented for the object file format");
452}
453
459
461 const Function &F, const TargetMachine &TM) const {
462 return nullptr;
463}
464
465/// getTTypeGlobalReference - Return an MCExpr to use for a
466/// reference to the specified global variable from exception
467/// handling information.
469 const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM,
470 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
471 const MCSymbolRefExpr *Ref =
472 MCSymbolRefExpr::create(TM.getSymbol(GV), getContext());
473
474 return getTTypeReference(Ref, Encoding, Streamer);
475}
476
478getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
479 MCStreamer &Streamer) const {
480 switch (Encoding & 0x70) {
481 default:
482 report_fatal_error("We do not support this DWARF encoding yet!");
484 // Do nothing special
485 return Sym;
487 // Emit a label to the streamer for the current position. This gives us
488 // .-foo addressing.
490 Streamer.emitLabel(PCSym);
491 const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
492 return MCBinaryExpr::createSub(Sym, PC, getContext());
493 }
494 }
495}
496
498 // FIXME: It's not clear what, if any, default this should have - perhaps a
499 // null return could mean 'no location' & we should just do that here.
500 return MCSymbolRefExpr::create(Sym, getContext());
501}
502
504 SmallVectorImpl<char> &OutName, const GlobalValue *GV,
505 const TargetMachine &TM) const {
506 Mang->getNameWithPrefix(OutName, GV, /*CannotUsePrivateLabel=*/false);
507}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file contains constants used for implementing Dwarf debug support.
Module.h This file contains the declarations for the Module class.
#define F(x, y, z)
Definition MD5.cpp:54
static bool isNullOrUndef(const Constant *C)
static bool IsNullTerminatedString(const Constant *C)
IsNullTerminatedString - Return true if the specified constant (which is known to have a type that is...
static bool isSuitableForBSS(const GlobalVariable *GV)
static bool containsConstantPtrAuth(const Constant *C)
Class to represent array types.
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
Definition Constants.h:598
This is an important base class in LLVM.
Definition Constant.h:43
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
StringRef getPrivateGlobalPrefix() const
Definition DataLayout.h:302
bool hasSection() const
Check if this global has a custom object file section.
bool isDeclarationForLinker() const
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this global belongs to.
Definition Globals.cpp:132
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
bool isConstant() const
If the value is a global constant, its value is immutable throughout the runtime execution of the pro...
Class to represent integer types.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition MCExpr.h:428
Context object for machine code objects.
Definition MCContext.h:83
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
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.
Definition MCSection.h:517
Streaming machine code generation interface.
Definition MCStreamer.h:220
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
virtual void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
unsigned emitULEB128IntValue(uint64_t Value, unsigned PadTo=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
void emitInt64(uint64_t Value)
Definition MCStreamer.h:751
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Represent a reference to a symbol from inside an expression.
Definition MCExpr.h:190
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition MCExpr.h:214
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
Metadata node.
Definition Metadata.h:1078
ArrayRef< MDOperand > operands() const
Definition Metadata.h:1440
Tracking metadata reference owned by Metadata.
Definition Metadata.h:900
This class contains meta information specific to a module.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A tuple of MDNodes.
Definition Metadata.h:1757
iterator_range< op_iterator > operands()
Definition Metadata.h:1853
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition SectionKind.h:22
static SectionKind getThreadData()
static SectionKind getBSSExtern()
static SectionKind getMergeable2ByteCString()
static SectionKind getExclude()
static SectionKind getBSSLocal()
static SectionKind getMergeableConst4()
static SectionKind getCommon()
static SectionKind getText()
static SectionKind getThreadBSSLocal()
static SectionKind getReadOnlyWithRel()
static SectionKind getData()
static SectionKind getMergeableConst8()
static SectionKind getBSS()
static SectionKind getThreadBSS()
static SectionKind getMergeableConst16()
static SectionKind getMergeable4ByteCString()
static SectionKind getMergeable1ByteCString()
static SectionKind getReadOnly()
static SectionKind getMergeableConst32()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition SmallString.h:26
void append(StringRef RHS)
Append from a StringRef.
Definition SmallString.h:68
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
constexpr bool empty() const
empty - Check if the string is empty.
Definition StringRef.h:143
iterator begin() const
Definition StringRef.h:112
iterator end() const
Definition StringRef.h:114
void emitCGProfileMetadata(MCStreamer &Streamer, Module &M) const
Emit Call Graph Profile metadata.
virtual void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const
unsigned PersonalityEncoding
PersonalityEncoding, LSDAEncoding, TTypeEncoding - Some encoding values for EH.
static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)
Classify the specified global variable into a set of target independent categories embodied in Sectio...
virtual MCSection * getSectionForJumpTable(const Function &F, const TargetMachine &TM) const
virtual bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, const Function &F) const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
virtual MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const =0
virtual MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const
Given a constant with the SectionKind, return a section that it should be placed in.
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...
virtual MCSection * getSectionForMachineBasicBlock(const Function &F, const MachineBasicBlock &MBB, const TargetMachine &TM) const
virtual const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const
Create a symbol reference to describe the given TLS variable when emitting the address in debug info.
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...
virtual MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const =0
Targets should implement this method to assign a section to globals with an explicit section specfied...
void emitPseudoProbeDescMetadata(MCStreamer &Streamer, Module &M, std::function< void(MCStreamer &Streamer)> COMDATSymEmitter=nullptr) const
Emit pseudo_probe_desc metadata.
const MCExpr * getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding, MCStreamer &Streamer) const
virtual void emitPersonalityValue(MCStreamer &Streamer, const DataLayout &TM, const MCSymbol *Sym, const MachineModuleInfo *MMI) const
virtual MCSection * getUniqueSectionForFunction(const Function &F, const TargetMachine &TM) const
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...
Primary interface to the complete machine description for the target machine.
LLVM Value Representation.
Definition Value.h:75
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
@ DW_EH_PE_pcrel
Definition Dwarf.h:879
@ DW_EH_PE_absptr
Definition Dwarf.h:868
@ DW_EH_PE_udata4
Definition Dwarf.h:872
@ DW_EH_PE_uleb128
Definition Dwarf.h:870
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract(Y &&MD)
Extract a Value from Metadata.
Definition Metadata.h:667
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
Definition Error.cpp:163
FunctionAddr VTableAddr Count
Definition InstrProf.h:139
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
@ Ref
The access may reference the value stored in memory.
Definition ModRef.h:32
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
constexpr const char * PseudoProbeDescMetadataName
Definition PseudoProbe.h:26
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
MachineJumpTableEntry - One jump table in the jump table info.