10 #ifndef LLVM_LIB_TARGET_X86_X86ASMPRINTER_H
11 #define LLVM_LIB_TARGET_X86_X86ASMPRINTER_H
32 std::unique_ptr<MCCodeEmitter> CodeEmitter;
42 class StackMapShadowTracker {
51 void reset(
unsigned RequiredSize) {
52 RequiredShadowSize = RequiredSize;
53 CurrentShadowSize = 0;
62 bool InShadow =
false;
69 unsigned RequiredShadowSize = 0, CurrentShadowSize = 0;
72 StackMapShadowTracker SMShadowTracker;
80 void EmitAndCountInstruction(
MCInst &Inst);
82 void LowerPATCHPOINT(
const MachineInstr &MI, X86MCInstLower &MCIL);
83 void LowerSTATEPOINT(
const MachineInstr &MI, X86MCInstLower &MCIL);
84 void LowerFAULTING_LOAD_OP(
const MachineInstr &MI, X86MCInstLower &MCIL);
85 void LowerPATCHABLE_OP(
const MachineInstr &MI, X86MCInstLower &MCIL);
87 void LowerTlsAddr(X86MCInstLower &MCInstLowering,
const MachineInstr &MI);
90 void LowerPATCHABLE_FUNCTION_ENTER(
const MachineInstr &MI,
91 X86MCInstLower &MCIL);
92 void LowerPATCHABLE_RET(
const MachineInstr &MI, X86MCInstLower &MCIL);
93 void LowerPATCHABLE_TAIL_CALL(
const MachineInstr &MI, X86MCInstLower &MCIL);
101 std::unique_ptr<MCStreamer> Streamer)
102 :
AsmPrinter(TM, std::move(Streamer)), SM(*this), FM(*this) {}
105 return "X86 Assembly Printer";
110 void EmitStartOfAsmFile(
Module &M)
override;
112 void EmitEndOfAsmFile(
Module &M)
override;
117 SMShadowTracker.emitShadowPadding(*OutStreamer, getSubtargetInfo());
120 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
121 unsigned AsmVariant,
const char *ExtraCode,
123 bool PrintAsmMemoryOperand(
const MachineInstr *MI,
unsigned OpNo,
124 unsigned AsmVariant,
const char *ExtraCode,
128 MCSymbol *GetCPISymbol(
unsigned CPID)
const override;
131 SMShadowTracker.reset(0);
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
Instances of this class represent a single low-level machine instruction.
Streaming machine code generation interface.
MCCodeEmitter - Generic instruction encoding interface.
This class is intended to be used as a driving class for all asm writers.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
X86AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)
const X86Subtarget & getSubtarget() const
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Representation of each machine instruction.
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
void EmitBasicBlockEnd(const MachineBasicBlock &MBB) override
Targets can override this to emit stuff at the end of a basic block.
MCSubtargetInfo - Generic base class for all target subtargets.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.