projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ReleaseNotes: new Win EH instructions; by David Majnemer
[oota-llvm.git]
/
tools
/
bugpoint
/
bugpoint.cpp
diff --git
a/tools/bugpoint/bugpoint.cpp
b/tools/bugpoint/bugpoint.cpp
index 3c4f3e40f5a98afa7f7d22887b659bdc5cf67b64..48f30e6709f8089002fddcea620b8c7d34a1041d 100644
(file)
--- a/
tools/bugpoint/bugpoint.cpp
+++ b/
tools/bugpoint/bugpoint.cpp
@@
-16,12
+16,12
@@
#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/IR/LLVMContext.h"
#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/LegacyPassNameParser.h"
#include "llvm/LinkAllIR.h"
#include "llvm/LinkAllPasses.h"
#include "llvm/LinkAllIR.h"
#include "llvm/LinkAllPasses.h"
-#include "llvm/PassManager.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PassNameParser.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
@@
-50,7
+50,7
@@
TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"),
static cl::opt<int>
MemoryLimit("mlimit", cl::init(-1), cl::value_desc("MBytes"),
cl::desc("Maximum amount of memory to use. 0 disables check."
static cl::opt<int>
MemoryLimit("mlimit", cl::init(-1), cl::value_desc("MBytes"),
cl::desc("Maximum amount of memory to use. 0 disables check."
- " Defaults to
3
00MB (800MB under valgrind)."));
+ " Defaults to
4
00MB (800MB under valgrind)."));
static cl::opt<bool>
UseValgrind("enable-valgrind",
static cl::opt<bool>
UseValgrind("enable-valgrind",
@@
-62,25
+62,21
@@
UseValgrind("enable-valgrind",
static cl::list<const PassInfo*, bool, PassNameParser>
PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
static cl::list<const PassInfo*, bool, PassNameParser>
PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
-static cl::opt<bool>
-StandardCompileOpts("std-compile-opts",
- cl::desc("Include the standard compile time optimizations"));
-
static cl::opt<bool>
StandardLinkOpts("std-link-opts",
cl::desc("Include the standard link time optimizations"));
static cl::opt<bool>
OptLevelO1("O1",
static cl::opt<bool>
StandardLinkOpts("std-link-opts",
cl::desc("Include the standard link time optimizations"));
static cl::opt<bool>
OptLevelO1("O1",
- cl::desc("Optimization level 1.
Similar to llvm-gcc -O1
"));
+ cl::desc("Optimization level 1.
Identical to 'opt -O1'
"));
static cl::opt<bool>
OptLevelO2("O2",
static cl::opt<bool>
OptLevelO2("O2",
- cl::desc("Optimization level 2.
Similar to llvm-gcc -O2
"));
+ cl::desc("Optimization level 2.
Identical to 'opt -O2'
"));
static cl::opt<bool>
OptLevelO3("O3",
static cl::opt<bool>
OptLevelO3("O3",
- cl::desc("Optimization level 3.
Similar to llvm-gcc -O3
"));
+ cl::desc("Optimization level 3.
Identical to 'opt -O3'
"));
static cl::opt<std::string>
OverrideTriple("mtriple", cl::desc("Override target triple for module"));
static cl::opt<std::string>
OverrideTriple("mtriple", cl::desc("Override target triple for module"));
@@
-96,12
+92,12
@@
static void BugpointInterruptFunction() {
// Hack to capture a pass list.
namespace {
// Hack to capture a pass list.
namespace {
- class AddToDriver : public FunctionPassManager {
+ class AddToDriver : public
legacy::
FunctionPassManager {
BugDriver &D;
public:
BugDriver &D;
public:
- AddToDriver(BugDriver &_D) : FunctionPassManager(
0
), D(_D) {}
+ AddToDriver(BugDriver &_D) : FunctionPassManager(
nullptr
), D(_D) {}
- v
irtual void add(Pass *P)
{
+ v
oid add(Pass *P) override
{
const void *ID = P->getPassID();
const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
D.addPass(PI->getPassArgument());
const void *ID = P->getPassID();
const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
D.addPass(PI->getPassArgument());
@@
-109,6
+105,12
@@
namespace {
};
}
};
}
+#ifdef LINK_POLLY_INTO_TOOLS
+namespace polly {
+void initializePollyPasses(llvm::PassRegistry &Registry);
+}
+#endif
+
int main(int argc, char **argv) {
#ifndef DEBUG_BUGPOINT
llvm::sys::PrintStackTraceOnErrorSignal();
int main(int argc, char **argv) {
#ifndef DEBUG_BUGPOINT
llvm::sys::PrintStackTraceOnErrorSignal();
@@
-124,12
+126,15
@@
int main(int argc, char **argv) {
initializeVectorization(Registry);
initializeIPO(Registry);
initializeAnalysis(Registry);
initializeVectorization(Registry);
initializeIPO(Registry);
initializeAnalysis(Registry);
- initializeIPA(Registry);
initializeTransformUtils(Registry);
initializeInstCombine(Registry);
initializeInstrumentation(Registry);
initializeTarget(Registry);
initializeTransformUtils(Registry);
initializeInstCombine(Registry);
initializeInstrumentation(Registry);
initializeTarget(Registry);
+#ifdef LINK_POLLY_INTO_TOOLS
+ polly::initializePollyPasses(Registry);
+#endif
+
cl::ParseCommandLineOptions(argc, argv,
"LLVM automatic testcase reducer. See\nhttp://"
"llvm.org/cmds/bugpoint.html"
cl::ParseCommandLineOptions(argc, argv,
"LLVM automatic testcase reducer. See\nhttp://"
"llvm.org/cmds/bugpoint.html"
@@
-152,7
+157,7
@@
int main(int argc, char **argv) {
if (sys::RunningOnValgrind() || UseValgrind)
MemoryLimit = 800;
else
if (sys::RunningOnValgrind() || UseValgrind)
MemoryLimit = 800;
else
- MemoryLimit =
3
00;
+ MemoryLimit =
4
00;
}
BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit,
}
BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit,
@@
-160,17
+165,11
@@
int main(int argc, char **argv) {
if (D.addSources(InputFilenames)) return 1;
AddToDriver PM(D);
if (D.addSources(InputFilenames)) return 1;
AddToDriver PM(D);
- if (StandardCompileOpts) {
- PassManagerBuilder Builder;
- Builder.OptLevel = 3;
- Builder.Inliner = createFunctionInliningPass();
- Builder.populateModulePassManager(PM);
- }
if (StandardLinkOpts) {
PassManagerBuilder Builder;
if (StandardLinkOpts) {
PassManagerBuilder Builder;
- Builder.
populateLTOPassManager(PM, /*Internalize=*/true,
-
/*RunInliner=*/true
);
+ Builder.
Inliner = createFunctionInliningPass();
+
Builder.populateLTOPassManager(PM
);
}
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
}
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
@@
-181,19
+180,12
@@
int main(int argc, char **argv) {
Builder.Inliner = createFunctionInliningPass(225);
else
Builder.Inliner = createFunctionInliningPass(275);
Builder.Inliner = createFunctionInliningPass(225);
else
Builder.Inliner = createFunctionInliningPass(275);
-
- // Note that although clang/llvm-gcc use two separate passmanagers
- // here, it shouldn't normally make a difference.
Builder.populateFunctionPassManager(PM);
Builder.populateModulePassManager(PM);
}
Builder.populateFunctionPassManager(PM);
Builder.populateModulePassManager(PM);
}
- for (std::vector<const PassInfo*>::iterator I = PassList.begin(),
- E = PassList.end();
- I != E; ++I) {
- const PassInfo* PI = *I;
+ for (const PassInfo *PI : PassList)
D.addPass(PI->getPassArgument());
D.addPass(PI->getPassArgument());
- }
// Bugpoint has the ability of generating a plethora of core files, so to
// avoid filling up the disk, we prevent it
// Bugpoint has the ability of generating a plethora of core files, so to
// avoid filling up the disk, we prevent it