2014-03-14 08:58:04 +00:00
|
|
|
//===- X86AsmInstrumentation.h - Instrument X86 inline assembly *- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef X86_ASM_INSTRUMENTATION_H
|
|
|
|
#define X86_ASM_INSTRUMENTATION_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
|
2014-06-08 16:18:35 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2014-03-14 08:58:04 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class MCContext;
|
|
|
|
class MCInst;
|
2014-04-24 13:29:34 +00:00
|
|
|
class MCInstrInfo;
|
2014-03-14 08:58:04 +00:00
|
|
|
class MCParsedAsmOperand;
|
|
|
|
class MCStreamer;
|
|
|
|
class MCSubtargetInfo;
|
2014-04-23 11:16:03 +00:00
|
|
|
class MCTargetOptions;
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
class X86AsmInstrumentation;
|
|
|
|
|
2014-04-23 11:16:03 +00:00
|
|
|
X86AsmInstrumentation *
|
|
|
|
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
|
|
|
|
const MCContext &Ctx, const MCSubtargetInfo &STI);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
class X86AsmInstrumentation {
|
|
|
|
public:
|
|
|
|
virtual ~X86AsmInstrumentation();
|
|
|
|
|
|
|
|
// Instruments Inst. Should be called just before the original
|
|
|
|
// instruction is sent to Out.
|
|
|
|
virtual void InstrumentInstruction(
|
2014-06-08 16:18:35 +00:00
|
|
|
const MCInst &Inst,
|
|
|
|
SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand>> &Operands,
|
|
|
|
MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
friend X86AsmInstrumentation *
|
2014-04-23 11:16:03 +00:00
|
|
|
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
|
|
|
|
const MCContext &Ctx, const MCSubtargetInfo &STI);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
X86AsmInstrumentation();
|
|
|
|
};
|
|
|
|
|
2014-04-23 11:16:03 +00:00
|
|
|
} // End llvm namespace
|
2014-03-14 08:58:04 +00:00
|
|
|
|
2014-04-23 11:16:03 +00:00
|
|
|
#endif // X86_ASM_INSTRUMENTATION_H
|