forked from OSchip/llvm-project
EE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped in FuncNames[] at the initialization.
llvm-svn: 151313
This commit is contained in:
parent
7fe000581e
commit
c5ea5d3fa1
|
@ -298,6 +298,7 @@ GenericValue Interpreter::callExternalFunction(Function *F,
|
||||||
//
|
//
|
||||||
|
|
||||||
// void atexit(Function*)
|
// void atexit(Function*)
|
||||||
|
static
|
||||||
GenericValue lle_X_atexit(FunctionType *FT,
|
GenericValue lle_X_atexit(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
assert(Args.size() == 1);
|
assert(Args.size() == 1);
|
||||||
|
@ -308,6 +309,7 @@ GenericValue lle_X_atexit(FunctionType *FT,
|
||||||
}
|
}
|
||||||
|
|
||||||
// void exit(int)
|
// void exit(int)
|
||||||
|
static
|
||||||
GenericValue lle_X_exit(FunctionType *FT,
|
GenericValue lle_X_exit(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
TheInterpreter->exitCalled(Args[0]);
|
TheInterpreter->exitCalled(Args[0]);
|
||||||
|
@ -315,6 +317,7 @@ GenericValue lle_X_exit(FunctionType *FT,
|
||||||
}
|
}
|
||||||
|
|
||||||
// void abort(void)
|
// void abort(void)
|
||||||
|
static
|
||||||
GenericValue lle_X_abort(FunctionType *FT,
|
GenericValue lle_X_abort(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
//FIXME: should we report or raise here?
|
//FIXME: should we report or raise here?
|
||||||
|
@ -325,6 +328,7 @@ GenericValue lle_X_abort(FunctionType *FT,
|
||||||
|
|
||||||
// int sprintf(char *, const char *, ...) - a very rough implementation to make
|
// int sprintf(char *, const char *, ...) - a very rough implementation to make
|
||||||
// output useful.
|
// output useful.
|
||||||
|
static
|
||||||
GenericValue lle_X_sprintf(FunctionType *FT,
|
GenericValue lle_X_sprintf(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
char *OutputBuffer = (char *)GVTOP(Args[0]);
|
char *OutputBuffer = (char *)GVTOP(Args[0]);
|
||||||
|
@ -406,6 +410,7 @@ GenericValue lle_X_sprintf(FunctionType *FT,
|
||||||
|
|
||||||
// int printf(const char *, ...) - a very rough implementation to make output
|
// int printf(const char *, ...) - a very rough implementation to make output
|
||||||
// useful.
|
// useful.
|
||||||
|
static
|
||||||
GenericValue lle_X_printf(FunctionType *FT,
|
GenericValue lle_X_printf(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
char Buffer[10000];
|
char Buffer[10000];
|
||||||
|
@ -418,6 +423,7 @@ GenericValue lle_X_printf(FunctionType *FT,
|
||||||
}
|
}
|
||||||
|
|
||||||
// int sscanf(const char *format, ...);
|
// int sscanf(const char *format, ...);
|
||||||
|
static
|
||||||
GenericValue lle_X_sscanf(FunctionType *FT,
|
GenericValue lle_X_sscanf(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &args) {
|
const std::vector<GenericValue> &args) {
|
||||||
assert(args.size() < 10 && "Only handle up to 10 args to sscanf right now!");
|
assert(args.size() < 10 && "Only handle up to 10 args to sscanf right now!");
|
||||||
|
@ -433,6 +439,7 @@ GenericValue lle_X_sscanf(FunctionType *FT,
|
||||||
}
|
}
|
||||||
|
|
||||||
// int scanf(const char *format, ...);
|
// int scanf(const char *format, ...);
|
||||||
|
static
|
||||||
GenericValue lle_X_scanf(FunctionType *FT,
|
GenericValue lle_X_scanf(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &args) {
|
const std::vector<GenericValue> &args) {
|
||||||
assert(args.size() < 10 && "Only handle up to 10 args to scanf right now!");
|
assert(args.size() < 10 && "Only handle up to 10 args to scanf right now!");
|
||||||
|
@ -449,6 +456,7 @@ GenericValue lle_X_scanf(FunctionType *FT,
|
||||||
|
|
||||||
// int fprintf(FILE *, const char *, ...) - a very rough implementation to make
|
// int fprintf(FILE *, const char *, ...) - a very rough implementation to make
|
||||||
// output useful.
|
// output useful.
|
||||||
|
static
|
||||||
GenericValue lle_X_fprintf(FunctionType *FT,
|
GenericValue lle_X_fprintf(FunctionType *FT,
|
||||||
const std::vector<GenericValue> &Args) {
|
const std::vector<GenericValue> &Args) {
|
||||||
assert(Args.size() >= 2);
|
assert(Args.size() >= 2);
|
||||||
|
|
Loading…
Reference in New Issue