17 #ifndef LLVM_MC_MCLINKEROPTIMIZATIONHINT_H 18 #define LLVM_MC_MCLINKEROPTIMIZATIONHINT_H 29 class MachObjectWriter;
54 #define MCLOHCaseNameToId(Name) .Case(#Name, MCLOH_ ## Name) 68 #define MCLOHCaseIdToName(Name) case MCLOH_ ## Name: return StringRef(#Name); 117 : Kind(Kind), Args(Args.
begin(), Args.
end()) {
137 mutable uint64_t EmitSize = 0;
163 EmitSize +=
D.getEmitSize(ObjWriter, Layout);
172 D.emit(ObjWriter, Layout);
187 #endif // LLVM_MC_MCLINKEROPTIMIZATIONHINT_H const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
This class represents lattice values for constants.
void push_back(const T &Elt)
void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Emit this directive as: <kind, numArgs, addr1, ..., addrN>
Adrp _v -> Add _v -> Ldr.
Adrp _v -> Ldr _v -> Ldr.
Store Linker Optimization Hint information (LOH).
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Encapsulates the layout of an assembly file at a particular point in time.
MCLOHDirective(MCLOHType Kind, const LOHArgs &Args)
#define MCLOHCaseIdToName(Name)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
uint64_t getEmitSize(const MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Get the size of the directives if emitted.
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.
#define MCLOHCaseNameToId(Name)
A switch()-like statement whose cases are string literals.
MCLOHType getKind() const
void emit(MachObjectWriter &ObjWriter, const MCAsmLayout &Layout) const
Emit all Linker Optimization Hint in one big table.
static int MCLOHNameToId(StringRef Name)
MCLOHType
Linker Optimization Hint Type.
const LOHArgs & getArgs() const
Adrp _v -> Add _v -> Str.
void addDirective(MCLOHType Kind, const MCLOHDirective::LOHArgs &Args)
Add the directive of the given kind Kind with the given arguments Args to the container.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static StringRef MCLOHDirectiveName()
SmallVectorImpl< MCLOHDirective > LOHDirectives
SmallVectorImpl< MCSymbol * > LOHArgs
Adrp xY, _v1 -> Adrp xY, _v2.
static bool isValidMCLOHType(unsigned Kind)
Adrp _v -> Ldr _v -> Str.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static int MCLOHIdToNbArgs(MCLOHType Kind)
static StringRef MCLOHIdToName(MCLOHType Kind)
const LOHDirectives & getDirectives() const
Const accessor to the directives.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.