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 X86_ASM_INSTRUMENTATION_H
11 #define X86_ASM_INSTRUMENTATION_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 // Tries to instrument and emit instruction.
38 virtual void InstrumentAndEmitInstruction(
40 SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand>> &Operands,
41 MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out);
44 friend X86AsmInstrumentation *
45 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
46 const MCContext &Ctx, const MCSubtargetInfo &STI);
48 X86AsmInstrumentation(const MCSubtargetInfo &STI);
50 void EmitInstruction(MCStreamer &Out, const MCInst &Inst);
52 const MCSubtargetInfo &STI;
55 } // End llvm namespace
57 #endif // X86_ASM_INSTRUMENTATION_H