Go to the documentation of this file.
16 #ifndef LLVM_MC_MCLINKEROPTIMIZATIONHINT_H
17 #define LLVM_MC_MCLINKEROPTIMIZATIONHINT_H
27 class 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(ObjWriter, Layout);
173 D.emit(ObjWriter, Layout);
188 #endif // LLVM_MC_MCLINKEROPTIMIZATIONHINT_H
This is an optimization pass for GlobalISel generic memory operations.
const LOHArgs & getArgs() const
MCLOHType
Linker Optimization Hint Type.
SmallVectorImpl< MCSymbol * > LOHArgs
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Emit all Linker Optimization Hint in one big table.
@ MCLOH_AdrpAddLdr
Adrp _v@PAGE -> Add _v@PAGEOFF -> Ldr.
void addDirective(MCLOHType Kind, const MCLOHDirective::LOHArgs &Args)
Add the directive of the given kind Kind with the given arguments Args to the container.
static StringRef MCLOHDirectiveName()
const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
@ MCLOH_AdrpLdrGotLdr
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF -> Ldr.
static StringRef MCLOHIdToName(MCLOHType Kind)
SmallVectorImpl< MCLOHDirective > LOHDirectives
#define MCLOHCaseNameToId(Name)
const LOHDirectives & getDirectives() const
Const accessor to the directives.
static bool isValidMCLOHType(unsigned Kind)
This class implements an extremely fast bulk output stream that can only output to a stream.
#define MCLOHCaseIdToName(Name)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Store Linker Optimization Hint information (LOH).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
@ MCLOH_AdrpAddStr
Adrp _v@PAGE -> Add _v@PAGEOFF -> Str.
static int MCLOHNameToId(StringRef Name)
void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Emit this directive as: <kind, numArgs, addr1, ..., addrN>
static int MCLOHIdToNbArgs(MCLOHType Kind)
StringRef - Represent a constant reference to a string, i.e.
MCLOHDirective(MCLOHType Kind, const LOHArgs &Args)
Encapsulates the layout of an assembly file at a particular point in time.
@ MCLOH_AdrpAdrp
Adrp xY, _v1@PAGE -> Adrp xY, _v2@PAGE.
@ MCLOH_AdrpAdd
Adrp _v@PAGE -> Add _v@PAGEOFF.
@ MCLOH_AdrpLdr
Adrp _v@PAGE -> Ldr _v@PAGEOFF.
@ MCLOH_AdrpLdrGotStr
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF -> Str.
uint64_t getEmitSize(const MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Get the size in bytes of this directive if emitted in ObjWriter with the given Layout.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A switch()-like statement whose cases are string literals.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
@ MCLOH_AdrpLdrGot
Adrp _v@GOTPAGE -> Ldr _v@GOTPAGEOFF.
MCLOHType getKind() const
uint64_t getEmitSize(const MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Get the size of the directives if emitted.