From 6a3f31cb707972ebde1e45a61fa8f5bcff132eba Mon Sep 17 00:00:00 2001 From: Patrick Jenkins Date: Tue, 15 Aug 2006 16:40:49 +0000 Subject: This commit adds a new feature called find-bugs. The find-bugs option can be invoked on a .bc file from the command like with -find-bugs and a list of passes you wish to test. This procedure takes the set of optimization passes the user specifies, randomizes the passes, runs the passes on the specified .bc file, compiles the program, and finally runs the program checking its output vs the .bc file with no optimizations. This process repeats until either the user kills bugpoint or an error occurs in the optimizations, program complitation, or the running of the program. If an error occurs, bugpoint attempts to diagnose the error by eliminating passes that are not at fault and code that is not needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29703 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/bugpoint.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/bugpoint/bugpoint.cpp') diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp index cc05fea650..353e117369 100644 --- a/tools/bugpoint/bugpoint.cpp +++ b/tools/bugpoint/bugpoint.cpp @@ -29,8 +29,12 @@ using namespace llvm; // from a parent process. It is not intended to be used by users so the // option is hidden. static cl::opt - AsChild("as-child", cl::desc("Run bugpoint as child process"), - cl::ReallyHidden); +AsChild("as-child", cl::desc("Run bugpoint as child process"), + cl::ReallyHidden); + +static cl::opt +FindBugs("find-bugs", cl::desc("Run many different optimization sequences" + "on program to find bugs"), cl::init(false)); static cl::list InputFilenames(cl::Positional, cl::OneOrMore, @@ -62,7 +66,7 @@ int main(int argc, char **argv) { sys::PrintStackTraceOnErrorSignal(); sys::SetInterruptFunction(BugpointInterruptFunction); - BugDriver D(argv[0],AsChild,TimeoutValue); + BugDriver D(argv[0],AsChild,FindBugs,TimeoutValue); if (D.addSources(InputFilenames)) return 1; D.addPasses(PassList.begin(), PassList.end()); -- cgit v1.2.3-70-g09d2