aboutsummaryrefslogtreecommitdiff
path: root/tools/bugpoint/bugpoint.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-02 02:16:17 +0000
committerChris Lattner <sabre@nondot.org>2005-08-02 02:16:17 +0000
commitf9aaae06cd2109082cda2b09ef3f23e0e1cff47b (patch)
tree2464ee9f4149dbeba1695647ba8e4c24dd23ae9b /tools/bugpoint/bugpoint.cpp
parentfa8c292ebd893b3effef4ead9c88d261c628c340 (diff)
When the user hits ctrl-c, bugpoint should attempt to stop reduction as
quickly as possible and output what it has so far. If they hit it twice, bugpoint is killed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/bugpoint.cpp')
-rw-r--r--tools/bugpoint/bugpoint.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index 3cbb4c0ff6..a4442c7ef9 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -32,13 +32,21 @@ InputFilenames(cl::Positional, cl::OneOrMore,
static cl::list<const PassInfo*, bool, PassNameParser>
PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
+/// BugpointIsInterrupted - Set to true when the user presses ctrl-c.
+bool llvm::BugpointIsInterrupted = false;
+
+static void BugpointInterruptFunction() {
+ BugpointIsInterrupted = true;
+}
+
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv,
" LLVM automatic testcase reducer. See\nhttp://"
"llvm.cs.uiuc.edu/docs/CommandGuide/bugpoint.html"
" for more information.\n");
sys::PrintStackTraceOnErrorSignal();
-
+ sys::SetInterruptFunction(BugpointInterruptFunction);
+
BugDriver D(argv[0]);
if (D.addSources(InputFilenames)) return 1;
D.addPasses(PassList.begin(), PassList.end());