34 cl::desc(
"Enable rewriting for LFI."),
45 assert(TheTarget !=
nullptr);
50 Streamer.setLFIRewriter(std::unique_ptr<MCLFIRewriter>(
56 const Triple &TheTriple = Ctx.getTargetTriple();
64 const Triple &TheTriple = Ctx.getTargetTriple();
71 NoteName =
".note.LFI.ABI.aarch64";
75 NoteName =
".note.LFI.ABI.x86_64";
90 Streamer.emitIntValue(strlen(NoteArch) + 1, 4);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares the MCLFIRewriter class, an abstract class that encapsulates the rewriting logic f...
static const char NoteNamespace[]
static constexpr unsigned X86BundleSize
LFI-specific code for MC.
std::unique_ptr< MCStreamer > && Streamer
Lightweight error class with error context and mandatory checking.
Context object for machine code objects.
This represents a section on linux, lots of unix variants and some bare metal systems.
Streaming machine code generation interface.
Target - Wrapper for Target specific information.
MCRegisterInfo * createMCRegInfo(const Triple &TT) const
Create a MCRegisterInfo implementation.
MCLFIRewriter * createMCLFIRewriter(MCContext &Ctx, std::unique_ptr< MCRegisterInfo > &&RegInfo, std::unique_ptr< MCInstrInfo > &&InstInfo) const
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
Triple - Helper class for working with autoconf configuration names.
bool isLFI() const
Tests whether the target is LFI.
ArchType getArch() const
Get the parsed architecture type of this triple.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< bool > FlagEnableRewriting("lfi-enable-rewriter", cl::desc("Enable rewriting for LFI."), cl::init(true), cl::Hidden)
LLVM_ABI void initializeLFIMCStreamer(MCStreamer &Streamer, MCContext &Ctx, const Triple &TheTriple)
LLVM_ABI void emitLFINoteSection(MCStreamer &Streamer, MCContext &Ctx)
LLVM_ABI void emitLFIBundleAlign(MCStreamer &Streamer, MCContext &Ctx)
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static LLVM_ABI const Target * lookupTarget(const Triple &TheTriple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.