summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ListReducer.h
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-07-30 20:15:56 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-07-30 20:15:56 +0000
commitbe6bf5668c386fafbd0a7e1b1305b9ac6ab60ce2 (patch)
treeff815e6c5f0935ce8c2fe3afee6316481e01dc93 /tools/bugpoint/ListReducer.h
parent9d679cbc6cb5c7dc8cca87a1e1548c480fb056b8 (diff)
downloadllvm-be6bf5668c386fafbd0a7e1b1305b9ac6ab60ce2.tar.gz
llvm-be6bf5668c386fafbd0a7e1b1305b9ac6ab60ce2.tar.bz2
llvm-be6bf5668c386fafbd0a7e1b1305b9ac6ab60ce2.tar.xz
CodeGeneratorBug.cpp:
* Temporarily externing InputArgv to print it out for the benefit of LLI command needed to reproduce the result. * Print out the list of functions currently being tested * ListReducer now returns a bool if there was a failure, so test for it ListReducer.h: * Handle the case where there is no problem by returning true if failure is found. Also correctly handles the case when there is only 1 pass/function. Miscompilation.cpp: * ListReducer now returns a bool if there was a failure, so test for it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ListReducer.h')
-rw-r--r--tools/bugpoint/ListReducer.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/bugpoint/ListReducer.h b/tools/bugpoint/ListReducer.h
index a4dee5bc58..cee68926c9 100644
--- a/tools/bugpoint/ListReducer.h
+++ b/tools/bugpoint/ListReducer.h
@@ -30,7 +30,24 @@ struct ListReducer {
// list while still maintaining the "test" property. This is the core of the
// "work" that bugpoint does.
//
- void reduceList(std::vector<ElTy> &TheList) {
+ bool reduceList(std::vector<ElTy> &TheList) {
+ std::vector<ElTy> empty;
+ switch (doTest(TheList, empty)) {
+ case KeepPrefix:
+ if (TheList.size() == 1) // we are done, it's the base case and it fails
+ return true;
+ else
+ break; // there's definitely an error, but we need to narrow it down
+
+ case KeepSuffix:
+ // cannot be reached!
+ std::cerr << "bugpoint ListReducer internal error: selected empty set.\n";
+ abort();
+
+ case NoFailure:
+ return false; // there is no failure with the full set of passes/funcs!
+ }
+
unsigned MidTop = TheList.size();
while (MidTop > 1) {
unsigned Mid = MidTop / 2;
@@ -80,6 +97,8 @@ struct ListReducer {
}
}
}
+
+ return true; // there are some failure and we've narrowed them down
}
};