LLVM
8.0.1
|
#include "Interpreter.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Config/config.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Casting.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 "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cmath>
#include <csignal>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Typedefs | |
typedef GenericValue(* | ExFunc) (FunctionType *, ArrayRef< GenericValue >) |
Functions | |
static char | getTypeID (Type *Ty) |
static ExFunc | lookupFunction (const Function *F) |
static GenericValue | lle_X_atexit (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_exit (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_abort (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_sprintf (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_printf (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_sscanf (FunctionType *FT, ArrayRef< GenericValue > args) |
static GenericValue | lle_X_scanf (FunctionType *FT, ArrayRef< GenericValue > args) |
static GenericValue | lle_X_fprintf (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_memset (FunctionType *FT, ArrayRef< GenericValue > Args) |
static GenericValue | lle_X_memcpy (FunctionType *FT, ArrayRef< GenericValue > Args) |
Variables | |
static ManagedStatic< sys::Mutex > | FunctionsLock |
static ManagedStatic< std::map< const Function *, ExFunc > > | ExportedFunctions |
static ManagedStatic< std::map< std::string, ExFunc > > | FuncNames |
static Interpreter * | TheInterpreter |
typedef GenericValue(* ExFunc) (FunctionType *, ArrayRef< GenericValue >) |
Definition at line 63 of file ExternalFunctions.cpp.
Definition at line 74 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 |
Definition at line 327 of file ExternalFunctions.cpp.
Referenced by lle_X_memcpy().
|
static |
Definition at line 311 of file ExternalFunctions.cpp.
References llvm::Interpreter::addAtExitHandler(), assert(), llvm::GVTOP(), llvm::GenericValue::IntVal, and llvm::ArrayRef< T >::size().
Referenced by lle_X_memcpy().
|
static |
Definition at line 321 of file ExternalFunctions.cpp.
References llvm::Interpreter::exitCalled().
Referenced by lle_X_memcpy().
|
static |
Definition at line 460 of file ExternalFunctions.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::GVTOP(), lle_X_sprintf(), llvm::PTOGV(), and llvm::ArrayRef< T >::size().
Referenced by lle_X_memcpy().
|
static |
Definition at line 485 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, lle_X_abort(), lle_X_atexit(), lle_X_exit(), lle_X_fprintf(), lle_X_memset(), lle_X_printf(), lle_X_scanf(), lle_X_sprintf(), lle_X_sscanf(), and llvm::Intrinsic::memcpy.
|
static |
Definition at line 473 of file ExternalFunctions.cpp.
References llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, and llvm::Intrinsic::memset.
Referenced by lle_X_memcpy().
|
static |
Definition at line 418 of file ExternalFunctions.cpp.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), lle_X_sprintf(), llvm::outs(), and llvm::PTOGV().
Referenced by lle_X_memcpy().
|
static |
Definition at line 445 of file ExternalFunctions.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::GVTOP(), llvm::GenericValue::IntVal, and llvm::ArrayRef< T >::size().
Referenced by lle_X_memcpy().
|
static |
Definition at line 336 of file ExternalFunctions.cpp.
References llvm::errs(), llvm::ExecutionEngine::getDataLayout(), llvm::DataLayout::getPointerSizeInBits(), llvm::GVTOP(), llvm::GenericValue::IntVal, llvm::tgtok::IntVal, llvm::Intrinsic::memcpy, and Size.
Referenced by lle_X_fprintf(), lle_X_memcpy(), and lle_X_printf().
|
static |
Definition at line 430 of file ExternalFunctions.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::GVTOP(), llvm::GenericValue::IntVal, and llvm::ArrayRef< T >::size().
Referenced by lle_X_memcpy().
Definition at line 101 of file ExternalFunctions.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), llvm::Function::arg_size(), llvm::SmallVectorTemplateCommon< T >::data(), llvm::Type::DoubleTyID, llvm::GenericValue::DoubleVal, E, F(), llvm::Type::FloatTyID, llvm::GenericValue::FloatVal, llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), getTypeID(), llvm::Type::getTypeID(), llvm::DataLayout::getTypeStoreSize(), llvm::APInt::getZExtValue(), llvm::GVTOP(), llvm::Type::IntegerTyID, llvm::GenericValue::IntVal, llvm::Function::isVarArg(), llvm::FunctionType::params(), llvm::Type::PointerTyID, llvm::GenericValue::PointerVal, llvm::report_fatal_error(), llvm::SmallVectorImpl< T >::resize(), llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(), llvm::ArrayRef< T >::size(), llvm::cl::values(), and llvm::Type::VoidTyID.
Referenced by llvm::Interpreter::callExternalFunction().
|
static |
Definition at line 64 of file ExternalFunctions.cpp.
|
static |
Definition at line 65 of file ExternalFunctions.cpp.
|
static |
Definition at line 61 of file ExternalFunctions.cpp.
|
static |
Definition at line 72 of file ExternalFunctions.cpp.