#include "Interpreter.h"
#include "llvm/Support/CommandLine.h"
-cl::String InputFilename("" , "Input filename", cl::NoFlags, "-");
+cl::StringList InputArgv("" , "Input command line", cl::ConsumeAfter);
cl::String MainFunction ("f" , "Function to execute", cl::NoFlags, "main");
cl::Flag DebugMode ("debug" , "Start program in debugger");
cl::Alias DebugModeA ("d" , "Alias for -debug", cl::NoFlags, DebugMode);
//
Interpreter::Interpreter() : ExitCode(0), Profile(ProfileMode), CurFrame(-1) {
CurMod = 0;
- loadModule(InputFilename);
+ loadModule(InputArgv.size() ? InputArgv[0] : "");
// Initialize the "backend"
initializeExecutionEngine();
// Start interpreter into the main function...
//
- if (!I.callMainMethod(MainFunction, InputFilename) && !DebugMode) {
+ if (!I.callMainMethod(MainFunction, InputArgv) && !DebugMode) {
// If not in debug mode and if the call succeeded, run the code now...
I.run();
}