summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ToolRunner.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-05-24 07:49:55 +0000
committerDuncan Sands <baldrick@free.fr>2010-05-24 07:49:55 +0000
commite9cd6d069d7eb4c1b4bbe1e5503d2153267bf9d8 (patch)
tree995f69783943cf0f5d2fb56e5009755e39a569d5 /llvm/tools/bugpoint/ToolRunner.h
parent5d6a2e509fbbf51918ab8f218b3b7a20cd0ce4b7 (diff)
downloadbcm5719-llvm-e9cd6d069d7eb4c1b4bbe1e5503d2153267bf9d8.tar.gz
bcm5719-llvm-e9cd6d069d7eb4c1b4bbe1e5503d2153267bf9d8.zip
Apply timeouts and memory limits in more places. In particular, when
bugpoint does "Running the code generator to test for a crash" this gets you a crash if llc goes into an infinite loop or uses up vast amounts of memory. llvm-svn: 104485
Diffstat (limited to 'llvm/tools/bugpoint/ToolRunner.h')
-rw-r--r--llvm/tools/bugpoint/ToolRunner.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/ToolRunner.h b/llvm/tools/bugpoint/ToolRunner.h
index 6693dead47a..d966fc0ea44 100644
--- a/llvm/tools/bugpoint/ToolRunner.h
+++ b/llvm/tools/bugpoint/ToolRunner.h
@@ -112,14 +112,17 @@ public:
/// compileProgram - Compile the specified program from bitcode to executable
/// code. This does not produce any output, it is only used when debugging
/// the code generator. It returns false if the code generator fails.
- virtual void compileProgram(const std::string &Bitcode, std::string *Error) {}
+ 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,
- sys::Path &OutFile, std::string &Error) {
+ sys::Path &OutFile, std::string &Error,
+ unsigned Timeout = 0,
+ unsigned MemoryLimit = 0) {
Error = "OutputCode not supported by this AbstractInterpreter!";
return GCC::AsmFile;
}
@@ -161,7 +164,8 @@ public:
/// compileProgram - Compile the specified program from bitcode to executable
/// code. This does not produce any output, it is only used when debugging
/// the code generator. Returns false if the code generator fails.
- virtual void compileProgram(const std::string &Bitcode, std::string *Error);
+ virtual void compileProgram(const std::string &Bitcode, std::string *Error,
+ unsigned Timeout = 0, unsigned MemoryLimit = 0);
virtual int ExecuteProgram(const std::string &Bitcode,
const std::vector<std::string> &Args,
@@ -180,7 +184,9 @@ public:
/// fails, it sets Error, otherwise, this function returns the type of code
/// emitted.
virtual GCC::FileType OutputCode(const std::string &Bitcode,
- sys::Path &OutFile, std::string &Error);
+ sys::Path &OutFile, std::string &Error,
+ unsigned Timeout = 0,
+ unsigned MemoryLimit = 0);
};
@@ -206,7 +212,8 @@ public:
/// compileProgram - Compile the specified program from bitcode to executable
/// code. This does not produce any output, it is only used when debugging
/// the code generator. Returns false if the code generator fails.
- virtual void compileProgram(const std::string &Bitcode, std::string *Error);
+ virtual void compileProgram(const std::string &Bitcode, std::string *Error,
+ unsigned Timeout = 0, unsigned MemoryLimit = 0);
virtual int ExecuteProgram(const std::string &Bitcode,
const std::vector<std::string> &Args,
@@ -225,7 +232,9 @@ public:
/// fails, it sets Error, otherwise, this function returns the type of code
/// emitted.
virtual GCC::FileType OutputCode(const std::string &Bitcode,
- sys::Path &OutFile, std::string &Error);
+ sys::Path &OutFile, std::string &Error,
+ unsigned Timeout = 0,
+ unsigned MemoryLimit = 0);
};
} // End llvm namespace
OpenPOWER on IntegriCloud