LLVM
8.0.1
|
#include "ExecutionEngine/Interpreter/Interpreter.h"
Public Member Functions | |
Interpreter (std::unique_ptr< Module > M) | |
~Interpreter () override | |
void | runAtExitHandlers () |
runAtExitHandlers - Run any functions registered by the program's calls to atexit(3), which we intercept and store in AtExitHandlers. More... | |
GenericValue | runFunction (Function *F, ArrayRef< GenericValue > ArgValues) override |
run - Start execution with the specified function and arguments. More... | |
void * | getPointerToNamedFunction (StringRef Name, bool AbortOnFailure=true) override |
getPointerToNamedFunction - This method returns the address of the specified function by using the dlsym function call. More... | |
void | callFunction (Function *F, ArrayRef< GenericValue > ArgVals) |
void | run () |
void | visitReturnInst (ReturnInst &I) |
void | visitBranchInst (BranchInst &I) |
void | visitSwitchInst (SwitchInst &I) |
void | visitIndirectBrInst (IndirectBrInst &I) |
void | visitBinaryOperator (BinaryOperator &I) |
void | visitICmpInst (ICmpInst &I) |
void | visitFCmpInst (FCmpInst &I) |
void | visitAllocaInst (AllocaInst &I) |
void | visitLoadInst (LoadInst &I) |
void | visitStoreInst (StoreInst &I) |
void | visitGetElementPtrInst (GetElementPtrInst &I) |
void | visitPHINode (PHINode &PN) |
void | visitTruncInst (TruncInst &I) |
void | visitZExtInst (ZExtInst &I) |
void | visitSExtInst (SExtInst &I) |
void | visitFPTruncInst (FPTruncInst &I) |
void | visitFPExtInst (FPExtInst &I) |
void | visitUIToFPInst (UIToFPInst &I) |
void | visitSIToFPInst (SIToFPInst &I) |
void | visitFPToUIInst (FPToUIInst &I) |
void | visitFPToSIInst (FPToSIInst &I) |
void | visitPtrToIntInst (PtrToIntInst &I) |
void | visitIntToPtrInst (IntToPtrInst &I) |
void | visitBitCastInst (BitCastInst &I) |
void | visitSelectInst (SelectInst &I) |
void | visitCallSite (CallSite CS) |
void | visitCallInst (CallInst &I) |
void | visitInvokeInst (InvokeInst &I) |
void | visitUnreachableInst (UnreachableInst &I) |
void | visitShl (BinaryOperator &I) |
void | visitLShr (BinaryOperator &I) |
void | visitAShr (BinaryOperator &I) |
void | visitVAArgInst (VAArgInst &I) |
void | visitExtractElementInst (ExtractElementInst &I) |
void | visitInsertElementInst (InsertElementInst &I) |
void | visitShuffleVectorInst (ShuffleVectorInst &I) |
void | visitExtractValueInst (ExtractValueInst &I) |
void | visitInsertValueInst (InsertValueInst &I) |
void | visitInstruction (Instruction &I) |
GenericValue | callExternalFunction (Function *F, ArrayRef< GenericValue > ArgVals) |
void | exitCalled (GenericValue GV) |
void | addAtExitHandler (Function *F) |
GenericValue * | getFirstVarArg () |
Public Member Functions inherited from llvm::ExecutionEngine | |
virtual | ~ExecutionEngine () |
virtual void | addModule (std::unique_ptr< Module > M) |
Add a Module to the list of modules that we can JIT from. More... | |
virtual void | addObjectFile (std::unique_ptr< object::ObjectFile > O) |
addObjectFile - Add an ObjectFile to the execution engine. More... | |
virtual void | addObjectFile (object::OwningBinary< object::ObjectFile > O) |
virtual void | addArchive (object::OwningBinary< object::Archive > A) |
addArchive - Add an Archive to the execution engine. More... | |
const DataLayout & | getDataLayout () const |
virtual bool | removeModule (Module *M) |
removeModule - Removes a Module from the list of modules, but does not free the module's memory. More... | |
virtual Function * | FindFunctionNamed (StringRef FnName) |
FindFunctionNamed - Search all of the active modules to find the function that defines FnName. More... | |
virtual GlobalVariable * | FindGlobalVariableNamed (StringRef Name, bool AllowInternal=false) |
FindGlobalVariableNamed - Search all of the active modules to find the global variable that defines Name. More... | |
virtual void | mapSectionAddress (const void *LocalAddress, uint64_t TargetAddress) |
mapSectionAddress - map a section to its target address space value. More... | |
virtual void | generateCodeForModule (Module *M) |
generateCodeForModule - Run code generation for the specified module and load it into memory. More... | |
virtual void | finalizeObject () |
finalizeObject - ensure the module is fully processed and is usable. More... | |
virtual void | runStaticConstructorsDestructors (bool isDtors) |
runStaticConstructorsDestructors - This method is used to execute all of the static constructors or destructors for a program. More... | |
void | runStaticConstructorsDestructors (Module &module, bool isDtors) |
This method is used to execute all of the static constructors or destructors for a particular module. More... | |
int | runFunctionAsMain (Function *Fn, const std::vector< std::string > &argv, const char *const *envp) |
runFunctionAsMain - This is a helper function which wraps runFunction to handle the common task of starting up main with the specified argc, argv, and envp parameters. More... | |
void | addGlobalMapping (const GlobalValue *GV, void *Addr) |
addGlobalMapping - Tell the execution engine that the specified global is at the specified location. More... | |
void | addGlobalMapping (StringRef Name, uint64_t Addr) |
void | clearAllGlobalMappings () |
clearAllGlobalMappings - Clear all global mappings and start over again, for use in dynamic compilation scenarios to move globals. More... | |
void | clearGlobalMappingsFromModule (Module *M) |
clearGlobalMappingsFromModule - Clear all global mappings that came from a particular module, because it has been removed from the JIT. More... | |
uint64_t | updateGlobalMapping (const GlobalValue *GV, void *Addr) |
updateGlobalMapping - Replace an existing mapping for GV with a new address. More... | |
uint64_t | updateGlobalMapping (StringRef Name, uint64_t Addr) |
uint64_t | getAddressToGlobalIfAvailable (StringRef S) |
getAddressToGlobalIfAvailable - This returns the address of the specified global symbol. More... | |
void * | getPointerToGlobalIfAvailable (StringRef S) |
getPointerToGlobalIfAvailable - This returns the address of the specified global value if it is has already been codegen'd, otherwise it returns null. More... | |
void * | getPointerToGlobalIfAvailable (const GlobalValue *GV) |
void * | getPointerToGlobal (const GlobalValue *GV) |
getPointerToGlobal - This returns the address of the specified global value. More... | |
virtual void * | getPointerToFunctionOrStub (Function *F) |
getPointerToFunctionOrStub - If the specified function has been code-gen'd, return a pointer to the function. More... | |
virtual uint64_t | getGlobalValueAddress (const std::string &Name) |
getGlobalValueAddress - Return the address of the specified global value. More... | |
virtual uint64_t | getFunctionAddress (const std::string &Name) |
getFunctionAddress - Return the address of the specified function. More... | |
const GlobalValue * | getGlobalValueAtAddress (void *Addr) |
getGlobalValueAtAddress - Return the LLVM global value object that starts at the specified address. More... | |
void | StoreValueToMemory (const GenericValue &Val, GenericValue *Ptr, Type *Ty) |
StoreValueToMemory - Stores the data in Val of type Ty at address Ptr. More... | |
void | InitializeMemory (const Constant *Init, void *Addr) |
virtual void * | getOrEmitGlobalVariable (const GlobalVariable *GV) |
getOrEmitGlobalVariable - Return the address of the specified global variable, possibly emitting it to memory if needed. More... | |
virtual void | RegisterJITEventListener (JITEventListener *) |
Registers a listener to be called back on various events within the JIT. More... | |
virtual void | UnregisterJITEventListener (JITEventListener *) |
virtual void | setObjectCache (ObjectCache *) |
Sets the pre-compiled object cache. More... | |
virtual void | setProcessAllSections (bool ProcessAllSections) |
setProcessAllSections (MCJIT Only): By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager, and other sections are discarded. More... | |
virtual TargetMachine * | getTargetMachine () |
Return the target machine (if available). More... | |
void | DisableLazyCompilation (bool Disabled=true) |
DisableLazyCompilation - When lazy compilation is off (the default), the JIT will eagerly compile every function reachable from the argument to getPointerToFunction. More... | |
bool | isCompilingLazily () const |
void | DisableGVCompilation (bool Disabled=true) |
DisableGVCompilation - If called, the JIT will abort if it's asked to allocate space and populate a GlobalVariable that is not internal to the module. More... | |
bool | isGVCompilationDisabled () const |
void | DisableSymbolSearching (bool Disabled=true) |
DisableSymbolSearching - If called, the JIT will not try to lookup unknown symbols with dlsym. More... | |
bool | isSymbolSearchingDisabled () const |
void | setVerifyModules (bool Verify) |
Enable/Disable IR module verification. More... | |
bool | getVerifyModules () const |
void | InstallLazyFunctionCreator (FunctionCreator C) |
InstallLazyFunctionCreator - If an unknown function is needed, the specified function pointer is invoked to create it. More... | |
Public Member Functions inherited from llvm::InstVisitor< Interpreter > | |
void | visit (Iterator Start, Iterator End) |
void | visit (Module &M) |
void | visit (Function &F) |
void | visit (BasicBlock &BB) |
void | visit (Module *M) |
void | visit (Function *F) |
void | visit (BasicBlock *BB) |
void | visit (Instruction *I) |
void | visit (Instruction &I) |
void | visitModule (Module &M) |
void | visitFunction (Function &F) |
void | visitBasicBlock (BasicBlock &BB) |
void | visitICmpInst (ICmpInst &I) |
void | visitFCmpInst (FCmpInst &I) |
void | visitAllocaInst (AllocaInst &I) |
void | visitLoadInst (LoadInst &I) |
void | visitStoreInst (StoreInst &I) |
void | visitAtomicCmpXchgInst (AtomicCmpXchgInst &I) |
void | visitAtomicRMWInst (AtomicRMWInst &I) |
void | visitFenceInst (FenceInst &I) |
void | visitGetElementPtrInst (GetElementPtrInst &I) |
void | visitPHINode (PHINode &I) |
void | visitTruncInst (TruncInst &I) |
void | visitZExtInst (ZExtInst &I) |
void | visitSExtInst (SExtInst &I) |
void | visitFPTruncInst (FPTruncInst &I) |
void | visitFPExtInst (FPExtInst &I) |
void | visitFPToUIInst (FPToUIInst &I) |
void | visitFPToSIInst (FPToSIInst &I) |
void | visitUIToFPInst (UIToFPInst &I) |
void | visitSIToFPInst (SIToFPInst &I) |
void | visitPtrToIntInst (PtrToIntInst &I) |
void | visitIntToPtrInst (IntToPtrInst &I) |
void | visitBitCastInst (BitCastInst &I) |
void | visitAddrSpaceCastInst (AddrSpaceCastInst &I) |
void | visitSelectInst (SelectInst &I) |
void | visitVAArgInst (VAArgInst &I) |
void | visitExtractElementInst (ExtractElementInst &I) |
void | visitInsertElementInst (InsertElementInst &I) |
void | visitShuffleVectorInst (ShuffleVectorInst &I) |
void | visitExtractValueInst (ExtractValueInst &I) |
void | visitInsertValueInst (InsertValueInst &I) |
void | visitLandingPadInst (LandingPadInst &I) |
void | visitFuncletPadInst (FuncletPadInst &I) |
void | visitCleanupPadInst (CleanupPadInst &I) |
void | visitCatchPadInst (CatchPadInst &I) |
void | visitDbgDeclareInst (DbgDeclareInst &I) |
void | visitDbgValueInst (DbgValueInst &I) |
void | visitDbgVariableIntrinsic (DbgVariableIntrinsic &I) |
void | visitDbgLabelInst (DbgLabelInst &I) |
void | visitDbgInfoIntrinsic (DbgInfoIntrinsic &I) |
void | visitMemSetInst (MemSetInst &I) |
void | visitMemCpyInst (MemCpyInst &I) |
void | visitMemMoveInst (MemMoveInst &I) |
void | visitMemTransferInst (MemTransferInst &I) |
void | visitMemIntrinsic (MemIntrinsic &I) |
void | visitVAStartInst (VAStartInst &I) |
void | visitVAEndInst (VAEndInst &I) |
void | visitVACopyInst (VACopyInst &I) |
void | visitIntrinsicInst (IntrinsicInst &I) |
void | visitCallInst (CallInst &I) |
void | visitInvokeInst (InvokeInst &I) |
void | visitReturnInst (ReturnInst &I) |
void | visitBranchInst (BranchInst &I) |
void | visitSwitchInst (SwitchInst &I) |
void | visitIndirectBrInst (IndirectBrInst &I) |
void | visitResumeInst (ResumeInst &I) |
void | visitUnreachableInst (UnreachableInst &I) |
void | visitCleanupReturnInst (CleanupReturnInst &I) |
void | visitCatchReturnInst (CatchReturnInst &I) |
void | visitCatchSwitchInst (CatchSwitchInst &I) |
void | visitTerminator (Instruction &I) |
void | visitCastInst (CastInst &I) |
void | visitUnaryOperator (UnaryOperator &I) |
void | visitBinaryOperator (BinaryOperator &I) |
void | visitCmpInst (CmpInst &I) |
void | visitUnaryInstruction (UnaryInstruction &I) |
void | visitCallBase (CallBase &I) |
void | visitCallSite (CallSite CS) |
void | visitInstruction (Instruction &I) |
Static Public Member Functions | |
static void | Register () |
static ExecutionEngine * | create (std::unique_ptr< Module > M, std::string *ErrorStr=nullptr) |
Create an interpreter ExecutionEngine. More... | |
Additional Inherited Members | |
Public Attributes inherited from llvm::ExecutionEngine | |
sys::Mutex | lock |
lock - This lock protects the ExecutionEngine and MCJIT classes. More... | |
Protected Member Functions inherited from llvm::ExecutionEngine | |
virtual char * | getMemoryForGV (const GlobalVariable *GV) |
getMemoryforGV - Allocate memory for a global variable. More... | |
std::string | getMangledName (const GlobalValue *GV) |
getMangledName - Get mangled name. More... | |
ExecutionEngine (DataLayout DL) | |
ExecutionEngine (DataLayout DL, std::unique_ptr< Module > M) | |
ExecutionEngine (std::unique_ptr< Module > M) | |
void | emitGlobals () |
EmitGlobals - Emit all of the global variables to memory, storing their addresses into GlobalAddress. More... | |
void | EmitGlobalVariable (const GlobalVariable *GV) |
GenericValue | getConstantValue (const Constant *C) |
Converts a Constant* into a GenericValue, including handling of ConstantExpr values. More... | |
void | LoadValueFromMemory (GenericValue &Result, GenericValue *Ptr, Type *Ty) |
FIXME: document. More... | |
Protected Attributes inherited from llvm::ExecutionEngine | |
SmallVector< std::unique_ptr< Module >, 1 > | Modules |
The list of Modules that we are JIT'ing from. More... | |
FunctionCreator | LazyFunctionCreator |
LazyFunctionCreator - If an unknown function is needed, this function pointer is invoked to create it. More... | |
Static Protected Attributes inherited from llvm::ExecutionEngine | |
static ExecutionEngine *(* | MCJITCtor )(std::unique_ptr< Module > M, std::string *ErrorStr, std::shared_ptr< MCJITMemoryManager > MM, std::shared_ptr< LegacyJITSymbolResolver > SR, std::unique_ptr< TargetMachine > TM) = nullptr |
static ExecutionEngine *(* | OrcMCJITReplacementCtor )(std::string *ErrorStr, std::shared_ptr< MCJITMemoryManager > MM, std::shared_ptr< LegacyJITSymbolResolver > SR, std::unique_ptr< TargetMachine > TM) = nullptr |
static ExecutionEngine *(* | InterpCtor )(std::unique_ptr< Module > M, std::string *ErrorStr) =nullptr |
Definition at line 76 of file Interpreter.h.
|
explicit |
Definition at line 55 of file Interpreter.cpp.
References llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::getDataLayout(), llvm::Intrinsic::memset, and llvm::GenericValue::Untyped.
|
override |
Definition at line 67 of file Interpreter.cpp.
|
inline |
Definition at line 179 of file Interpreter.h.
Referenced by lle_X_atexit().
GenericValue Interpreter::callExternalFunction | ( | Function * | F, |
ArrayRef< GenericValue > | ArgVals | ||
) |
Definition at line 258 of file ExternalFunctions.cpp.
References llvm::errs(), llvm::ExecutionEngine::getDataLayout(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), llvm::GlobalValue::getType(), lookupFunction(), llvm::report_fatal_error(), llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(), and llvm::unique_lock< MutexT >::unlock().
Referenced by callFunction().
void Interpreter::callFunction | ( | Function * | F, |
ArrayRef< GenericValue > | ArgVals | ||
) |
Definition at line 2070 of file Execution.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), llvm::Function::arg_size(), assert(), llvm::ArrayRef< T >::begin(), llvm::BasicBlock::begin(), callExternalFunction(), llvm::ExecutionContext::CurBB, llvm::ExecutionContext::CurFunction, llvm::ExecutionContext::CurInst, E, llvm::ArrayRef< T >::end(), F(), llvm::Function::front(), llvm::Function::getFunctionType(), llvm::Function::getReturnType(), llvm::GlobalValue::isDeclaration(), llvm::FunctionType::isVarArg(), SetValue(), llvm::ArrayRef< T >::size(), and llvm::ExecutionContext::VarArgs.
Referenced by runAtExitHandlers(), runFunction(), and visitCallSite().
|
static |
Create an interpreter ExecutionEngine.
Create a new interpreter object.
Definition at line 35 of file Interpreter.cpp.
void Interpreter::exitCalled | ( | GenericValue | GV | ) |
Definition at line 820 of file Execution.cpp.
References llvm::ExecutionContext::Caller, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::APInt::getZExtValue(), I, llvm::GenericValue::IntVal, llvm::Type::isVoidTy(), llvm::Intrinsic::memset, runAtExitHandlers(), SetValue(), llvm::GenericValue::Untyped, and llvm::APInt::zextOrTrunc().
Referenced by lle_X_exit().
|
inline |
Definition at line 183 of file Interpreter.h.
|
inlineoverridevirtual |
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.
Implements llvm::ExecutionEngine.
Definition at line 111 of file Interpreter.h.
References I.
|
inlinestatic |
Definition at line 97 of file Interpreter.h.
References F().
void Interpreter::run | ( | ) |
Definition at line 2107 of file Execution.cpp.
References llvm::ExecutionContext::CurInst, llvm::dbgs(), LLVM_DEBUG, and llvm::InstVisitor< Interpreter >::visit().
Referenced by runAtExitHandlers(), and runFunction().
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 71 of file Interpreter.cpp.
References callFunction(), llvm::None, and run().
Referenced by exitCalled().
|
overridevirtual |
run - Start execution with the specified function and arguments.
Implements llvm::ExecutionEngine.
Definition at line 81 of file Interpreter.cpp.
References assert(), callFunction(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), run(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
void Interpreter::visitAllocaInst | ( | AllocaInst & | I | ) |
Definition at line 962 of file Execution.cpp.
References assert(), llvm::dbgs(), E, getBitWidth(), llvm::ExecutionEngine::getDataLayout(), llvm::StructLayout::getElementOffset(), llvm::PointerType::getElementType(), llvm::generic_gep_type_iterator< ItTy >::getIndexedType(), llvm::Instruction::getOpcode(), llvm::generic_gep_type_iterator< ItTy >::getOperand(), llvm::User::getOperand(), llvm::DataLayout::getStructLayout(), llvm::generic_gep_type_iterator< ItTy >::getStructTypeOrNull(), llvm::AllocaInst::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getZExtValue(), llvm::APInt::getZExtValue(), I, llvm::GenericValue::IntVal, llvm::tgtok::IntVal, llvm::Type::isPointerTy(), LLVM_DEBUG, llvm::max(), llvm::GenericValue::PointerVal, llvm::PTOGV(), llvm::safe_malloc(), and SetValue().
void Interpreter::visitAShr | ( | BinaryOperator & | I | ) |
Definition at line 1190 of file Execution.cpp.
References llvm::GenericValue::AggregateVal, llvm::APInt::ashr(), assert(), llvm::APInt::bitsToDouble(), llvm::APInt::bitsToFloat(), llvm::APInt::doubleToBits(), llvm::GenericValue::DoubleVal, llvm::APInt::floatToBits(), llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::IntegerType::getBitWidth(), getBitWidth(), llvm::APInt::getBitWidth(), llvm::ExecutionEngine::getDataLayout(), llvm::User::getOperand(), llvm::DataLayout::getPointerSizeInBits(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), getShiftAmount(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::APInt::getZExtValue(), llvm::GenericValue::IntVal, llvm::Type::isDoubleTy(), llvm::Type::isFloatingPointTy(), llvm::Type::isFloatTy(), llvm::Type::isIntegerTy(), llvm::DataLayout::isLittleEndian(), llvm::Type::isPointerTy(), llvm::Type::isVectorTy(), llvm_unreachable, llvm::APInt::lshrInPlace(), llvm::GenericValue::PointerVal, llvm::APIntOps::RoundAPIntToDouble(), llvm::APIntOps::RoundAPIntToFloat(), llvm::APIntOps::RoundDoubleToAPInt(), llvm::APIntOps::RoundFloatToAPInt(), llvm::APIntOps::RoundSignedAPIntToDouble(), llvm::APIntOps::RoundSignedAPIntToFloat(), SetValue(), llvm::APInt::sext(), llvm::size(), llvm::APInt::trunc(), llvm::Type::VectorTyID, llvm::APInt::zext(), and llvm::APInt::zextOrTrunc().
void Interpreter::visitBinaryOperator | ( | BinaryOperator & | I | ) |
Definition at line 681 of file Execution.cpp.
References llvm::MCID::Add, llvm::GenericValue::AggregateVal, assert(), llvm::dbgs(), executeFAddInst(), executeFDivInst(), executeFMulInst(), executeFRemInst(), executeFSubInst(), FLOAT_VECTOR_OP, llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), I, INTEGER_VECTOR_FUNCTION, INTEGER_VECTOR_OPERATION, llvm::GenericValue::IntVal, llvm::Type::isVectorTy(), llvm_unreachable, llvm::APInt::sdiv(), SetValue(), llvm::APInt::srem(), llvm::APInt::udiv(), and llvm::APInt::urem().
void Interpreter::visitBitCastInst | ( | BitCastInst & | I | ) |
Definition at line 1709 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitBranchInst | ( | BranchInst & | I | ) |
Definition at line 881 of file Execution.cpp.
References llvm::BranchInst::getCondition(), llvm::BranchInst::getSuccessor(), llvm::tgtok::IntVal, and llvm::BranchInst::isUnconditional().
|
inline |
Definition at line 154 of file Interpreter.h.
void Interpreter::visitCallSite | ( | CallSite | CS | ) |
Definition at line 1063 of file Execution.cpp.
References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::ExecutionContext::Caller, callFunction(), llvm::ExecutionContext::CurInst, F(), llvm::GenericValue::IntPair::first, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Function::getIntrinsicID(), llvm::Instruction::getParent(), llvm::GVTOP(), llvm::GlobalValue::isDeclaration(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::Intrinsic::not_intrinsic, llvm::GenericValue::IntPair::second, SetValue(), llvm::GenericValue::UIntPairVal, llvm::Intrinsic::vacopy, llvm::Intrinsic::vaend, and llvm::Intrinsic::vastart.
void Interpreter::visitExtractElementInst | ( | ExtractElementInst & | I | ) |
Definition at line 1746 of file Execution.cpp.
References llvm::GenericValue::AggregateVal, llvm::dbgs(), llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::IntegerTyID, llvm_unreachable, and SetValue().
void Interpreter::visitExtractValueInst | ( | ExtractValueInst & | I | ) |
Definition at line 1879 of file Execution.cpp.
References llvm::GenericValue::AggregateVal, llvm::Type::ArrayTyID, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::ExtractValueInst::getAggregateOperand(), llvm::ExtractValueInst::getIndexedType(), llvm::ExtractValueInst::getIndices(), llvm::ExtractValueInst::getNumIndices(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::ExtractValueInst::idx_begin(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm_unreachable, llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, SetValue(), llvm::Type::StructTyID, and llvm::Type::VectorTyID.
void Interpreter::visitFCmpInst | ( | FCmpInst & | I | ) |
Definition at line 610 of file Execution.cpp.
References llvm::dbgs(), executeFCMP_BOOL(), 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(), I, llvm_unreachable, and SetValue().
void Interpreter::visitFPExtInst | ( | FPExtInst & | I | ) |
Definition at line 1674 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitFPToSIInst | ( | FPToSIInst & | I | ) |
Definition at line 1694 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitFPToUIInst | ( | FPToUIInst & | I | ) |
Definition at line 1689 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitFPTruncInst | ( | FPTruncInst & | I | ) |
Definition at line 1669 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitGetElementPtrInst | ( | GetElementPtrInst & | I | ) |
Definition at line 1032 of file Execution.cpp.
References llvm::gep_type_begin(), llvm::gep_type_end(), llvm::GetElementPtrInst::getPointerOperand(), and SetValue().
void Interpreter::visitICmpInst | ( | ICmpInst & | I | ) |
Definition at line 278 of file Execution.cpp.
References llvm::dbgs(), 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(), I, 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, and SetValue().
void Interpreter::visitIndirectBrInst | ( | IndirectBrInst & | I | ) |
Definition at line 913 of file Execution.cpp.
References assert(), llvm::BasicBlock::begin(), llvm::ExecutionContext::CurBB, llvm::ExecutionContext::CurInst, llvm::dyn_cast(), llvm::IndirectBrInst::getAddress(), llvm::PHINode::getBasicBlockIndex(), llvm::PHINode::getIncomingValue(), llvm::GVTOP(), and SetValue().
void Interpreter::visitInsertElementInst | ( | InsertElementInst & | I | ) |
Definition at line 1779 of file Execution.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::SequentialType::getElementType(), llvm::User::getOperand(), llvm::InsertElementInst::getType(), llvm::Type::getTypeID(), llvm::Type::IntegerTyID, llvm_unreachable, and SetValue().
void Interpreter::visitInsertValueInst | ( | InsertValueInst & | I | ) |
Definition at line 1921 of file Execution.cpp.
References llvm::MCID::Add, llvm::GenericValue::AggregateVal, llvm::Type::ArrayTyID, llvm::APInt::ashr(), llvm::dbgs(), llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, executeCmpInst(), executeFAddInst(), executeFDivInst(), executeFMulInst(), executeFRemInst(), executeFSubInst(), executeSelectInst(), llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::gep_type_begin(), llvm::gep_type_end(), llvm::InsertValueInst::getAggregateOperand(), llvm::ExecutionEngine::getConstantValue(), llvm::ExtractValueInst::getIndexedType(), llvm::InsertValueInst::getIndices(), llvm::InsertValueInst::getNumIndices(), llvm::ConstantExpr::getOpcode(), llvm::User::getOperand(), llvm::ExecutionEngine::getPointerToGlobal(), llvm::ConstantExpr::getPredicate(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::InsertValueInst::idx_begin(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm_unreachable, llvm::APInt::lshr(), llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, llvm::PTOGV(), llvm::APInt::sdiv(), llvm::MCID::Select, SetValue(), llvm::APInt::shl(), llvm::APInt::srem(), llvm::Type::StructTyID, llvm::APInt::udiv(), llvm::APInt::urem(), llvm::ExecutionContext::Values, and llvm::Type::VectorTyID.
|
inline |
Definition at line 170 of file Interpreter.h.
References llvm::errs(), and llvm_unreachable.
void Interpreter::visitIntToPtrInst | ( | IntToPtrInst & | I | ) |
Definition at line 1704 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
|
inline |
Definition at line 155 of file Interpreter.h.
void Interpreter::visitLoadInst | ( | LoadInst & | I | ) |
Definition at line 1038 of file Execution.cpp.
References llvm::dbgs(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), llvm::GVTOP(), I, llvm::LoadInst::isVolatile(), llvm::ExecutionEngine::LoadValueFromMemory(), PrintVolatile, and SetValue().
void Interpreter::visitLShr | ( | BinaryOperator & | I | ) |
Definition at line 1163 of file Execution.cpp.
References llvm::GenericValue::AggregateVal, assert(), llvm::User::getOperand(), getShiftAmount(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::GenericValue::IntVal, llvm::Type::isVectorTy(), llvm::APInt::lshr(), and SetValue().
|
inline |
Definition at line 135 of file Interpreter.h.
References llvm_unreachable.
void Interpreter::visitPtrToIntInst | ( | PtrToIntInst & | I | ) |
Definition at line 1699 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitReturnInst | ( | ReturnInst & | I | ) |
Definition at line 863 of file Execution.cpp.
References llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::ReturnInst::getReturnValue(), llvm::Value::getType(), and llvm::Type::getVoidTy().
void Interpreter::visitSelectInst | ( | SelectInst & | I | ) |
Definition at line 806 of file Execution.cpp.
References executeSelectInst(), llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitSExtInst | ( | SExtInst & | I | ) |
Definition at line 1659 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitShl | ( | BinaryOperator & | I | ) |
Definition at line 1136 of file Execution.cpp.
References llvm::GenericValue::AggregateVal, assert(), llvm::User::getOperand(), getShiftAmount(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::GenericValue::IntVal, llvm::Type::isVectorTy(), SetValue(), and llvm::APInt::shl().
void Interpreter::visitShuffleVectorInst | ( | ShuffleVectorInst & | I | ) |
Definition at line 1811 of file Execution.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::SequentialType::getElementType(), llvm::User::getOperand(), llvm::ShuffleVectorInst::getType(), llvm::Type::getTypeID(), llvm::Type::IntegerTyID, llvm_unreachable, and SetValue().
void Interpreter::visitSIToFPInst | ( | SIToFPInst & | I | ) |
Definition at line 1684 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitStoreInst | ( | StoreInst & | I | ) |
Definition at line 1049 of file Execution.cpp.
References llvm::dbgs(), llvm::User::getOperand(), llvm::StoreInst::getPointerOperand(), llvm::Value::getType(), llvm::GVTOP(), I, llvm::StoreInst::isVolatile(), PrintVolatile, and llvm::ExecutionEngine::StoreValueToMemory().
void Interpreter::visitSwitchInst | ( | SwitchInst & | I | ) |
Definition at line 894 of file Execution.cpp.
References llvm::SwitchInst::cases(), executeICMP_EQ(), llvm::SwitchInst::getCondition(), llvm::SwitchInst::getDefaultDest(), llvm::Value::getType(), and llvm::GenericValue::IntVal.
void Interpreter::visitTruncInst | ( | TruncInst & | I | ) |
Definition at line 1654 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitUIToFPInst | ( | UIToFPInst & | I | ) |
Definition at line 1679 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().
void Interpreter::visitUnreachableInst | ( | UnreachableInst & | I | ) |
Definition at line 877 of file Execution.cpp.
References llvm::report_fatal_error().
void Interpreter::visitVAArgInst | ( | VAArgInst & | I | ) |
Definition at line 1717 of file Execution.cpp.
References llvm::dbgs(), llvm::GenericValue::IntPair::first, llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), IMPLEMENT_VAARG, llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm_unreachable, llvm::GenericValue::IntPair::second, SetValue(), and llvm::GenericValue::UIntPairVal.
void Interpreter::visitZExtInst | ( | ZExtInst & | I | ) |
Definition at line 1664 of file Execution.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), and SetValue().