[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp ExecutionDriver.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Jul 24 00:53:37 PDT 2004
Changes in directory llvm/tools/bugpoint:
BugDriver.cpp updated: 1.35 -> 1.36
ExecutionDriver.cpp updated: 1.46 -> 1.47
---
Log message:
Finally give bugpoint -timeout support!
---
Diffs of the changes: (+20 -2)
Index: llvm/tools/bugpoint/BugDriver.cpp
diff -u llvm/tools/bugpoint/BugDriver.cpp:1.35 llvm/tools/bugpoint/BugDriver.cpp:1.36
--- llvm/tools/bugpoint/BugDriver.cpp:1.35 Thu Jul 22 20:30:49 2004
+++ llvm/tools/bugpoint/BugDriver.cpp Sat Jul 24 02:53:26 2004
@@ -156,7 +156,7 @@
//
bool CreatedOutput = false;
if (ReferenceOutputFile.empty()) {
- std::cout << "Generating reference output from raw program...";
+ std::cout << "Generating reference output from raw program: ";
try {
ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out");
CreatedOutput = true;
Index: llvm/tools/bugpoint/ExecutionDriver.cpp
diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.46 llvm/tools/bugpoint/ExecutionDriver.cpp:1.47
--- llvm/tools/bugpoint/ExecutionDriver.cpp:1.46 Thu Jul 22 20:30:49 2004
+++ llvm/tools/bugpoint/ExecutionDriver.cpp Sat Jul 24 02:53:26 2004
@@ -53,6 +53,11 @@
AdditionalSOs("additional-so",
cl::desc("Additional shared objects to load "
"into executing programs"));
+
+ cl::opt<unsigned>
+ TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"),
+ cl::desc("Number of seconds program is allowed to run before it "
+ "is killed (default is 300s), 0 disables timeout"));
}
namespace llvm {
@@ -201,7 +206,20 @@
// Actually execute the program!
int RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile,
- OutputFile, SharedObjs);
+ OutputFile, SharedObjs, TimeoutValue);
+
+ if (RetVal == -1) {
+ std::cerr << "<timeout>";
+ static bool FirstTimeout = true;
+ if (FirstTimeout) {
+ std::cout << "\n"
+ "*** Program execution timed out! This mechanism is designed to handle\n"
+ " programs stuck in infinite loops gracefully. The -timeout option\n"
+ " can be used to change the timeout threshold or disable it completely\n"
+ " (with -timeout=0). This message is only displayed once.\n";
+ FirstTimeout = false;
+ }
+ }
if (ProgramExitedNonzero != 0)
*ProgramExitedNonzero = (RetVal != 0);
More information about the llvm-commits
mailing list