mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
The interpreter assumes that the caller of runFunction() must be lli, and
therefore the function being called must be a main() returning an int. The consequences when these assumptions are false are not good, so don't assume them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -50,10 +50,11 @@ ExecutionEngine *Interpreter::create(Module *M, IntrinsicLowering *IL) {
|
||||
//
|
||||
Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
|
||||
IntrinsicLowering *il)
|
||||
: ExecutionEngine(M), ExitCode(0),
|
||||
: ExecutionEngine(M),
|
||||
TD("lli", isLittleEndian, isLongPointer ? 8 : 4, isLongPointer ? 8 : 4,
|
||||
isLongPointer ? 8 : 4), IL(il) {
|
||||
|
||||
memset(&ExitValue, 0, sizeof(ExitValue));
|
||||
setTargetData(TD);
|
||||
// Initialize the "backend"
|
||||
initializeExecutionEngine();
|
||||
@ -100,8 +101,6 @@ Interpreter::runFunction(Function *F,
|
||||
// Start executing the function.
|
||||
run();
|
||||
|
||||
GenericValue rv;
|
||||
rv.IntVal = ExitCode;
|
||||
return rv;
|
||||
return ExitValue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user