mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add a special case for argc,argv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15802 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f24d09933c
commit
174f226464
@ -77,8 +77,7 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
if (RetTy == Type::IntTy || RetTy == Type::UIntTy || RetTy == Type::VoidTy) {
|
if (RetTy == Type::IntTy || RetTy == Type::UIntTy || RetTy == Type::VoidTy) {
|
||||||
switch (ArgValues.size()) {
|
switch (ArgValues.size()) {
|
||||||
case 3:
|
case 3:
|
||||||
if (FTy->getNumParams() == 3 &&
|
if ((FTy->getParamType(0) == Type::IntTy ||
|
||||||
(FTy->getParamType(0) == Type::IntTy ||
|
|
||||||
FTy->getParamType(0) == Type::UIntTy) &&
|
FTy->getParamType(0) == Type::UIntTy) &&
|
||||||
isa<PointerType>(FTy->getParamType(1)) &&
|
isa<PointerType>(FTy->getParamType(1)) &&
|
||||||
isa<PointerType>(FTy->getParamType(2))) {
|
isa<PointerType>(FTy->getParamType(2))) {
|
||||||
@ -92,6 +91,18 @@ GenericValue JIT::runFunction(Function *F,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
if ((FTy->getParamType(0) == Type::IntTy ||
|
||||||
|
FTy->getParamType(0) == Type::UIntTy) &&
|
||||||
|
isa<PointerType>(FTy->getParamType(1))) {
|
||||||
|
int (*PF)(int, char **) = (int(*)(int, char **))FPtr;
|
||||||
|
|
||||||
|
// Call the function.
|
||||||
|
GenericValue rv;
|
||||||
|
rv.IntVal = PF(ArgValues[0].IntVal, (char **)GVTOP(ArgValues[1]));
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (FTy->getNumParams() == 1 &&
|
if (FTy->getNumParams() == 1 &&
|
||||||
(FTy->getParamType(0) == Type::IntTy ||
|
(FTy->getParamType(0) == Type::IntTy ||
|
||||||
|
Loading…
Reference in New Issue
Block a user