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:
parent
578bf37e22
commit
89ca36285c
@ -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());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user