1 //===- X86AsmInstrumentation.h - Instrument X86 inline assembly *- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H
11 #define LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H
13 #include "llvm/ADT/SmallVector.h"
22 class MCParsedAsmOperand;
24 class MCSubtargetInfo;
25 class MCTargetOptions;
27 class X86AsmInstrumentation;
29 X86AsmInstrumentation *
30 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
32 const MCSubtargetInfo *&STI);
34 class X86AsmInstrumentation {
36 virtual ~X86AsmInstrumentation();
38 // Sets frame register corresponding to a current frame.
39 void SetInitialFrameRegister(unsigned RegNo) {
40 InitialFrameReg = RegNo;
43 // Tries to instrument and emit instruction.
44 virtual void InstrumentAndEmitInstruction(
46 SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand> > &Operands,
47 MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out);
50 friend X86AsmInstrumentation *
51 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
53 const MCSubtargetInfo *&STI);
55 X86AsmInstrumentation(const MCSubtargetInfo *&STI);
57 unsigned GetFrameRegGeneric(const MCContext &Ctx, MCStreamer &Out);
59 void EmitInstruction(MCStreamer &Out, const MCInst &Inst);
61 const MCSubtargetInfo *&STI;
63 unsigned InitialFrameReg;
66 } // End llvm namespace