1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

For transforms the behave differently if main goes away, add an option to prevent bugpoint from removing main

llvm-svn: 26557
This commit is contained in:
Andrew Lenharth 2006-03-05 22:21:36 +00:00
parent 578bf37e22
commit 89ca36285c

View File

@ -27,10 +27,18 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/CommandLine.h"
#include <fstream>
#include <set>
using namespace llvm;
namespace {
cl::opt<bool>
KeepMain("keep-main",
cl::desc("Force function reduction to keep main"),
cl::init(false));
}
namespace llvm {
class ReducePassList : public ListReducer<const PassInfo*> {
BugDriver &BD;
@ -109,6 +117,11 @@ namespace llvm {
}
bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
//if main isn't present, claim there is no problem
if (KeepMain && find(Funcs.begin(), Funcs.end(), BD.getProgram()->getMainFunction()) == Funcs.end())
return false;
// Clone the program to try hacking it apart...
Module *M = CloneModule(BD.getProgram());