class Interpreter

Declaration

class Interpreter : public ExecutionEngine, public InstVisitor { /* full declaration omitted */ };

Description

Abstract interface for implementation execution of LLVM modules, designed to support both interpreter and just-in-time (JIT) compiler implementations.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:74

Inherits from: ExecutionEngine, InstVisitor

Member Variables

private llvm::GenericValue ExitValue
private llvm::IntrinsicLowering* IL
private std::vector<ExecutionContext> ECStack
private std::vector<Function*> AtExitHandlers

Inherited from ExecutionEngine:

protected Modules
protected LazyFunctionCreator
protected ErrMsg
public lock
protected static MCJITCtor
protected static InterpCtor

Method Overview

Inherited from ExecutionEngine:

Methods

Interpreter(std::unique_ptr<Module> M)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:87

Parameters

std::unique_ptr<Module> M

static void Register()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:95

void SwitchToNewBasicBlock(
    llvm::BasicBlock* Dest,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:195

Parameters

llvm::BasicBlock* Dest
llvm::ExecutionContext& SF

void addAtExitHandler(llvm::Function* F)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:179

Parameters

llvm::Function* F

llvm::GenericValue callExternalFunction(
    llvm::Function* F,
    ArrayRef<llvm::GenericValue> ArgVals)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:175

Parameters

llvm::Function* F
ArrayRef<llvm::GenericValue> ArgVals

void callFunction(
    llvm::Function* F,
    ArrayRef<llvm::GenericValue> ArgVals)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:117

Parameters

llvm::Function* F
ArrayRef<llvm::GenericValue> ArgVals

static llvm::ExecutionEngine* create(
    std::unique_ptr<Module> M,
    std::string* ErrorStr = nullptr)

Description

Create an interpreter ExecutionEngine.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:101

Parameters

std::unique_ptr<Module> M
std::string* ErrorStr = nullptr

llvm::GenericValue executeBitCastInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:225

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeCastOperation(
    Instruction::CastOps opcode,
    llvm::Value* SrcVal,
    llvm::Type* Ty,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:227

Parameters

Instruction::CastOps opcode
llvm::Value* SrcVal
llvm::Type* Ty
llvm::ExecutionContext& SF

llvm::GenericValue executeFPExtInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:211

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeFPToSIInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:215

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeFPToUIInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:213

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeFPTruncInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:209

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeGEPOperation(
    llvm::Value* Ptr,
    llvm::gep_type_iterator I,
    llvm::gep_type_iterator E,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:188

Parameters

llvm::Value* Ptr
llvm::gep_type_iterator I
llvm::gep_type_iterator E
llvm::ExecutionContext& SF

llvm::GenericValue executeIntToPtrInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:223

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executePtrToIntInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:221

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeSExtInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:205

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeSIToFPInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:219

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeTruncInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:203

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeUIToFPInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:217

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

llvm::GenericValue executeZExtInst(
    llvm::Value* SrcVal,
    llvm::Type* DstTy,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:207

Parameters

llvm::Value* SrcVal
llvm::Type* DstTy
llvm::ExecutionContext& SF

void exitCalled(llvm::GenericValue GV)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:177

Parameters

llvm::GenericValue GV

llvm::GenericValue getConstantExprValue(
    llvm::ConstantExpr* CE,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:201

Parameters

llvm::ConstantExpr* CE
llvm::ExecutionContext& SF

llvm::GenericValue* getFirstVarArg()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:183

llvm::GenericValue getOperandValue(
    llvm::Value* V,
    llvm::ExecutionContext& SF)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:202

Parameters

llvm::Value* V
llvm::ExecutionContext& SF

void* getPointerToFunction(llvm::Function* F)

Description

getPointerToFunction - The different EE's represent function bodies in different ways. They should each implement this to say what a function pointer should look like. When F is destroyed, the ExecutionEngine will remove its global mapping and free any machine code. Be sure no threads are running inside F when that happens. This function is deprecated for the MCJIT execution engine. Use getFunctionAddress instead.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:197

Parameters

llvm::Function* F

void* getPointerToNamedFunction(
    llvm::StringRef Name,
    bool AbortOnFailure = true)

Description

getPointerToNamedFunction - This method returns the address of the specified function by using the dlsym function call. As such it is only useful for resolving library symbols, not code generated symbols. If AbortOnFailure is false and no function with the given name is found, this function silently returns a null pointer. Otherwise, it prints a message to stderr and aborts. This function is deprecated for the MCJIT execution engine.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:109

Parameters

llvm::StringRef Name
bool AbortOnFailure = true

void initializeExecutionEngine()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:199

void initializeExternalFunctions()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:200

void popStackAndReturnValueToCaller(
    llvm::Type* RetTy,
    llvm::GenericValue Result)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:229

Parameters

llvm::Type* RetTy
llvm::GenericValue Result

void run()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:118

void runAtExitHandlers()

Description

runAtExitHandlers - Run any functions registered by the program's calls to atexit(3), which we intercept and store in AtExitHandlers.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:93

llvm::GenericValue runFunction(
    llvm::Function* F,
    ArrayRef<llvm::GenericValue> ArgValues)

Description

run - Start execution with the specified function and arguments.

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:106

Parameters

llvm::Function* F
ArrayRef<llvm::GenericValue> ArgValues

void visitAShr(llvm::BinaryOperator& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:160

Parameters

llvm::BinaryOperator& I

void visitAllocaInst(llvm::AllocaInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:130

Parameters

llvm::AllocaInst& I

void visitBinaryOperator(llvm::BinaryOperator& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:127

Parameters

llvm::BinaryOperator& I

void visitBitCastInst(llvm::BitCastInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:148

Parameters

llvm::BitCastInst& I

void visitBranchInst(llvm::BranchInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:122

Parameters

llvm::BranchInst& I

void visitCallBase(llvm::CallBase& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:155

Parameters

llvm::CallBase& I

void visitExtractElementInst(
    llvm::ExtractElementInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:163

Parameters

llvm::ExtractElementInst& I

void visitExtractValueInst(
    llvm::ExtractValueInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:167

Parameters

llvm::ExtractValueInst& I

void visitFCmpInst(llvm::FCmpInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:129

Parameters

llvm::FCmpInst& I

void visitFPExtInst(llvm::FPExtInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:141

Parameters

llvm::FPExtInst& I

void visitFPToSIInst(llvm::FPToSIInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:145

Parameters

llvm::FPToSIInst& I

void visitFPToUIInst(llvm::FPToUIInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:144

Parameters

llvm::FPToUIInst& I

void visitFPTruncInst(llvm::FPTruncInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:140

Parameters

llvm::FPTruncInst& I

void visitGetElementPtrInst(
    llvm::GetElementPtrInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:133

Parameters

llvm::GetElementPtrInst& I

void visitICmpInst(llvm::ICmpInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:128

Parameters

llvm::ICmpInst& I

void visitIndirectBrInst(llvm::IndirectBrInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:124

Parameters

llvm::IndirectBrInst& I

void visitInsertElementInst(
    llvm::InsertElementInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:164

Parameters

llvm::InsertElementInst& I

void visitInsertValueInst(
    llvm::InsertValueInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:168

Parameters

llvm::InsertValueInst& I

void visitInstruction(llvm::Instruction& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:170

Parameters

llvm::Instruction& I

void visitIntToPtrInst(llvm::IntToPtrInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:147

Parameters

llvm::IntToPtrInst& I

void visitIntrinsicInst(llvm::IntrinsicInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:154

Parameters

llvm::IntrinsicInst& I

void visitLShr(llvm::BinaryOperator& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:159

Parameters

llvm::BinaryOperator& I

void visitLoadInst(llvm::LoadInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:131

Parameters

llvm::LoadInst& I

void visitPHINode(llvm::PHINode& PN)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:134

Parameters

llvm::PHINode& PN

void visitPtrToIntInst(llvm::PtrToIntInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:146

Parameters

llvm::PtrToIntInst& I

void visitReturnInst(llvm::ReturnInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:121

Parameters

llvm::ReturnInst& I

void visitSExtInst(llvm::SExtInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:139

Parameters

llvm::SExtInst& I

void visitSIToFPInst(llvm::SIToFPInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:143

Parameters

llvm::SIToFPInst& I

void visitSelectInst(llvm::SelectInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:149

Parameters

llvm::SelectInst& I

void visitShl(llvm::BinaryOperator& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:158

Parameters

llvm::BinaryOperator& I

void visitShuffleVectorInst(
    llvm::ShuffleVectorInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:165

Parameters

llvm::ShuffleVectorInst& I

void visitStoreInst(llvm::StoreInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:132

Parameters

llvm::StoreInst& I

void visitSwitchInst(llvm::SwitchInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:123

Parameters

llvm::SwitchInst& I

void visitTruncInst(llvm::TruncInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:137

Parameters

llvm::TruncInst& I

void visitUIToFPInst(llvm::UIToFPInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:142

Parameters

llvm::UIToFPInst& I

void visitUnaryOperator(llvm::UnaryOperator& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:126

Parameters

llvm::UnaryOperator& I

void visitUnreachableInst(
    llvm::UnreachableInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:156

Parameters

llvm::UnreachableInst& I

void visitVAArgInst(llvm::VAArgInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:162

Parameters

llvm::VAArgInst& I

void visitVACopyInst(llvm::VACopyInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:153

Parameters

llvm::VACopyInst& I

void visitVAEndInst(llvm::VAEndInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:152

Parameters

llvm::VAEndInst& I

void visitVAStartInst(llvm::VAStartInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:151

Parameters

llvm::VAStartInst& I

void visitZExtInst(llvm::ZExtInst& I)

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:138

Parameters

llvm::ZExtInst& I

~Interpreter()

Declared at: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:88