LLVM API Documentation
#include "Interpreter.h"
#include "llvm/Config/config.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/UniqueLock.h"
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstring>
#include <map>
Go to the source code of this file.
typedef GenericValue(* ExFunc)(FunctionType *, const std::vector< GenericValue > &) |
Definition at line 52 of file ExternalFunctions.cpp.
Definition at line 64 of file ExternalFunctions.cpp.
References llvm::Type::ArrayTyID, llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FunctionTyID, llvm::Type::getTypeID(), llvm::Type::IntegerTyID, llvm::Type::PointerTyID, llvm::Type::StructTyID, and llvm::Type::VoidTyID.
Referenced by llvm::ConstantDataSequential::getElementAsAPFloat(), LLVMCreateGenericValueOfFloat(), LLVMGenericValueToFloat(), LLVMGetTypeKind(), and lookupFunction().
static GenericValue lle_X_abort | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 322 of file ExternalFunctions.cpp.
static GenericValue lle_X_atexit | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 303 of file ExternalFunctions.cpp.
References llvm::Interpreter::addAtExitHandler(), llvm::GVTOP(), llvm::GenericValue::IntVal, and TheInterpreter.
static GenericValue lle_X_exit | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 314 of file ExternalFunctions.cpp.
References llvm::Interpreter::exitCalled(), and TheInterpreter.
static GenericValue lle_X_fprintf | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 462 of file ExternalFunctions.cpp.
References llvm::LibFunc::fputs, llvm::GVTOP(), lle_X_sprintf(), and llvm::PTOGV().
static GenericValue lle_X_memcpy | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 487 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, and llvm::LibFunc::memcpy.
static GenericValue lle_X_memset | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 475 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, and llvm::LibFunc::memset.
static GenericValue lle_X_printf | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 416 of file ExternalFunctions.cpp.
References lle_X_sprintf(), llvm::outs(), and llvm::PTOGV().
static GenericValue lle_X_scanf | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | args | ||
) | [static] |
Definition at line 445 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, and llvm::LibFunc::scanf.
static GenericValue lle_X_sprintf | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | Args | ||
) | [static] |
Definition at line 333 of file ExternalFunctions.cpp.
References llvm::errs(), llvm::ExecutionEngine::getDataLayout(), llvm::DataLayout::getPointerSizeInBits(), llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, llvm::IndexedInstrProf::Last, llvm::LibFunc::memcpy, llvm::LibFunc::sprintf, llvm::LibFunc::strlen, and TheInterpreter.
Referenced by lle_X_fprintf(), and lle_X_printf().
static GenericValue lle_X_sscanf | ( | FunctionType * | FT, |
const std::vector< GenericValue > & | args | ||
) | [static] |
Definition at line 429 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, and llvm::LibFunc::sscanf.
static ExFunc lookupFunction | ( | const Function * | F | ) | [static] |
Definition at line 91 of file ExternalFunctions.cpp.
References ExportedFunctions, FuncNames, FunctionsLock, llvm::Type::getContainedType(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::Type::getNumContainedTypes(), getTypeID(), llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(), and llvm::StringRef::str().
Referenced by llvm::Interpreter::callExternalFunction().
ManagedStatic<std::map<const Function *, ExFunc> > ExportedFunctions [static] |
Definition at line 54 of file ExternalFunctions.cpp.
Referenced by llvm::Interpreter::callExternalFunction(), and lookupFunction().
Definition at line 55 of file ExternalFunctions.cpp.
Referenced by lookupFunction().
ManagedStatic<sys::Mutex> FunctionsLock [static] |
Definition at line 50 of file ExternalFunctions.cpp.
Referenced by llvm::Interpreter::callExternalFunction(), and lookupFunction().
Interpreter* TheInterpreter [static] |
Definition at line 62 of file ExternalFunctions.cpp.
Referenced by llvm::Interpreter::callExternalFunction(), lle_X_atexit(), lle_X_exit(), and lle_X_sprintf().