mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-01 18:12:49 +00:00
For transforms the behave differently if main goes away, add an option to prevent bugpoint from removing main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3d68e15c20
commit
7c0a93785e
@ -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