16#ifndef LLVM_MC_MCLINKEROPTIMIZATIONHINT_H
17#define LLVM_MC_MCLINKEROPTIMIZATIONHINT_H
27class MachObjectWriter;
53#define MCLOHCaseNameToId(Name) .Case(#Name, MCLOH_ ## Name)
64#undef MCLOHCaseNameToId
68#define MCLOHCaseIdToName(Name) case MCLOH_ ## Name: return StringRef(#Name);
80#undef MCLOHCaseIdToName
118 : Kind(Kind), Args(Args.begin(), Args.end()) {
164 EmitSize +=
D.getEmitSize(Asm, ObjWriter);
173 D.emit(Asm, ObjWriter);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define MCLOHCaseIdToName(Name)
#define MCLOHCaseNameToId(Name)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
void emit(const MCAssembler &Asm, MachObjectWriter &ObjWriter) const
Emit all Linker Optimization Hint in one big table.
SmallVectorImpl< MCLOHDirective > LOHDirectives
const LOHDirectives & getDirectives() const
Const accessor to the directives.
uint64_t getEmitSize(const MCAssembler &Asm, const MachObjectWriter &ObjWriter) const
Get the size of the directives if emitted.
void addDirective(MCLOHType Kind, const MCLOHDirective::LOHArgs &Args)
Add the directive of the given kind Kind with the given arguments Args to the container.
Store Linker Optimization Hint information (LOH).
uint64_t getEmitSize(const MCAssembler &Asm, const MachObjectWriter &ObjWriter) const
Get the size in bytes of this directive if emitted in ObjWriter with the given Layout.
const LOHArgs & getArgs() const
void emit(const MCAssembler &Asm, MachObjectWriter &ObjWriter) const
Emit this directive as: <kind, numArgs, addr1, ..., addrN>
MCLOHType getKind() const
MCLOHDirective(MCLOHType Kind, const LOHArgs &Args)
SmallVectorImpl< MCSymbol * > LOHArgs
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
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.
A switch()-like statement whose cases are string literals.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
static int MCLOHNameToId(StringRef Name)
static StringRef MCLOHDirectiveName()
static bool isValidMCLOHType(unsigned Kind)
static int MCLOHIdToNbArgs(MCLOHType Kind)
MCLOHType
Linker Optimization Hint Type.
@ MCLOH_AdrpAddLdr
Adrp _v@PAGE -> Add _v@PAGEOFF -> Ldr.
@ MCLOH_AdrpLdrGotStr
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF -> Str.
@ MCLOH_AdrpLdrGotLdr
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF -> Ldr.
@ MCLOH_AdrpLdrGot
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF.
@ MCLOH_AdrpLdr
Adrp _v@PAGE -> Ldr _v@PAGEOFF.
@ MCLOH_AdrpAdd
Adrp _v@PAGE -> Add _v@PAGEOFF.
@ MCLOH_AdrpAddStr
Adrp _v@PAGE -> Add _v@PAGEOFF -> Str.
@ MCLOH_AdrpAdrp
Adrp xY, _v1@PAGE -> Adrp xY, _v2@PAGE.
static StringRef MCLOHIdToName(MCLOHType Kind)