LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::JIT Class Reference

#include <JIT.h>

Inheritance diagram for llvm::JIT:

Inheritance graph
[legend]
Collaboration diagram for llvm::JIT:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~JIT ()
TargetJITInfogetJITInfo () const
virtual GenericValue runFunction (Function *F, const std::vector< GenericValue > &ArgValues)
void * getPointerToNamedFunction (const std::string &Name)
void * getPointerToFunction (Function *F)
void * getOrEmitGlobalVariable (const GlobalVariable *GV)
void * getPointerToFunctionOrStub (Function *F)
void * recompileAndRelinkFunction (Function *F)
void freeMachineCodeForFunction (Function *F)

Static Public Member Functions

static ExecutionEnginecreate (ModuleProvider *MP, IntrinsicLowering *IL=0)
static void CompilationCallback ()

Detailed Description

Definition at line 30 of file JIT.h.


Constructor & Destructor Documentation

JIT::~JIT  ) 
 

Definition at line 54 of file JIT.cpp.


Member Function Documentation

static void llvm::JIT::CompilationCallback  )  [static]
 

ExecutionEngine * JIT::create ModuleProvider MP,
IntrinsicLowering IL = 0
[static]
 

create - Create an return a new JIT compiler if there is one available for the current target. Otherwise, return null. If the JIT is created successfully, it takes responsibility for deleting the specified IntrinsicLowering implementation.

Definition at line 29 of file TargetSelect.cpp.

References Error(), llvm::TargetMachineRegistry::getClosestTargetForJIT(), llvm::TargetMachine::getJITInfo(), llvm::ModuleProvider::getModule(), MArch, and Target.

Referenced by llvm::ExecutionEngine::create().

void JIT::freeMachineCodeForFunction Function F  )  [virtual]
 

freeMachineCodeForFunction - deallocate memory used to code-generate this Function.

Implements llvm::ExecutionEngine.

Definition at line 322 of file JIT.cpp.

TargetJITInfo& llvm::JIT::getJITInfo  )  const [inline]
 

getJITInfo - Return the target JIT information structure.

Definition at line 48 of file JIT.h.

void * JIT::getOrEmitGlobalVariable const GlobalVariable GV  )  [virtual]
 

getOrEmitGlobalVariable - Return the address of the specified global variable, possibly emitting it to memory if needed. This is used by the Emitter.

Reimplemented from llvm::ExecutionEngine.

Definition at line 271 of file JIT.cpp.

References abort(), llvm::ExecutionEngine::addGlobalMapping(), llvm::SequentialType::getElementType(), llvm::Value::getName(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), llvm::ExecutionEngine::getTargetData(), llvm::GlobalValue::getType(), llvm::TargetData::getTypeSize(), llvm::GlobalVariable::isExternal(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().

void * JIT::getPointerToFunction Function F  )  [virtual]
 

getPointerToFunction - This returns the address of the specified function, compiling it if necessary.

Implements llvm::ExecutionEngine.

Definition at line 237 of file JIT.cpp.

References abort(), llvm::ExecutionEngine::addGlobalMapping(), llvm::Value::getName(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), getPointerToNamedFunction(), llvm::GlobalValue::hasNotBeenReadFromBytecode(), llvm::Function::isExternal(), and llvm::ModuleProvider::materializeFunction().

Referenced by getPointerToNamedFunction(), recompileAndRelinkFunction(), and runFunction().

void * JIT::getPointerToFunctionOrStub Function F  )  [virtual]
 

getPointerToFunctionOrStub - If the specified function has been code-gen'd, return a pointer to the function. If not, compile it, or use a stub to implement lazy compilation if available.

Reimplemented from llvm::ExecutionEngine.

Definition at line 215 of file JITEmitter.cpp.

References getJITResolver(), and llvm::ExecutionEngine::getPointerToGlobalIfAvailable().

void * JIT::getPointerToNamedFunction const std::string &  Name  ) 
 

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.

Definition at line 89 of file Intercept.cpp.

References __mainFunc(), abort(), jit_atexit(), jit_exit(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().

Referenced by getPointerToFunction(), and getPointerToNamedFunction().

void * JIT::recompileAndRelinkFunction Function F  )  [virtual]
 

recompileAndRelinkFunction - This method is used to force a function which has already been compiled, to be compiled again, possibly after it has been modified. Then the entry to the old copy is overwritten with a branch to the new copy. If there was no old copy, this acts just like JIT::getPointerToFunction().

Implements llvm::ExecutionEngine.

Definition at line 301 of file JIT.cpp.

References llvm::ExecutionEngine::addGlobalMapping(), getPointerToFunction(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), and llvm::TargetJITInfo::replaceMachineCodeForFunction().

GenericValue JIT::runFunction Function F,
const std::vector< GenericValue > &  ArgValues
[virtual]
 

run - Start execution with the specified function and arguments.

Implements llvm::ExecutionEngine.

Definition at line 61 of file JIT.cpp.

References llvm::ISD::BasicBlock, llvm::Type::BoolTyID, llvm::GenericValue::BoolVal, C, llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::ConstantFP::get(), llvm::ConstantUInt::get(), llvm::ConstantSInt::get(), llvm::ConstantBool::get(), llvm::FunctionType::get(), llvm::ConstantExpr::getCast(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), getPointerToFunction(), llvm::FunctionType::getReturnType(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::GVTOP(), llvm::GlobalValue::InternalLinkage, llvm::Type::IntTy, llvm::Type::IntTyID, llvm::GenericValue::IntVal, llvm::FunctionType::isVarArg(), llvm::Type::LongTy, llvm::Type::LongTyID, llvm::GenericValue::LongVal, llvm::Type::PointerTyID, llvm::PTOGV(), llvm::Type::SByteTyID, llvm::GenericValue::SByteVal, llvm::Type::ShortTyID, llvm::GenericValue::ShortVal, llvm::Type::UByteTyID, llvm::GenericValue::UByteVal, llvm::Type::UIntTy, llvm::Type::UIntTyID, llvm::GenericValue::UIntVal, llvm::Type::ULongTyID, llvm::GenericValue::ULongVal, llvm::Type::UShortTyID, llvm::GenericValue::UShortVal, llvm::Type::VoidTy, and llvm::Type::VoidTyID.


The documentation for this class was generated from the following files: