#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/MC/SubtargetFeature.h"
-#include "llvm/PassManager.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/PrettyStackTrace.h"
Timer CodeGenerationTime;
- mutable PassManager *CodeGenPasses;
- mutable PassManager *PerModulePasses;
- mutable FunctionPassManager *PerFunctionPasses;
+ mutable legacy::PassManager *CodeGenPasses;
+ mutable legacy::PassManager *PerModulePasses;
+ mutable legacy::FunctionPassManager *PerFunctionPasses;
private:
TargetIRAnalysis getTargetIRAnalysis() const {
return TargetIRAnalysis();
}
- PassManager *getCodeGenPasses() const {
+ legacy::PassManager *getCodeGenPasses() const {
if (!CodeGenPasses) {
- CodeGenPasses = new PassManager();
+ CodeGenPasses = new legacy::PassManager();
CodeGenPasses->add(new DataLayoutPass());
CodeGenPasses->add(
createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
return CodeGenPasses;
}
- PassManager *getPerModulePasses() const {
+ legacy::PassManager *getPerModulePasses() const {
if (!PerModulePasses) {
- PerModulePasses = new PassManager();
+ PerModulePasses = new legacy::PassManager();
PerModulePasses->add(new DataLayoutPass());
PerModulePasses->add(
createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
return PerModulePasses;
}
- FunctionPassManager *getPerFunctionPasses() const {
+ legacy::FunctionPassManager *getPerFunctionPasses() const {
if (!PerFunctionPasses) {
- PerFunctionPasses = new FunctionPassManager(TheModule);
+ PerFunctionPasses = new legacy::FunctionPassManager(TheModule);
PerFunctionPasses->add(new DataLayoutPass());
PerFunctionPasses->add(
createTargetTransformInfoWrapperPass(getTargetIRAnalysis()));
}
static void addSampleProfileLoaderPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
const PassManagerBuilderWrapper &BuilderWrapper =
static_cast<const PassManagerBuilderWrapper &>(Builder);
const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
}
static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
PM.add(createAddDiscriminatorsPass());
}
static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
PM.add(createBoundsCheckingPass());
}
static void addSanitizerCoveragePass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
const PassManagerBuilderWrapper &BuilderWrapper =
static_cast<const PassManagerBuilderWrapper&>(Builder);
const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
}
static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
PM.add(createAddressSanitizerFunctionPass());
PM.add(createAddressSanitizerModulePass());
}
static void addMemorySanitizerPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
const PassManagerBuilderWrapper &BuilderWrapper =
static_cast<const PassManagerBuilderWrapper&>(Builder);
const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
}
static void addThreadSanitizerPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
PM.add(createThreadSanitizerPass());
}
static void addDataFlowSanitizerPass(const PassManagerBuilder &Builder,
- PassManagerBase &PM) {
+ legacy::PassManagerBase &PM) {
const PassManagerBuilderWrapper &BuilderWrapper =
static_cast<const PassManagerBuilderWrapper&>(Builder);
const LangOptions &LangOpts = BuilderWrapper.getLangOpts();
}
static void addSymbolRewriterPass(const CodeGenOptions &Opts,
- PassManager *MPM) {
+ legacy::PassManager *MPM) {
llvm::SymbolRewriter::RewriteDescriptorList DL;
llvm::SymbolRewriter::RewriteMapParser MapParser;
}
// Set up the per-function pass manager.
- FunctionPassManager *FPM = getPerFunctionPasses();
+ legacy::FunctionPassManager *FPM = getPerFunctionPasses();
if (CodeGenOpts.VerifyModule)
FPM->add(createVerifierPass());
PMBuilder.populateFunctionPassManager(*FPM);
// Set up the per-module pass manager.
- PassManager *MPM = getPerModulePasses();
+ legacy::PassManager *MPM = getPerModulePasses();
if (!CodeGenOpts.RewriteMapFiles.empty())
addSymbolRewriterPass(CodeGenOpts, MPM);
if (CodeGenOpts.VerifyModule)
formatted_raw_ostream &OS) {
// Create the code generator passes.
- PassManager *PM = getCodeGenPasses();
+ legacy::PassManager *PM = getCodeGenPasses();
// Add LibraryInfo.
llvm::Triple TargetTriple(TheModule->getTargetTriple());