projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PM] Remove the old 'PassManager.h' header file at the top level of
[oota-llvm.git]
/
tools
/
bugpoint
/
bugpoint.cpp
diff --git
a/tools/bugpoint/bugpoint.cpp
b/tools/bugpoint/bugpoint.cpp
index f664a07a990de01619e6feeb629d1dc3c79c6469..0ee3784660ae809c32035dd8444504aa52fb845e 100644
(file)
--- a/
tools/bugpoint/bugpoint.cpp
+++ b/
tools/bugpoint/bugpoint.cpp
@@
-16,10
+16,10
@@
#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/IR/LegacyPassNameParser.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/PluginLoader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PluginLoader.h"
@@
-62,10
+62,6
@@
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>
StandardLinkOpts("std-link-opts",
cl::desc("Include the standard link time optimizations"));
@@
-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();
@@
-130,6
+132,10
@@
int main(int argc, char **argv) {
initializeInstrumentation(Registry);
initializeTarget(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"
@@
-160,17
+166,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) {