LLVM API Documentation
00001 //===- X86AsmInstrumentation.h - Instrument X86 inline assembly *- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H 00011 #define LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H 00012 00013 #include "llvm/ADT/SmallVector.h" 00014 00015 #include <memory> 00016 00017 namespace llvm { 00018 00019 class MCContext; 00020 class MCInst; 00021 class MCInstrInfo; 00022 class MCParsedAsmOperand; 00023 class MCStreamer; 00024 class MCSubtargetInfo; 00025 class MCTargetOptions; 00026 00027 class X86AsmInstrumentation; 00028 00029 X86AsmInstrumentation * 00030 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, 00031 const MCContext &Ctx, const MCSubtargetInfo &STI); 00032 00033 class X86AsmInstrumentation { 00034 public: 00035 virtual ~X86AsmInstrumentation(); 00036 00037 void SetFrameRegister(unsigned RegNo) { 00038 FrameReg = RegNo; 00039 } 00040 00041 // Tries to instrument and emit instruction. 00042 virtual void InstrumentAndEmitInstruction( 00043 const MCInst &Inst, 00044 SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand> > &Operands, 00045 MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out); 00046 00047 protected: 00048 friend X86AsmInstrumentation * 00049 CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions, 00050 const MCContext &Ctx, const MCSubtargetInfo &STI); 00051 00052 X86AsmInstrumentation(const MCSubtargetInfo &STI); 00053 00054 void EmitInstruction(MCStreamer &Out, const MCInst &Inst); 00055 00056 const MCSubtargetInfo &STI; 00057 00058 unsigned FrameReg; 00059 }; 00060 00061 } // End llvm namespace 00062 00063 #endif