LLVM API Documentation
#include <Interpreter.h>
Definition at line 83 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
| Interpreter::Interpreter | ( | ModuleProvider * | M | ) | [explicit] |
Definition at line 48 of file Interpreter.cpp.
References llvm::ExecutionEngine::emitGlobals(), llvm::Intrinsic::memset, llvm::ExecutionEngine::setTargetData(), and llvm::GenericValue::Untyped.
Referenced by create().
| Interpreter::~Interpreter | ( | ) |
Definition at line 61 of file Interpreter.cpp.
| void Interpreter::runAtExitHandlers | ( | ) |
runAtExitHandlers - Run any functions registered by the program's calls to atexit(3), which we intercept and store in AtExitHandlers.
Definition at line 65 of file Interpreter.cpp.
References callFunction(), and run().
Referenced by exitCalled().
| static void llvm::Interpreter::Register | ( | ) | [inline, static] |
Definition at line 105 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References create(), and llvm::ExecutionEngine::InterpCtor.
| ExecutionEngine * Interpreter::create | ( | ModuleProvider * | MP, | |
| std::string * | ErrStr = 0 | |||
| ) | [static] |
create - Create an interpreter ExecutionEngine. This can never fail.
create - Create a new interpreter object. This can never fail.
Definition at line 36 of file Interpreter.cpp.
References Interpreter(), and llvm::ModuleProvider::materializeModule().
Referenced by Register().
| GenericValue Interpreter::runFunction | ( | Function * | F, | |
| const std::vector< GenericValue > & | ArgValues | |||
| ) | [virtual] |
run - Start execution with the specified function and arguments.
Implements llvm::ExecutionEngine.
Definition at line 76 of file Interpreter.cpp.
References callFunction(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), and run().
| virtual void* llvm::Interpreter::recompileAndRelinkFunction | ( | Function * | F | ) | [inline, virtual] |
recompileAndRelinkFunction - For the interpreter, functions are always up-to-date.
Implements llvm::ExecutionEngine.
Definition at line 121 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
| void llvm::Interpreter::freeMachineCodeForFunction | ( | Function * | F | ) | [inline, virtual] |
freeMachineCodeForFunction - The interpreter does not generate any code.
Implements llvm::ExecutionEngine.
Definition at line 127 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
| void Interpreter::callFunction | ( | Function * | F, | |
| const std::vector< GenericValue > & | ArgVals | |||
| ) |
Definition at line 1294 of file Execution.cpp.
References AI, llvm::Function::arg_begin(), llvm::Function::arg_end(), llvm::Function::arg_size(), llvm::Function::begin(), llvm::BasicBlock::begin(), callExternalFunction(), llvm::ExecutionContext::CurBB, llvm::ExecutionContext::CurFunction, llvm::ExecutionContext::CurInst, E, llvm::Function::getFunctionType(), llvm::Function::getReturnType(), llvm::Function::isDeclaration(), llvm::FunctionType::isVarArg(), SetValue(), and llvm::ExecutionContext::VarArgs.
Referenced by runAtExitHandlers(), runFunction(), and visitCallSite().
| void Interpreter::run | ( | ) |
Definition at line 1332 of file Execution.cpp.
References llvm::ExecutionContext::CurInst, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, DOUT, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::APInt::getBitWidth(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm_unreachable, llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, llvm::APInt::toStringUnsigned(), Val, llvm::ExecutionContext::Values, and llvm::Type::VoidTyID.
Referenced by runAtExitHandlers(), and runFunction().
| void Interpreter::visitReturnInst | ( | ReturnInst & | I | ) |
Definition at line 615 of file Execution.cpp.
References llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::ReturnInst::getReturnValue(), llvm::Value::getType(), and llvm::Type::getVoidTy().
| void Interpreter::visitBranchInst | ( | BranchInst & | I | ) |
Definition at line 651 of file Execution.cpp.
References Dest, llvm::BranchInst::getCondition(), llvm::BranchInst::getSuccessor(), and llvm::BranchInst::isUnconditional().
| void Interpreter::visitSwitchInst | ( | SwitchInst & | I | ) |
Definition at line 664 of file Execution.cpp.
References Dest, executeICMP_EQ(), llvm::SwitchInst::getDefaultDest(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::GenericValue::IntVal.
| void Interpreter::visitBinaryOperator | ( | BinaryOperator & | I | ) |
Definition at line 522 of file Execution.cpp.
References llvm::APIntOps::And(), llvm::cerr(), executeFAddInst(), executeFDivInst(), executeFMulInst(), executeFRemInst(), executeFSubInst(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::GenericValue::IntVal, llvm_unreachable, llvm::APIntOps::Or(), R, llvm::APInt::sdiv(), SetValue(), llvm::APInt::srem(), Ty, llvm::APInt::udiv(), llvm::APInt::urem(), and llvm::APIntOps::Xor().
| void Interpreter::visitICmpInst | ( | ICmpInst & | I | ) |
Definition at line 258 of file Execution.cpp.
References llvm::cerr(), executeICMP_EQ(), executeICMP_NE(), executeICMP_SGE(), executeICMP_SGT(), executeICMP_SLE(), executeICMP_SLT(), executeICMP_UGE(), executeICMP_UGT(), executeICMP_ULE(), executeICMP_ULT(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Value::getType(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm_unreachable, R, SetValue(), and Ty.
| void Interpreter::visitFCmpInst | ( | FCmpInst & | I | ) |
Definition at line 446 of file Execution.cpp.
References llvm::cerr(), executeFCMP_OEQ(), executeFCMP_OGE(), executeFCMP_OGT(), executeFCMP_OLE(), executeFCMP_OLT(), executeFCMP_ONE(), executeFCMP_ORD(), executeFCMP_UEQ(), executeFCMP_UGE(), executeFCMP_UGT(), executeFCMP_ULE(), executeFCMP_ULT(), executeFCMP_UNE(), executeFCMP_UNO(), llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Value::getType(), llvm_unreachable, R, SetValue(), and Ty.
| void Interpreter::visitAllocationInst | ( | AllocationInst & | I | ) |
Definition at line 724 of file Execution.cpp.
References DOUT, llvm::SequentialType::getElementType(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::AllocationInst::getType(), llvm::TargetData::getTypeAllocSize(), llvm::GenericValue::PointerVal, llvm::PTOGV(), SetValue(), and Ty.
| void Interpreter::visitFreeInst | ( | FreeInst & | I | ) |
Definition at line 753 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and llvm::GVTOP().
| void Interpreter::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 809 of file Execution.cpp.
References llvm::cerr(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), llvm::GVTOP(), llvm::LoadInst::isVolatile(), llvm::ExecutionEngine::LoadValueFromMemory(), PrintVolatile, and SetValue().
| void Interpreter::visitStoreInst | ( | StoreInst & | I | ) |
Definition at line 820 of file Execution.cpp.
References llvm::cerr(), llvm::User::getOperand(), llvm::StoreInst::getPointerOperand(), llvm::Value::getType(), llvm::GVTOP(), llvm::StoreInst::isVolatile(), PrintVolatile, llvm::ExecutionEngine::StoreValueToMemory(), and Val.
| void Interpreter::visitGetElementPtrInst | ( | GetElementPtrInst & | I | ) |
Definition at line 803 of file Execution.cpp.
References executeGEPOperation(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::GetElementPtrInst::getPointerOperand(), and SetValue().
| void llvm::Interpreter::visitPHINode | ( | PHINode & | PN | ) | [inline] |
Definition at line 147 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References llvm_unreachable.
| void Interpreter::visitTruncInst | ( | TruncInst & | I | ) |
Definition at line 1102 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitZExtInst | ( | ZExtInst & | I | ) |
Definition at line 1112 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSExtInst | ( | SExtInst & | I | ) |
Definition at line 1107 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPTruncInst | ( | FPTruncInst & | I | ) |
Definition at line 1117 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPExtInst | ( | FPExtInst & | I | ) |
Definition at line 1122 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitUIToFPInst | ( | UIToFPInst & | I | ) |
Definition at line 1127 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSIToFPInst | ( | SIToFPInst & | I | ) |
Definition at line 1132 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPToUIInst | ( | FPToUIInst & | I | ) |
Definition at line 1137 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPToSIInst | ( | FPToSIInst & | I | ) |
Definition at line 1142 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitPtrToIntInst | ( | PtrToIntInst & | I | ) |
Definition at line 1147 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitIntToPtrInst | ( | IntToPtrInst & | I | ) |
Definition at line 1152 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitBitCastInst | ( | BitCastInst & | I | ) |
Definition at line 1157 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 558 of file Execution.cpp.
References executeSelectInst(), llvm::User::getOperand(), R, and SetValue().
| void Interpreter::visitCallSite | ( | CallSite | CS | ) |
Definition at line 834 of file Execution.cpp.
References llvm::CallSite::arg_begin(), llvm::CallSite::arg_end(), llvm::CallSite::arg_size(), llvm::ExecutionContext::Caller, callFunction(), llvm::ExecutionContext::CurInst, F, llvm::CallSite::getCalledFunction(), llvm::CallSite::getCalledValue(), llvm::CallSite::getInstruction(), llvm::Function::getIntrinsicID(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::GVTOP(), llvm::Function::isDeclaration(), llvm::Type::isInteger(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::Intrinsic::not_intrinsic, llvm::CallSite::paramHasAttr(), SetValue(), llvm::Attribute::SExt, Ty, llvm::GenericValue::UIntPairVal, V, llvm::Intrinsic::vacopy, llvm::Intrinsic::vaend, llvm::Intrinsic::vastart, and llvm::Attribute::ZExt.
Referenced by visitCallInst(), and visitInvokeInst().
| void llvm::Interpreter::visitCallInst | ( | CallInst & | I | ) | [inline] |
Definition at line 166 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References visitCallSite().
| void llvm::Interpreter::visitInvokeInst | ( | InvokeInst & | I | ) | [inline] |
Definition at line 167 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References visitCallSite().
| void Interpreter::visitUnwindInst | ( | UnwindInst & | I | ) |
Definition at line 629 of file Execution.cpp.
References llvm::ExecutionContext::Caller, CallSite, Inst, and llvm::llvm_report_error().
| void Interpreter::visitUnreachableInst | ( | UnreachableInst & | I | ) |
| void Interpreter::visitShl | ( | BinaryOperator & | I | ) |
Definition at line 905 of file Execution.cpp.
References llvm::APInt::getBitWidth(), llvm::User::getOperand(), llvm::GenericValue::IntVal, SetValue(), and llvm::APInt::shl().
| void Interpreter::visitLShr | ( | BinaryOperator & | I | ) |
Definition at line 918 of file Execution.cpp.
References llvm::APInt::getBitWidth(), llvm::User::getOperand(), llvm::GenericValue::IntVal, llvm::APInt::lshr(), and SetValue().
| void Interpreter::visitAShr | ( | BinaryOperator & | I | ) |
Definition at line 931 of file Execution.cpp.
References llvm::APInt::ashr(), llvm::APInt::getBitWidth(), llvm::User::getOperand(), llvm::GenericValue::IntVal, and SetValue().
| void Interpreter::visitVAArgInst | ( | VAArgInst & | I | ) |
Definition at line 1165 of file Execution.cpp.
References llvm::cerr(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), IMPLEMENT_VAARG, llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm_unreachable, SetValue(), Ty, and llvm::GenericValue::UIntPairVal.
| void llvm::Interpreter::visitInstruction | ( | Instruction & | I | ) | [inline] |
Definition at line 176 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References llvm::cerr(), and llvm_unreachable.
| GenericValue Interpreter::callExternalFunction | ( | Function * | F, | |
| const std::vector< GenericValue > & | ArgVals | |||
| ) |
Definition at line 247 of file ExternalFunctions.cpp.
References llvm::cerr(), ffiInvoke(), FI, llvm::Type::getDescription(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::ExecutionEngine::getTargetData(), llvm::GlobalValue::getType(), llvm::llvm_report_error(), lookupFunction(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().
Referenced by callFunction().
| void Interpreter::exitCalled | ( | GenericValue | GV | ) |
Definition at line 572 of file Execution.cpp.
References llvm::APInt::getZExtValue(), llvm::GenericValue::IntVal, runAtExitHandlers(), and llvm::APInt::zextOrTrunc().
Referenced by lle_X_exit().
| void llvm::Interpreter::addAtExitHandler | ( | Function * | F | ) | [inline] |
Definition at line 185 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
Referenced by lle_X_atexit().
| GenericValue* llvm::Interpreter::getFirstVarArg | ( | ) | [inline] |
Definition at line 189 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
| GenericValue Interpreter::executeGEPOperation | ( | Value * | Ptr, | |
| gep_type_iterator | I, | |||
| gep_type_iterator | E, | |||
| ExecutionContext & | SF | |||
| ) |
Definition at line 763 of file Execution.cpp.
References DOUT, llvm::StructLayout::getElementOffset(), llvm::SequentialType::getElementType(), llvm::generic_gep_type_iterator< ItTy >::getOperand(), llvm::TargetData::getStructLayout(), llvm::Value::getType(), llvm::TargetData::getTypeAllocSize(), llvm::ConstantInt::getZExtValue(), llvm::APInt::getZExtValue(), Idx, Index, llvm::GenericValue::IntVal, and llvm::GenericValue::PointerVal.
Referenced by visitGetElementPtrInst().