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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#ifndef LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H
|
|
|
|
#define LLVM_LIB_TARGET_X86_ASMPARSER_X86ASMINSTRUMENTATION_H
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
#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-08-27 13:11:55 +00:00
|
|
|
X86AsmInstrumentation *
|
|
|
|
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
|
|
|
|
const MCContext &Ctx, const MCSubtargetInfo &STI);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
|
|
|
class X86AsmInstrumentation {
|
2014-08-27 13:11:55 +00:00
|
|
|
public:
|
2014-03-14 08:58:04 +00:00
|
|
|
virtual ~X86AsmInstrumentation();
|
|
|
|
|
2014-09-10 09:45:49 +00:00
|
|
|
void SetFrameRegister(unsigned RegNo) {
|
|
|
|
FrameReg = RegNo;
|
|
|
|
}
|
|
|
|
|
2014-07-31 09:11:04 +00:00
|
|
|
// Tries to instrument and emit instruction.
|
|
|
|
virtual void InstrumentAndEmitInstruction(
|
2014-06-08 16:18:35 +00:00
|
|
|
const MCInst &Inst,
|
2014-09-01 12:51:00 +00:00
|
|
|
SmallVectorImpl<std::unique_ptr<MCParsedAsmOperand> > &Operands,
|
2014-06-08 16:18:35 +00:00
|
|
|
MCContext &Ctx, const MCInstrInfo &MII, MCStreamer &Out);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
2014-08-27 13:11:55 +00:00
|
|
|
protected:
|
|
|
|
friend X86AsmInstrumentation *
|
|
|
|
CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
|
|
|
|
const MCContext &Ctx, const MCSubtargetInfo &STI);
|
2014-03-14 08:58:04 +00:00
|
|
|
|
2014-07-31 09:11:04 +00:00
|
|
|
X86AsmInstrumentation(const MCSubtargetInfo &STI);
|
|
|
|
|
|
|
|
void EmitInstruction(MCStreamer &Out, const MCInst &Inst);
|
|
|
|
|
|
|
|
const MCSubtargetInfo &STI;
|
2014-09-10 09:45:49 +00:00
|
|
|
|
|
|
|
unsigned FrameReg;
|
2014-03-14 08:58:04 +00:00
|
|
|
};
|
|
|
|
|
2014-08-27 13:11:55 +00:00
|
|
|
} // End llvm namespace
|
2014-03-14 08:58:04 +00:00
|
|
|
|
2014-08-13 16:26:38 +00:00
|
|
|
#endif
|