/src/keystone/llvm/lib/Target/X86/AsmParser/X86AsmInstrumentation.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===- X86AsmInstrumentation.h - Instrument X86 inline assembly *- C++ -*-===// |
2 | | // |
3 | | // The LLVM Compiler Infrastructure |
4 | | // |
5 | | // This file is distributed under the University of Illinois Open Source |
6 | | // License. See LICENSE.TXT for details. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | |
10 | | #ifndef LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H |
11 | | #define LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H |
12 | | |
13 | | #include "llvm/ADT/SmallVector.h" |
14 | | |
15 | | #include <memory> |
16 | | |
17 | | namespace llvm_ks { |
18 | | |
19 | | class MCContext; |
20 | | class MCInst; |
21 | | class MCInstrInfo; |
22 | | class MCParsedAsmOperand; |
23 | | class MCStreamer; |
24 | | class MCSubtargetInfo; |
25 | | class MCTargetOptions; |
26 | | |
27 | | class X86AsmInstrumentation; |
28 | | |
29 | | X86AsmInstrumentation * |
30 | | CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, |
31 | | const MCContext &Ctx, |
32 | | const MCSubtargetInfo *&STI); |
33 | | |
34 | | class X86AsmInstrumentation { |
35 | | public: |
36 | | virtual ~X86AsmInstrumentation(); |
37 | | |
38 | | // Sets frame register corresponding to a current frame. |
39 | 0 | void SetInitialFrameRegister(unsigned RegNo) { |
40 | 0 | InitialFrameReg = RegNo; |
41 | 0 | } |
42 | | |
43 | | // Tries to instrument and emit instruction. |
44 | | virtual void InstrumentAndEmitInstruction( |
45 | | MCInst &Inst, |
46 | | SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand> > &Operands, |
47 | | MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out, |
48 | | unsigned int &KsError); |
49 | | |
50 | | protected: |
51 | | friend X86AsmInstrumentation * |
52 | | CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, |
53 | | const MCContext &Ctx, |
54 | | const MCSubtargetInfo *&STI); |
55 | | |
56 | | X86AsmInstrumentation(const MCSubtargetInfo *&STI); |
57 | | |
58 | | unsigned GetFrameRegGeneric(const MCContext &Ctx, MCStreamer &Out); |
59 | | |
60 | | void EmitInstruction(MCStreamer &Out, MCInst &Inst, unsigned int &KsError); |
61 | | |
62 | | const MCSubtargetInfo *&STI; |
63 | | |
64 | | unsigned InitialFrameReg; |
65 | | }; |
66 | | |
67 | | } // End llvm namespace |
68 | | |
69 | | #endif |