LLVM API Documentation
#include "Interpreter.h"#include "llvm/DerivedTypes.h"#include "llvm/Module.h"#include "llvm/Support/Streams.h"#include "llvm/System/DynamicLibrary.h"#include "llvm/Target/TargetData.h"#include "llvm/Support/ManagedStatic.h"#include <csignal>#include <cstdio>#include <map>#include <cmath>#include <cstring>

Go to the source code of this file.
| #define getFILE | ( | ptr | ) | ((FILE*)ptr) |
Definition at line 616 of file ExternalFunctions.cpp.
Referenced by lle_X_fclose(), lle_X_feof(), lle_X_ferror(), lle_X_fflush(), lle_X_fgets(), lle_X_fprintf(), lle_X_fputc(), lle_X_fread(), lle_X_freopen(), lle_X_fwrite(), lle_X_getc(), and lle_X_ungetc().
| typedef GenericValue(* ExFunc)(FunctionType *, const vector< GenericValue > &) |
Definition at line 43 of file ExternalFunctions.cpp.
| static void ByteswapSCANFResults | ( | const char * | Fmt, | |
| void * | Arg0, | |||
| void * | Arg1, | |||
| void * | Arg2, | |||
| void * | Arg3, | |||
| void * | Arg4, | |||
| void * | Arg5, | |||
| void * | Arg6, | |||
| void * | Arg7, | |||
| void * | Arg8 | |||
| ) | [static] |
Definition at line 398 of file ExternalFunctions.cpp.
References Arg, llvm::Type::DoubleTy, llvm::Type::FloatTy, llvm::Type::Int16Ty, llvm::Type::Int32Ty, llvm::Type::Int64Ty, llvm::Type::Int8Ty, Out, llvm::ExecutionEngine::StoreValueToMemory(), and Ty.
Referenced by lle_X_scanf(), and lle_X_sscanf().
| static char getTypeID | ( | const Type * | Ty | ) | [static] |
Definition at line 49 of file ExternalFunctions.cpp.
References llvm::Type::getTypeID().
Referenced by llvm::ConstantStruct::ConstantStruct(), LLVMCreateGenericValueOfFloat(), LLVMGenericValueToFloat(), and lookupFunction().
| static size_t GV_to_size_t | ( | GenericValue | GV | ) | [static] |
Definition at line 553 of file ExternalFunctions.cpp.
References llvm::APInt::getZExtValue(), and llvm::GenericValue::IntVal.
Referenced by lle_X_fread(), lle_X_fwrite(), lle_X_memcpy(), lle_X_memmove(), and lle_X_memset().
| GenericValue lle_i_clock | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X___cxa_guard_acquire | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 740 of file ExternalFunctions.cpp.
References llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X___cxa_guard_release | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X___strdup | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 579 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X__IO_getc | ( | FunctionType * | F, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X__IO_putc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 135 of file ExternalFunctions.cpp.
| GenericValue lle_X_abort | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 160 of file ExternalFunctions.cpp.
| GenericValue lle_X_atexit | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 145 of file ExternalFunctions.cpp.
References llvm::Interpreter::addAtExitHandler(), GV, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_atoi | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_calloc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 173 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), and llvm::PTOGV().
| GenericValue lle_X_cos | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_exit | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_exp | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_fclose | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 627 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_feof | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 635 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_ferror | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 718 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_fflush | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 679 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_fgets | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 664 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_floor | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_fopen | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 619 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_fprintf | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 727 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), lle_X_sprintf(), and llvm::PTOGV().
| GenericValue lle_X_fputc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 700 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_fread | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 644 of file ExternalFunctions.cpp.
References getFILE, GV_to_size_t(), llvm::GVTOP(), and size_t_to_GV().
| GenericValue lle_X_free | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_freopen | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 671 of file ExternalFunctions.cpp.
References getFILE, llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_fwrite | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 654 of file ExternalFunctions.cpp.
References getFILE, GV_to_size_t(), llvm::GVTOP(), and size_t_to_GV().
| GenericValue lle_X_getc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 687 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
Referenced by lle_X__IO_getc().
| GenericValue lle_X_log | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_malloc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 166 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), and llvm::PTOGV().
| GenericValue lle_X_memcpy | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 595 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), GV_to_size_t(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_memmove | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 603 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), GV_to_size_t(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_memset | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 586 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), GV_to_size_t(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_pow | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_printf | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 388 of file ExternalFunctions.cpp.
References llvm::cout(), lle_X_sprintf(), and llvm::PTOGV().
| GenericValue lle_X_putchar | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_puts | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 301 of file ExternalFunctions.cpp.
References llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_rand | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_realloc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 181 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_scanf | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | args | |||
| ) |
Definition at line 491 of file ExternalFunctions.cpp.
References ByteswapSCANFResults(), llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_sin | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_sprintf | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 310 of file ExternalFunctions.cpp.
References llvm::cerr(), llvm::TargetData::getPointerSizeInBits(), llvm::ExecutionEngine::getTargetData(), llvm::GVTOP(), and llvm::GenericValue::IntVal.
Referenced by lle_X_fprintf(), and lle_X_printf().
| GenericValue lle_X_sqrt | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_srand | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 294 of file ExternalFunctions.cpp.
| GenericValue lle_X_sscanf | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | args | |||
| ) |
Definition at line 475 of file ExternalFunctions.cpp.
References ByteswapSCANFResults(), llvm::GVTOP(), and llvm::GenericValue::IntVal.
| GenericValue lle_X_strcat | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 529 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_strcmp | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 521 of file ExternalFunctions.cpp.
References llvm::GVTOP(), and llvm::MipsISD::Ret.
| GenericValue lle_X_strcpy | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 536 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_strdup | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 572 of file ExternalFunctions.cpp.
References llvm::FunctionType::getReturnType(), llvm::GVTOP(), and llvm::PTOGV().
| GenericValue lle_X_strlen | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
| GenericValue lle_X_ungetc | ( | FunctionType * | FT, | |
| const vector< GenericValue > & | Args | |||
| ) |
Definition at line 709 of file ExternalFunctions.cpp.
References getFILE, llvm::GVTOP(), and llvm::GenericValue::IntVal.
Definition at line 77 of file ExternalFunctions.cpp.
References FuncNames, llvm::Type::getContainedType(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::Type::getNumContainedTypes(), and getTypeID().
Referenced by llvm::Interpreter::callExternalFunction().
| static GenericValue size_t_to_GV | ( | size_t | n | ) | [static] |
Definition at line 542 of file ExternalFunctions.cpp.
References llvm::GenericValue::IntVal, and llvm::MipsISD::Ret.
Referenced by lle_X_fread(), lle_X_fwrite(), and lle_X_strlen().
ManagedStatic<std::map<const Function *, ExFunc> > Functions [static] |
Definition at line 44 of file ExternalFunctions.cpp.
Referenced by llvm::BasicInlinerImpl::addFunction(), llvm::GCStrategy::begin(), llvm::GCStrategy::end(), and llvm::ProgramInfo::getSourceFunctions().
Interpreter* TheInterpreter [static] |
Definition at line 47 of file ExternalFunctions.cpp