]>
git.proxmox.com Git - rustc.git/blob - src/llvm/lib/Target/X86/AsmParser/X86AsmInstrumentation.h
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
,
31 const MCContext
&Ctx
, const MCSubtargetInfo
&STI
);
33 class X86AsmInstrumentation
{
35 virtual ~X86AsmInstrumentation();
37 // Sets frame register corresponding to a current frame.
38 void SetInitialFrameRegister(unsigned RegNo
) {
39 InitialFrameReg
= RegNo
;
42 // Tries to instrument and emit instruction.
43 virtual void InstrumentAndEmitInstruction(
45 SmallVectorImpl
<std::unique_ptr
<MCParsedAsmOperand
> > &Operands
,
46 MCContext
&Ctx
, const MCInstrInfo
&MII
, MCStreamer
&Out
);
49 friend X86AsmInstrumentation
*
50 CreateX86AsmInstrumentation(const MCTargetOptions
&MCOptions
,
51 const MCContext
&Ctx
, const MCSubtargetInfo
&STI
);
53 X86AsmInstrumentation(const MCSubtargetInfo
&STI
);
55 unsigned GetFrameRegGeneric(const MCContext
&Ctx
, MCStreamer
&Out
);
57 void EmitInstruction(MCStreamer
&Out
, const MCInst
&Inst
);
59 const MCSubtargetInfo
&STI
;
61 unsigned InitialFrameReg
;
64 } // End llvm namespace