Create MCTargetOptions.
[oota-llvm.git] / lib / Target / X86 / AsmParser / X86AsmInstrumentation.h
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
15 namespace llvm {
16
17 class MCContext;
18 class MCInst;
19 class MCParsedAsmOperand;
20 class MCStreamer;
21 class MCSubtargetInfo;
22 class MCTargetOptions;
23
24 class X86AsmInstrumentation;
25
26 X86AsmInstrumentation *
27 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
28                             const MCContext &Ctx, const MCSubtargetInfo &STI);
29
30 class X86AsmInstrumentation {
31 public:
32   virtual ~X86AsmInstrumentation();
33
34   // Instruments Inst. Should be called just before the original
35   // instruction is sent to Out.
36   virtual void InstrumentInstruction(
37       const MCInst &Inst, SmallVectorImpl<MCParsedAsmOperand *> &Operands,
38       MCContext &Ctx, MCStreamer &Out);
39
40 protected:
41   friend X86AsmInstrumentation *
42   CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
43                               const MCContext &Ctx, const MCSubtargetInfo &STI);
44
45   X86AsmInstrumentation();
46 };
47
48 } // End llvm namespace
49
50 #endif // X86_ASM_INSTRUMENTATION_H