X86AsmInstrumentation.h revision 36b56886974eae4f9c5ebc96befd3e7bfe5de338
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 X86_ASM_INSTRUMENTATION_H
11#define X86_ASM_INSTRUMENTATION_H
12
13#include "llvm/ADT/SmallVector.h"
14
15namespace llvm {
16
17class MCContext;
18class MCInst;
19class MCParsedAsmOperand;
20class MCStreamer;
21class MCSubtargetInfo;
22
23class X86AsmInstrumentation;
24
25X86AsmInstrumentation *CreateX86AsmInstrumentation(MCSubtargetInfo &STI);
26
27class X86AsmInstrumentation {
28public:
29  virtual ~X86AsmInstrumentation();
30
31  // Instruments Inst. Should be called just before the original
32  // instruction is sent to Out.
33  virtual void InstrumentInstruction(
34      const MCInst &Inst, SmallVectorImpl<MCParsedAsmOperand *> &Operands,
35      MCContext &Ctx, MCStreamer &Out);
36
37protected:
38  friend X86AsmInstrumentation *
39  CreateX86AsmInstrumentation(MCSubtargetInfo &STI);
40
41  X86AsmInstrumentation();
42};
43
44}  // End llvm namespace
45
46#endif  // X86_ASM_INSTRUMENTATION_H
47