41 assert(TheTarget !=
nullptr);
42 if (MCCLOptions::Global.lfi_enable_rewriter) {
46 Streamer.setLFIRewriter(std::unique_ptr<MCLFIRewriter>(
52 const Triple &TheTriple = Ctx.getTargetTriple();
59 const Triple &TheTriple = Ctx.getTargetTriple();
66 NoteName =
".note.LFI.ABI.aarch64";
70 NoteName =
".note.LFI.ABI.x86_64";
85 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...
const char NoteNamespace[]
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.
This is an optimization pass for GlobalISel generic memory operations.
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.