- /// the code generator. If the code generator fails, an exception should be
- /// thrown, otherwise, this function will just return.
- virtual void compileProgram(const std::string &Bytecode);
-
- virtual int ExecuteProgram(const std::string &Bytecode,
+ /// the code generator. It returns false if the code generator fails.
+ virtual void compileProgram(const std::string &Bitcode, std::string *Error,
+ unsigned Timeout = 0, unsigned MemoryLimit = 0) {}
+
+ /// OutputCode - Compile the specified program from bitcode to code
+ /// understood by the GCC driver (either C or asm). If the code generator
+ /// fails, it sets Error, otherwise, this function returns the type of code
+ /// emitted.
+ virtual GCC::FileType OutputCode(const std::string &Bitcode,
+ std::string &OutFile, std::string &Error,
+ unsigned Timeout = 0,
+ unsigned MemoryLimit = 0) {
+ Error = "OutputCode not supported by this AbstractInterpreter!";
+ return GCC::AsmFile;
+ }
+
+ /// ExecuteProgram - Run the specified bitcode file, emitting output to the
+ /// specified filename. This sets RetVal to the exit code of the program or
+ /// returns false if a problem was encountered that prevented execution of
+ /// the program.
+ ///
+ virtual int ExecuteProgram(const std::string &Bitcode,