AddressSanitizer instrumentation for MOV and MOVAPS.
[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
23 class X86AsmInstrumentation;
24
25 X86AsmInstrumentation *CreateX86AsmInstrumentation(MCSubtargetInfo &STI);
26
27 class X86AsmInstrumentation {
28 public:
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
37 protected:
38   friend X86AsmInstrumentation *
39   CreateX86AsmInstrumentation(MCSubtargetInfo &STI);
40
41   X86AsmInstrumentation();
42 };
43
44 }  // End llvm namespace
45
46 #endif  // X86_ASM_INSTRUMENTATION_H