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 // Instruments Inst. Should be called just before the original
38 // instruction is sent to Out.
39 virtual void InstrumentInstruction(
41 SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand>> &Operands,
42 MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out);
45 friend X86AsmInstrumentation *
46 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
47 const MCContext &Ctx, const MCSubtargetInfo &STI);
49 X86AsmInstrumentation();
52 } // End llvm namespace
54 #endif // X86_ASM_INSTRUMENTATION_H