LLVM API Documentation
#include <Interpreter.h>


Definition at line 82 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
| Interpreter::Interpreter | ( | ModuleProvider * | M | ) | [explicit] |
Definition at line 52 of file Interpreter.cpp.
References llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::setTargetData(), and llvm::GenericValue::Untyped.
Referenced by create().
| Interpreter::~Interpreter | ( | ) |
Definition at line 65 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 69 of file Interpreter.cpp.
References callFunction(), and run().
Referenced by exitCalled().
| static void llvm::Interpreter::Register | ( | ) | [inline, static] |
Definition at line 104 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References create(), and llvm::ExecutionEngine::InterpCtor.
| ExecutionEngine * Interpreter::create | ( | ModuleProvider * | MP, | |
| std::string * | ErrStr = 0, |
|||
| bool | Fast = 0 | |||
| ) | [static] |
create - Create an interpreter ExecutionEngine. This can never fail.
create - Create a new interpreter object. This can never fail.
Definition at line 39 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 80 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 1297 of file Execution.cpp.
References AI, llvm::Function::arg_begin(), llvm::Function::arg_end(), llvm::Function::arg_size(), llvm::BasicBlock::begin(), llvm::Function::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 1335 of file Execution.cpp.
References llvm::ExecutionContext::CurInst, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, DOUT, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::APInt::getBitWidth(), I, llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, llvm::APInt::toStringUnsigned(), Val, llvm::ExecutionContext::Values, llvm::Type::VoidTy, and llvm::Type::VoidTyID.
Referenced by runAtExitHandlers(), and runFunction().
| void Interpreter::visitReturnInst | ( | ReturnInst & | I | ) |
Definition at line 634 of file Execution.cpp.
References llvm::User::getNumOperands(), llvm::ReturnInst::getReturnValue(), llvm::Value::getType(), and llvm::Type::VoidTy.
| void Interpreter::visitBranchInst | ( | BranchInst & | I | ) |
Definition at line 671 of file Execution.cpp.
References Dest, llvm::BranchInst::getCondition(), llvm::BranchInst::getSuccessor(), and llvm::BranchInst::isUnconditional().
| void Interpreter::visitSwitchInst | ( | SwitchInst & | I | ) |
Definition at line 684 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 545 of file Execution.cpp.
References Add(), And(), llvm::cerr(), executeAddInst(), executeFDivInst(), executeFRemInst(), executeMulInst(), executeSubInst(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::GenericValue::IntVal, 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 281 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, R, SetValue(), and Ty.
| void Interpreter::visitFCmpInst | ( | FCmpInst & | I | ) |
Definition at line 469 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(), R, SetValue(), and Ty.
| void Interpreter::visitAllocationInst | ( | AllocationInst & | I | ) |
Definition at line 744 of file Execution.cpp.
References DOUT, llvm::TargetData::getABITypeSize(), llvm::SequentialType::getElementType(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::AllocationInst::getType(), llvm::GenericValue::PointerVal, llvm::PTOGV(), SetValue(), and Ty.
| void Interpreter::visitFreeInst | ( | FreeInst & | I | ) |
Definition at line 773 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and llvm::GVTOP().
| void Interpreter::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 829 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 840 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 823 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.
| void Interpreter::visitTruncInst | ( | TruncInst & | I | ) |
Definition at line 1108 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitZExtInst | ( | ZExtInst & | I | ) |
Definition at line 1118 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSExtInst | ( | SExtInst & | I | ) |
Definition at line 1113 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPTruncInst | ( | FPTruncInst & | I | ) |
Definition at line 1123 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPExtInst | ( | FPExtInst & | I | ) |
Definition at line 1128 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitUIToFPInst | ( | UIToFPInst & | I | ) |
Definition at line 1133 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSIToFPInst | ( | SIToFPInst & | I | ) |
Definition at line 1138 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPToUIInst | ( | FPToUIInst & | I | ) |
Definition at line 1143 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitFPToSIInst | ( | FPToSIInst & | I | ) |
Definition at line 1148 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitPtrToIntInst | ( | PtrToIntInst & | I | ) |
Definition at line 1153 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitIntToPtrInst | ( | IntToPtrInst & | I | ) |
Definition at line 1158 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitBitCastInst | ( | BitCastInst & | I | ) |
Definition at line 1163 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
| void Interpreter::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 578 of file Execution.cpp.
References executeSelectInst(), llvm::User::getOperand(), R, and SetValue().
| void Interpreter::visitCallSite | ( | CallSite | CS | ) |
Definition at line 854 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, and llvm::Attribute::ZExt.
Referenced by visitCallInst(), and visitInvokeInst().
| void llvm::Interpreter::visitCallInst | ( | CallInst & | I | ) | [inline] |
Definition at line 164 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References visitCallSite().
| void llvm::Interpreter::visitInvokeInst | ( | InvokeInst & | I | ) | [inline] |
Definition at line 165 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References visitCallSite().
| void Interpreter::visitUnwindInst | ( | UnwindInst & | I | ) |
| void Interpreter::visitUnreachableInst | ( | UnreachableInst & | I | ) |
| void Interpreter::visitShl | ( | BinaryOperator & | I | ) |
Definition at line 925 of file Execution.cpp.
References llvm::User::getOperand(), llvm::GenericValue::IntVal, SetValue(), and llvm::APInt::shl().
| void Interpreter::visitLShr | ( | BinaryOperator & | I | ) |
Definition at line 934 of file Execution.cpp.
References llvm::User::getOperand(), llvm::GenericValue::IntVal, llvm::APInt::lshr(), and SetValue().
| void Interpreter::visitAShr | ( | BinaryOperator & | I | ) |
Definition at line 943 of file Execution.cpp.
References llvm::APInt::ashr(), llvm::User::getOperand(), llvm::GenericValue::IntVal, and SetValue().
| void Interpreter::visitVAArgInst | ( | VAArgInst & | I | ) |
Definition at line 1171 of file Execution.cpp.
References llvm::cerr(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), IMPLEMENT_VAARG, llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, SetValue(), Ty, and llvm::GenericValue::UIntPairVal.
| void llvm::Interpreter::visitInstruction | ( | Instruction & | I | ) | [inline] |
Definition at line 174 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
References llvm::cerr().
| GenericValue Interpreter::callExternalFunction | ( | Function * | F, | |
| const std::vector< GenericValue > & | ArgVals | |||
| ) |
Definition at line 100 of file ExternalFunctions.cpp.
References llvm::cerr(), FI, llvm::Type::getDescription(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::GlobalValue::getType(), and lookupFunction().
Referenced by callFunction().
| void Interpreter::exitCalled | ( | GenericValue | GV | ) |
Definition at line 592 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 183 of file lib/ExecutionEngine/Interpreter/Interpreter.h.
Referenced by lle_X_atexit().
| GenericValue* llvm::Interpreter::getFirstVarArg | ( | ) | [inline] |
Definition at line 187 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 783 of file Execution.cpp.
References DOUT, llvm::TargetData::getABITypeSize(), llvm::StructLayout::getElementOffset(), llvm::SequentialType::getElementType(), llvm::generic_gep_type_iterator< ItTy >::getOperand(), llvm::TargetData::getStructLayout(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::ConstantInt::getZExtValue(), Idx, Index, llvm::GenericValue::IntVal, and llvm::GenericValue::PointerVal.
Referenced by visitGetElementPtrInst().
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.