llvm.org GIT mirror llvm / 417c5c1
[PM] Remove the old 'PassManager.h' header file at the top level of LLVM's include tree and the use of using declarations to hide the 'legacy' namespace for the old pass manager. This undoes the primary modules-hostile change I made to keep out-of-tree targets building. I sent an email inquiring about whether this would be reasonable to do at this phase and people seemed fine with it, so making it a reality. This should allow us to start bootstrapping with modules to a certain extent along with making it easier to mix and match headers in general. The updates to any code for users of LLVM are very mechanical. Switch from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h". Qualify the types which now produce compile errors with "legacy::". The most common ones are "PassManager", "PassManagerBase", and "FunctionPassManager". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229094 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 4 years ago
65 changed file(s) with 124 addition(s) and 180 deletion(s). Raw diff Collapse all Expand all
1212
1313 #include "InstrumentationBindings.h"
1414 #include "llvm-c/Core.h"
15 #include "llvm/IR/LegacyPassManager.h"
1516 #include "llvm/IR/Module.h"
16 #include "llvm/PassManager.h"
1717 #include "llvm/Transforms/Instrumentation.h"
1818
1919 using namespace llvm;
5555 #include "llvm/IR/IRBuilder.h"
5656 #include "llvm/IR/Intrinsics.h"
5757 #include "llvm/IR/LLVMContext.h"
58 #include "llvm/IR/LegacyPassManager.h"
5859 #include "llvm/IR/Module.h"
59 #include "llvm/PassManager.h"
6060 #include "llvm/Support/Dwarf.h"
6161 #include "llvm/Support/TargetSelect.h"
6262 #include "llvm/Target/TargetOptions.h"
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
77 #include "llvm/IR/DerivedTypes.h"
88 #include "llvm/IR/IRBuilder.h"
99 #include "llvm/IR/LLVMContext.h"
10 #include "llvm/IR/LegacyPassManager.h"
1011 #include "llvm/IR/Module.h"
1112 #include "llvm/IR/Verifier.h"
12 #include "llvm/PassManager.h"
1313 #include "llvm/Support/Host.h"
1414 #include "llvm/Support/TargetSelect.h"
1515 #include "llvm/Transforms/Scalar.h"
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
1011 #include "llvm/IRReader/IRReader.h"
11 #include "llvm/PassManager.h"
1212 #include "llvm/Support/CommandLine.h"
1313 #include "llvm/Support/SourceMgr.h"
1414 #include "llvm/Support/TargetSelect.h"
88 #include "llvm/IR/DerivedTypes.h"
99 #include "llvm/IR/IRBuilder.h"
1010 #include "llvm/IR/LLVMContext.h"
11 #include "llvm/IR/LegacyPassManager.h"
1112 #include "llvm/IR/Module.h"
1213 #include "llvm/IR/Verifier.h"
1314 #include "llvm/IRReader/IRReader.h"
14 #include "llvm/PassManager.h"
1515 #include "llvm/Support/CommandLine.h"
1616 #include "llvm/Support/FileSystem.h"
1717 #include "llvm/Support/Path.h"
66 #include "llvm/IR/DerivedTypes.h"
77 #include "llvm/IR/IRBuilder.h"
88 #include "llvm/IR/LLVMContext.h"
9 #include "llvm/IR/LegacyPassManager.h"
910 #include "llvm/IR/Module.h"
1011 #include "llvm/IR/Verifier.h"
1112 #include "llvm/IRReader/IRReader.h"
12 #include "llvm/PassManager.h"
1313 #include "llvm/Support/CommandLine.h"
1414 #include "llvm/Support/FileSystem.h"
1515 #include "llvm/Support/Path.h"
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
55 #include "llvm/IR/DerivedTypes.h"
66 #include "llvm/IR/IRBuilder.h"
77 #include "llvm/IR/LLVMContext.h"
8 #include "llvm/IR/LegacyPassManager.h"
89 #include "llvm/IR/Module.h"
910 #include "llvm/IR/Verifier.h"
10 #include "llvm/PassManager.h"
1111 #include "llvm/Support/TargetSelect.h"
1212 #include "llvm/Transforms/Scalar.h"
1313 #include
77 #include "llvm/IR/DerivedTypes.h"
88 #include "llvm/IR/IRBuilder.h"
99 #include "llvm/IR/LLVMContext.h"
10 #include "llvm/IR/LegacyPassManager.h"
1011 #include "llvm/IR/Module.h"
1112 #include "llvm/IR/Verifier.h"
12 #include "llvm/PassManager.h"
1313 #include "llvm/Support/TargetSelect.h"
1414 #include "llvm/Transforms/Scalar.h"
1515 #include
77 #include "llvm/IR/DerivedTypes.h"
88 #include "llvm/IR/IRBuilder.h"
99 #include "llvm/IR/LLVMContext.h"
10 #include "llvm/IR/LegacyPassManager.h"
1011 #include "llvm/IR/Module.h"
1112 #include "llvm/IR/Verifier.h"
12 #include "llvm/PassManager.h"
1313 #include "llvm/Support/TargetSelect.h"
1414 #include "llvm/Transforms/Scalar.h"
1515 #include
66 #include "llvm/IR/DerivedTypes.h"
77 #include "llvm/IR/IRBuilder.h"
88 #include "llvm/IR/LLVMContext.h"
9 #include "llvm/IR/LegacyPassManager.h"
910 #include "llvm/IR/Module.h"
1011 #include "llvm/IR/Verifier.h"
11 #include "llvm/PassManager.h"
1212 #include "llvm/Support/TargetSelect.h"
1313 #include "llvm/Transforms/Scalar.h"
1414 #include
66 #include "llvm/IR/DerivedTypes.h"
77 #include "llvm/IR/IRBuilder.h"
88 #include "llvm/IR/LLVMContext.h"
9 #include "llvm/IR/LegacyPassManager.h"
910 #include "llvm/IR/Module.h"
1011 #include "llvm/IR/Verifier.h"
11 #include "llvm/PassManager.h"
1212 #include "llvm/Support/TargetSelect.h"
1313 #include "llvm/Transforms/Scalar.h"
1414 #include
1414 #define LLVM_EXECUTIONENGINE_ORC_COMPILEUTILS_H
1515
1616 #include "llvm/ExecutionEngine/ObjectMemoryBuffer.h"
17 #include "llvm/IR/LegacyPassManager.h"
1718 #include "llvm/MC/MCContext.h"
1819 #include "llvm/Object/ObjectFile.h"
19 #include "llvm/PassManager.h"
2020 #include "llvm/Target/TargetMachine.h"
2121
2222 namespace llvm {
3333 SmallVector ObjBufferSV;
3434 raw_svector_ostream ObjStream(ObjBufferSV);
3535
36 PassManager PM;
36 legacy::PassManager PM;
3737 MCContext *Ctx;
3838 if (TM.addPassesToEmitMC(PM, Ctx, ObjStream))
3939 llvm_unreachable("Target does not support MC emission.");
+0
-39
include/llvm/PassManager.h less more
None //===- llvm/PassManager.h - Container for Passes ----------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This is a legacy redirect header for the old PassManager. It is intended to
10 // be used by clients that have not been converted to be aware of the new pass
11 // management infrastructure being built for LLVM, which is every client
12 // initially. Eventually this header (and the legacy management layer) will go
13 // away, but we want to minimize changes to out-of-tree users of LLVM in the
14 // interim.
15 //
16 // Note that this header *must not* be included into the same file as the new
17 // pass management infrastructure is included. Things will break spectacularly.
18 // If you are starting that conversion, you should switch to explicitly
19 // including LegacyPassManager.h and using the legacy namespace.
20 //
21 //===----------------------------------------------------------------------===//
22
23 #ifndef LLVM_PASSMANAGER_H
24 #define LLVM_PASSMANAGER_H
25
26 #include "llvm/IR/LegacyPassManager.h"
27
28 namespace llvm {
29
30 // Pull these into the llvm namespace so that existing code that expects it
31 // there can find it.
32 using legacy::PassManagerBase;
33 using legacy::PassManager;
34 using legacy::FunctionPassManager;
35
36 }
37
38 #endif
2626 class FunctionPassManager;
2727 class PassManagerBase;
2828 }
29 using legacy::FunctionPassManager;
30 using legacy::PassManagerBase;
3129
3230 /// PassManagerBuilder - This class is used to set up a standard optimization
3331 /// sequence for languages like C and C++, allowing some APIs to customize the
5856 /// Extensions are passed the builder itself (so they can see how it is
5957 /// configured) as well as the pass manager to add stuff to.
6058 typedef void (*ExtensionFn)(const PassManagerBuilder &Builder,
61 PassManagerBase &PM);
59 legacy::PassManagerBase &PM);
6260 enum ExtensionPointTy {
6361 /// EP_EarlyAsPossible - This extension point allows adding passes before
6462 /// any other transformations, allowing them to see the code as it is coming
138136 void addExtension(ExtensionPointTy Ty, ExtensionFn Fn);
139137
140138 private:
141 void addExtensionsToPM(ExtensionPointTy ETy, PassManagerBase &PM) const;
142 void addInitialAliasAnalysisPasses(PassManagerBase &PM) const;
143 void addLTOOptimizationPasses(PassManagerBase &PM);
139 void addExtensionsToPM(ExtensionPointTy ETy,
140 legacy::PassManagerBase &PM) const;
141 void addInitialAliasAnalysisPasses(legacy::PassManagerBase &PM) const;
142 void addLTOOptimizationPasses(legacy::PassManagerBase &PM);
144143
145144 public:
146145 /// populateFunctionPassManager - This fills in the function pass manager,
147146 /// which is expected to be run on each function immediately as it is
148147 /// generated. The idea is to reduce the size of the IR in memory.
149 void populateFunctionPassManager(FunctionPassManager &FPM);
148 void populateFunctionPassManager(legacy::FunctionPassManager &FPM);
150149
151150 /// populateModulePassManager - This sets up the primary pass manager.
152 void populateModulePassManager(PassManagerBase &MPM);
153 void populateLTOPassManager(PassManagerBase &PM);
151 void populateModulePassManager(legacy::PassManagerBase &MPM);
152 void populateLTOPassManager(legacy::PassManagerBase &PM);
154153 };
155154
156155 /// Registers a function for adding a standard set of passes. This should be
7070 umbrella "IR"
7171 module * { export * }
7272
73 // We cannot have llvm/PassManager.h and llvm/IR/PassManager.h in the same TU,
74 // so we can't include llvm/IR/PassManager.h in the IR module.
75 exclude header "IR/PassManager.h"
76 exclude header "IR/LegacyPassManager.h"
77
7873 // These are intended for (repeated) textual inclusion.
7974 textual header "IR/Instruction.def"
8075 textual header "IR/Metadata.def"
81 }
82
83 module LLVM_LegacyPassManager {
84 requires cplusplus
85 module CompatInterface { header "PassManager.h" export * }
86 module Implementation { header "IR/LegacyPassManager.h" export * }
87 }
88
89 module LLVM_IR_PassManager {
90 requires cplusplus
91 // FIXME PR19358: This doesn't work! conflict LLVM_LegacyPassManager, "cannot use legacy pass manager and new pass manager in same file"
92 header "IR/PassManager.h"
93 export *
9476 }
9577
9678 module LLVM_IRReader { requires cplusplus umbrella "IRReader" module * { export * } }
5050 #include "llvm/IR/Function.h"
5151 #include "llvm/IR/InstVisitor.h"
5252 #include "llvm/IR/IntrinsicInst.h"
53 #include "llvm/IR/LegacyPassManager.h"
5354 #include "llvm/Pass.h"
54 #include "llvm/PassManager.h"
5555 #include "llvm/Support/Debug.h"
5656 #include "llvm/Support/raw_ostream.h"
5757 using namespace llvm;
902902 Function &F = const_cast(f);
903903 assert(!F.isDeclaration() && "Cannot lint external functions");
904904
905 FunctionPassManager FPM(F.getParent());
905 legacy::FunctionPassManager FPM(F.getParent());
906906 Lint *V = new Lint();
907907 FPM.add(V);
908908 FPM.run(F);
911911 /// lintModule - Check a module for errors, printing messages on stderr.
912912 ///
913913 void llvm::lintModule(const Module &M) {
914 PassManager PM;
914 legacy::PassManager PM;
915915 Lint *V = new Lint();
916916 PM.add(V);
917917 PM.run(const_cast(M));
2121 #include "llvm/CodeGen/MachineModuleInfo.h"
2222 #include "llvm/CodeGen/Passes.h"
2323 #include "llvm/IR/IRPrintingPasses.h"
24 #include "llvm/IR/LegacyPassManager.h"
2425 #include "llvm/IR/Verifier.h"
2526 #include "llvm/MC/MCAsmInfo.h"
2627 #include "llvm/MC/MCContext.h"
2728 #include "llvm/MC/MCInstrInfo.h"
2829 #include "llvm/MC/MCStreamer.h"
2930 #include "llvm/MC/MCSubtargetInfo.h"
30 #include "llvm/PassManager.h"
3131 #include "llvm/Support/CommandLine.h"
3232 #include "llvm/Support/ErrorHandling.h"
3333 #include "llvm/Support/FormattedStream.h"
1616 #include "llvm/CodeGen/MachineFunctionPass.h"
1717 #include "llvm/CodeGen/RegAllocRegistry.h"
1818 #include "llvm/IR/IRPrintingPasses.h"
19 #include "llvm/IR/LegacyPassManager.h"
1920 #include "llvm/IR/Verifier.h"
2021 #include "llvm/MC/MCAsmInfo.h"
21 #include "llvm/PassManager.h"
2222 #include "llvm/Support/CommandLine.h"
2323 #include "llvm/Support/Debug.h"
2424 #include "llvm/Support/ErrorHandling.h"
1414 #include "llvm/IR/DataLayout.h"
1515 #include "llvm/IR/DerivedTypes.h"
1616 #include "llvm/IR/Function.h"
17 #include "llvm/IR/LegacyPassManager.h"
1718 #include "llvm/IR/Mangler.h"
1819 #include "llvm/IR/Module.h"
1920 #include "llvm/MC/MCAsmInfo.h"
2021 #include "llvm/Object/Archive.h"
2122 #include "llvm/Object/ObjectFile.h"
22 #include "llvm/PassManager.h"
2323 #include "llvm/Support/DynamicLibrary.h"
2424 #include "llvm/Support/ErrorHandling.h"
2525 #include "llvm/Support/MemoryBuffer.h"
134134 // MCJIT instance, since these conditions are tested by our caller,
135135 // generateCodeForModule.
136136
137 PassManager PM;
137 legacy::PassManager PM;
138138
139139 M->setDataLayout(TM->getDataLayout());
140140 PM.add(new DataLayoutPass());
2525 #include "llvm/IR/InlineAsm.h"
2626 #include "llvm/IR/IntrinsicInst.h"
2727 #include "llvm/IR/LLVMContext.h"
28 #include "llvm/IR/LegacyPassManager.h"
2829 #include "llvm/IR/Module.h"
29 #include "llvm/PassManager.h"
3030 #include "llvm/Support/Debug.h"
3131 #include "llvm/Support/ErrorHandling.h"
3232 #include "llvm/Support/FileSystem.h"
28442844 /*===-- Pass Manager ------------------------------------------------------===*/
28452845
28462846 LLVMPassManagerRef LLVMCreatePassManager() {
2847 return wrap(new PassManager());
2847 return wrap(new legacy::PassManager());
28482848 }
28492849
28502850 LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M) {
2851 return wrap(new FunctionPassManager(unwrap(M)));
2851 return wrap(new legacy::FunctionPassManager(unwrap(M)));
28522852 }
28532853
28542854 LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P) {
28572857 }
28582858
28592859 LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) {
2860 return unwrap<PassManager>(PM)->run(*unwrap(M));
2860 return unwrap<legacy::PassManager>(PM)->run(*unwrap(M));
28612861 }
28622862
28632863 LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) {
2864 return unwrap<FunctionPassManager>(FPM)->doInitialization();
2864 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization();
28652865 }
28662866
28672867 LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) {
2868 return unwrap<FunctionPassManager>(FPM)->run(*unwrap(F));
2868 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap(F));
28692869 }
28702870
28712871 LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) {
2872 return unwrap<FunctionPassManager>(FPM)->doFinalization();
2872 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization();
28732873 }
28742874
28752875 void LLVMDisposePassManager(LLVMPassManagerRef PM) {
2525 #include "llvm/IR/DiagnosticInfo.h"
2626 #include "llvm/IR/DiagnosticPrinter.h"
2727 #include "llvm/IR/LLVMContext.h"
28 #include "llvm/IR/LegacyPassManager.h"
2829 #include "llvm/IR/Mangler.h"
2930 #include "llvm/IR/Module.h"
3031 #include "llvm/IR/Verifier.h"
3435 #include "llvm/MC/MCAsmInfo.h"
3536 #include "llvm/MC/MCContext.h"
3637 #include "llvm/MC/SubtargetFeature.h"
37 #include "llvm/PassManager.h"
3838 #include "llvm/Support/CommandLine.h"
3939 #include "llvm/Support/FileSystem.h"
4040 #include "llvm/Support/FormattedStream.h"
427427 Module *mergedModule = IRLinker.getModule();
428428
429429 // Start off with a verification pass.
430 PassManager passes;
430 legacy::PassManager passes;
431431 passes.add(createVerifierPass());
432432 passes.add(createDebugInfoVerifierPass());
433433
498498 this->applyScopeRestrictions();
499499
500500 // Instantiate the pass manager to organize the passes.
501 PassManager passes;
501 legacy::PassManager passes;
502502
503503 // Add an appropriate DataLayout instance for this module...
504504 mergedModule->setDataLayout(TargetMach->getDataLayout());
537537 // Mark which symbols can not be internalized
538538 this->applyScopeRestrictions();
539539
540 PassManager codeGenPasses;
540 legacy::PassManager codeGenPasses;
541541
542542 codeGenPasses.add(new DataLayoutPass());
543543
1616 #include "llvm/CodeGen/Passes.h"
1717 #include "llvm/CodeGen/RegAllocRegistry.h"
1818 #include "llvm/IR/Function.h"
19 #include "llvm/PassManager.h"
19 #include "llvm/IR/LegacyPassManager.h"
2020 #include "llvm/Support/CommandLine.h"
2121 #include "llvm/Support/TargetRegistry.h"
2222 #include "llvm/Target/TargetOptions.h"
1616 #include "ARMTargetTransformInfo.h"
1717 #include "llvm/CodeGen/Passes.h"
1818 #include "llvm/IR/Function.h"
19 #include "llvm/IR/LegacyPassManager.h"
1920 #include "llvm/MC/MCAsmInfo.h"
20 #include "llvm/PassManager.h"
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/FormattedStream.h"
2323 #include "llvm/Support/TargetRegistry.h"
1313 #include "BPF.h"
1414 #include "BPFTargetMachine.h"
1515 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
16 #include "llvm/PassManager.h"
16 #include "llvm/IR/LegacyPassManager.h"
1717 #include "llvm/CodeGen/Passes.h"
1818 #include "llvm/Support/FormattedStream.h"
1919 #include "llvm/Support/TargetRegistry.h"
2121 #include "llvm/IR/InlineAsm.h"
2222 #include "llvm/IR/Instruction.h"
2323 #include "llvm/IR/Instructions.h"
24 #include "llvm/IR/LegacyPassManager.h"
2425 #include "llvm/IR/Module.h"
2526 #include "llvm/MC/MCAsmInfo.h"
2627 #include "llvm/MC/MCInstrInfo.h"
2728 #include "llvm/MC/MCSubtargetInfo.h"
2829 #include "llvm/Pass.h"
29 #include "llvm/PassManager.h"
3030 #include "llvm/Support/CommandLine.h"
3131 #include "llvm/Support/ErrorHandling.h"
3232 #include "llvm/Support/FormattedStream.h"
19411941 void CppWriter::printProgram(const std::string& fname,
19421942 const std::string& mName) {
19431943 Out << "#include \n";
1944 Out << "#include \n";
19451944
19461945 Out << "#include \n";
19471946 Out << "#include \n";
19551954 Out << "#include \n";
19561955 Out << "#include \n";
19571956 Out << "#include \n";
1957 Out << "#include \n";
19581958 Out << "#include \n";
19591959 Out << "#include \n";
19601960 Out << "#include \n";
1616 #include "HexagonMachineScheduler.h"
1717 #include "HexagonTargetObjectFile.h"
1818 #include "llvm/CodeGen/Passes.h"
19 #include "llvm/IR/LegacyPassManager.h"
1920 #include "llvm/IR/Module.h"
20 #include "llvm/PassManager.h"
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/TargetRegistry.h"
2323 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
1414 #include "MSP430.h"
1515 #include "llvm/CodeGen/Passes.h"
1616 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
17 #include "llvm/IR/LegacyPassManager.h"
1718 #include "llvm/MC/MCAsmInfo.h"
18 #include "llvm/PassManager.h"
1919 #include "llvm/Support/TargetRegistry.h"
2020 using namespace llvm;
2121
2828 #include "MipsTargetObjectFile.h"
2929 #include "llvm/Analysis/TargetTransformInfo.h"
3030 #include "llvm/CodeGen/Passes.h"
31 #include "llvm/PassManager.h"
31 #include "llvm/IR/LegacyPassManager.h"
3232 #include "llvm/Support/Debug.h"
3333 #include "llvm/Support/TargetRegistry.h"
3434 #include "llvm/Support/raw_ostream.h"
1818
1919 #include "NVPTX.h"
2020 #include "llvm/IR/GlobalVariable.h"
21 #include "llvm/IR/LegacyPassManager.h"
2122 #include "llvm/IR/Module.h"
22 #include "llvm/PassManager.h"
2323 #include "llvm/Support/raw_ostream.h"
2424 #include
2525
2121 #include "llvm/IR/IRBuilder.h"
2222 #include "llvm/IR/Instructions.h"
2323 #include "llvm/IR/Intrinsics.h"
24 #include "llvm/IR/LegacyPassManager.h"
2425 #include "llvm/IR/Module.h"
2526 #include "llvm/IR/Operator.h"
2627 #include "llvm/IR/ValueMap.h"
27 #include "llvm/PassManager.h"
2828 #include "llvm/Transforms/Utils/ValueMapper.h"
2929
3030 using namespace llvm;
2424 #include "llvm/CodeGen/Passes.h"
2525 #include "llvm/IR/DataLayout.h"
2626 #include "llvm/IR/IRPrintingPasses.h"
27 #include "llvm/IR/LegacyPassManager.h"
2728 #include "llvm/IR/Verifier.h"
2829 #include "llvm/MC/MCAsmInfo.h"
2930 #include "llvm/MC/MCInstrInfo.h"
3031 #include "llvm/MC/MCStreamer.h"
3132 #include "llvm/MC/MCSubtargetInfo.h"
32 #include "llvm/PassManager.h"
3333 #include "llvm/Support/CommandLine.h"
3434 #include "llvm/Support/Debug.h"
3535 #include "llvm/Support/FormattedStream.h"
1616 #include "PPCTargetTransformInfo.h"
1717 #include "llvm/CodeGen/Passes.h"
1818 #include "llvm/IR/Function.h"
19 #include "llvm/IR/LegacyPassManager.h"
1920 #include "llvm/MC/MCStreamer.h"
20 #include "llvm/PassManager.h"
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/FormattedStream.h"
2323 #include "llvm/Support/TargetRegistry.h"
2727 #include "llvm/CodeGen/Passes.h"
2828 #include "llvm/IR/Verifier.h"
2929 #include "llvm/MC/MCAsmInfo.h"
30 #include "llvm/PassManager.h"
30 #include "llvm/IR/LegacyPassManager.h"
3131 #include "llvm/Support/TargetRegistry.h"
3232 #include "llvm/Support/raw_os_ostream.h"
3333 #include "llvm/Transforms/IPO.h"
1515 #include "AMDGPUSubtarget.h"
1616 #include "llvm/CodeGen/MachineRegisterInfo.h"
1717 #include "llvm/Pass.h"
18 #include "llvm/PassManager.h"
18 #include "llvm/IR/LegacyPassManager.h"
1919 #include "llvm/Support/raw_ostream.h"
2020
2121 using namespace llvm;
1313 #include "SparcTargetObjectFile.h"
1414 #include "Sparc.h"
1515 #include "llvm/CodeGen/Passes.h"
16 #include "llvm/PassManager.h"
16 #include "llvm/IR/LegacyPassManager.h"
1717 #include "llvm/Support/TargetRegistry.h"
1818 using namespace llvm;
1919
1717 #include "llvm/IR/LLVMContext.h"
1818 #include "llvm/IR/Value.h"
1919 #include "llvm/InitializePasses.h"
20 #include "llvm/PassManager.h"
20 #include "llvm/IR/LegacyPassManager.h"
2121 #include "llvm/Analysis/TargetLibraryInfo.h"
2222 #include
2323
2424 #include "llvm/MC/MCSectionMachO.h"
2525 #include "llvm/MC/MCTargetOptions.h"
2626 #include "llvm/MC/SectionKind.h"
27 #include "llvm/PassManager.h"
27 #include "llvm/IR/LegacyPassManager.h"
2828 #include "llvm/Support/CommandLine.h"
2929 #include "llvm/Target/TargetLowering.h"
3030 #include "llvm/Target/TargetLoweringObjectFile.h"
1616 #include "llvm/Analysis/TargetTransformInfo.h"
1717 #include "llvm/IR/DataLayout.h"
1818 #include "llvm/IR/Module.h"
19 #include "llvm/PassManager.h"
19 #include "llvm/IR/LegacyPassManager.h"
2020 #include "llvm/Support/CodeGen.h"
2121 #include "llvm/Support/FileSystem.h"
2222 #include "llvm/Support/FormattedStream.h"
186186 TargetMachine* TM = unwrap(T);
187187 Module* Mod = unwrap(M);
188188
189 PassManager pass;
189 legacy::PassManager pass;
190190
191191 std::string error;
192192
1616 #include "X86TargetTransformInfo.h"
1717 #include "llvm/CodeGen/Passes.h"
1818 #include "llvm/IR/Function.h"
19 #include "llvm/PassManager.h"
19 #include "llvm/IR/LegacyPassManager.h"
2020 #include "llvm/Support/CommandLine.h"
2121 #include "llvm/Support/FormattedStream.h"
2222 #include "llvm/Support/TargetRegistry.h"
1515 #include "XCore.h"
1616 #include "llvm/CodeGen/Passes.h"
1717 #include "llvm/IR/Module.h"
18 #include "llvm/PassManager.h"
18 #include "llvm/IR/LegacyPassManager.h"
1919 #include "llvm/Support/TargetRegistry.h"
2020 using namespace llvm;
2121
1515 #include "llvm-c/Initialization.h"
1616 #include "llvm-c/Transforms/IPO.h"
1717 #include "llvm/InitializePasses.h"
18 #include "llvm/PassManager.h"
18 #include "llvm/IR/LegacyPassManager.h"
1919 #include "llvm/Transforms/IPO.h"
2020
2121 using namespace llvm;
1818 #include "llvm/Analysis/Passes.h"
1919 #include "llvm/IR/DataLayout.h"
2020 #include "llvm/IR/Verifier.h"
21 #include "llvm/PassManager.h"
21 #include "llvm/IR/LegacyPassManager.h"
2222 #include "llvm/Support/CommandLine.h"
2323 #include "llvm/Support/ManagedStatic.h"
2424 #include "llvm/Analysis/TargetLibraryInfo.h"
116116 }
117117
118118 void PassManagerBuilder::addExtensionsToPM(ExtensionPointTy ETy,
119 PassManagerBase &PM) const {
119 legacy::PassManagerBase &PM) const {
120120 for (unsigned i = 0, e = GlobalExtensions->size(); i != e; ++i)
121121 if ((*GlobalExtensions)[i].first == ETy)
122122 (*GlobalExtensions)[i].second(*this, PM);
125125 Extensions[i].second(*this, PM);
126126 }
127127
128 void
129 PassManagerBuilder::addInitialAliasAnalysisPasses(PassManagerBase &PM) const {
128 void PassManagerBuilder::addInitialAliasAnalysisPasses(
129 legacy::PassManagerBase &PM) const {
130130 // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
131131 // BasicAliasAnalysis wins if they disagree. This is intended to help
132132 // support "obvious" type-punning idioms.
137137 PM.add(createBasicAliasAnalysisPass());
138138 }
139139
140 void PassManagerBuilder::populateFunctionPassManager(FunctionPassManager &FPM) {
140 void PassManagerBuilder::populateFunctionPassManager(
141 legacy::FunctionPassManager &FPM) {
141142 addExtensionsToPM(EP_EarlyAsPossible, FPM);
142143
143144 // Add LibraryInfo if we have some.
157158 FPM.add(createLowerExpectIntrinsicPass());
158159 }
159160
160 void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
161 void PassManagerBuilder::populateModulePassManager(
162 legacy::PassManagerBase &MPM) {
161163 // If all optimizations are disabled, just run the always-inline pass and,
162164 // if enabled, the function merging pass.
163165 if (OptLevel == 0) {
374376 addExtensionsToPM(EP_OptimizerLast, MPM);
375377 }
376378
377 void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) {
379 void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
378380 // Provide AliasAnalysis services for optimizations.
379381 addInitialAliasAnalysisPasses(PM);
380382
477479 PM.add(createMergeFunctionsPass());
478480 }
479481
480 void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM) {
482 void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
481483 if (LibraryInfo)
482484 PM.add(new TargetLibraryInfoWrapperPass(*LibraryInfo));
483485
562564 LLVMPassManagerBuilderPopulateFunctionPassManager(LLVMPassManagerBuilderRef PMB,
563565 LLVMPassManagerRef PM) {
564566 PassManagerBuilder *Builder = unwrap(PMB);
565 FunctionPassManager *FPM = unwrap<FunctionPassManager>(PM);
567 legacy::FunctionPassManager *FPM = unwrapFunctionPassManager>(PM);
566568 Builder->populateFunctionPassManager(*FPM);
567569 }
568570
570572 LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB,
571573 LLVMPassManagerRef PM) {
572574 PassManagerBuilder *Builder = unwrap(PMB);
573 PassManagerBase *MPM = unwrap(PM);
575 legacy::PassManagerBase *MPM = unwrap(PM);
574576 Builder->populateModulePassManager(*MPM);
575577 }
576578
579581 LLVMBool Internalize,
580582 LLVMBool RunInliner) {
581583 PassManagerBuilder *Builder = unwrap(PMB);
582 PassManagerBase *LPM = unwrap(PM);
584 legacy::PassManagerBase *LPM = unwrap(PM);
583585
584586 // A small backwards compatibility hack. populateLTOPassManager used to take
585587 // an RunInliner option.
4848 //===----------------------------------------------------------------------===//
4949
5050 #include "llvm/Pass.h"
51 #include "llvm/PassManager.h"
51 #include "llvm/IR/LegacyPassManager.h"
5252 #include "llvm/ADT/SetOperations.h"
5353 #include "llvm/ADT/Statistic.h"
5454 #include "llvm/Analysis/LoopPass.h"
538538 // need the pass manager to handle scheduling all the loop passes
539539 // appropriately. Doing this by hand is painful and just not worth messing
540540 // with for the moment.
541 FunctionPassManager FPM(F.getParent());
541 legacy::FunctionPassManager FPM(F.getParent());
542542 bool CanAssumeCallSafepoints = EnableCallSafepoints;
543543 PlaceBackedgeSafepointsImpl *PBS =
544544 new PlaceBackedgeSafepointsImpl(CanAssumeCallSafepoints);
1919 #include "llvm/IR/DataLayout.h"
2020 #include "llvm/IR/Verifier.h"
2121 #include "llvm/InitializePasses.h"
22 #include "llvm/PassManager.h"
22 #include "llvm/IR/LegacyPassManager.h"
2323
2424 using namespace llvm;
2525
5959 #define DEBUG_TYPE "symbol-rewriter"
6060 #include "llvm/CodeGen/Passes.h"
6161 #include "llvm/Pass.h"
62 #include "llvm/PassManager.h"
62 #include "llvm/IR/LegacyPassManager.h"
6363 #include "llvm/Support/CommandLine.h"
6464 #include "llvm/Support/Debug.h"
6565 #include "llvm/Support/MemoryBuffer.h"
1818 #include "llvm/Analysis/Passes.h"
1919 #include "llvm/IR/Verifier.h"
2020 #include "llvm/InitializePasses.h"
21 #include "llvm/PassManager.h"
21 #include "llvm/IR/LegacyPassManager.h"
2222
2323 using namespace llvm;
2424
1818 #include "llvm/IR/Constants.h"
1919 #include "llvm/IR/DerivedTypes.h"
2020 #include "llvm/IR/Instructions.h"
21 #include "llvm/IR/LegacyPassManager.h"
2122 #include "llvm/IR/Module.h"
2223 #include "llvm/IR/ValueSymbolTable.h"
2324 #include "llvm/IR/Verifier.h"
2425 #include "llvm/Pass.h"
25 #include "llvm/PassManager.h"
2626 #include "llvm/Support/CommandLine.h"
2727 #include "llvm/Support/FileUtilities.h"
2828 #include "llvm/Transforms/Scalar.h"
406406 }
407407
408408 // Verify that this is still valid.
409 PassManager Passes;
409 legacy::PassManager Passes;
410410 Passes.add(createVerifierPass());
411411 Passes.add(createDebugInfoVerifierPass());
412412 Passes.run(*M);
1616 #include "llvm/IR/DataLayout.h"
1717 #include "llvm/IR/DerivedTypes.h"
1818 #include "llvm/IR/LLVMContext.h"
19 #include "llvm/IR/LegacyPassManager.h"
1920 #include "llvm/IR/Module.h"
2021 #include "llvm/IR/Verifier.h"
2122 #include "llvm/Pass.h"
22 #include "llvm/PassManager.h"
2323 #include "llvm/Support/CommandLine.h"
2424 #include "llvm/Support/Debug.h"
2525 #include "llvm/Support/FileUtilities.h"
1717 #include "BugDriver.h"
1818 #include "llvm/Bitcode/ReaderWriter.h"
1919 #include "llvm/IR/DataLayout.h"
20 #include "llvm/IR/LegacyPassManager.h"
2021 #include "llvm/IR/Module.h"
2122 #include "llvm/IR/Verifier.h"
22 #include "llvm/PassManager.h"
2323 #include "llvm/Support/CommandLine.h"
2424 #include "llvm/Support/Debug.h"
2525 #include "llvm/Support/FileUtilities.h"
1515 #include "BugDriver.h"
1616 #include "ToolRunner.h"
1717 #include "llvm/IR/LLVMContext.h"
18 #include "llvm/IR/LegacyPassManager.h"
1819 #include "llvm/IR/LegacyPassNameParser.h"
1920 #include "llvm/LinkAllIR.h"
2021 #include "llvm/LinkAllPasses.h"
21 #include "llvm/PassManager.h"
2222 #include "llvm/Support/CommandLine.h"
2323 #include "llvm/Support/ManagedStatic.h"
2424 #include "llvm/Support/PluginLoader.h"
9191
9292 // Hack to capture a pass list.
9393 namespace {
94 class AddToDriver : public FunctionPassManager {
94 class AddToDriver : public legacy::FunctionPassManager {
9595 BugDriver &D;
9696 public:
9797 AddToDriver(BugDriver &_D) : FunctionPassManager(nullptr), D(_D) {}
2323 #include "llvm/IR/DiagnosticInfo.h"
2424 #include "llvm/IR/DiagnosticPrinter.h"
2525 #include "llvm/IR/LLVMContext.h"
26 #include "llvm/IR/LegacyPassManager.h"
2627 #include "llvm/IR/Module.h"
2728 #include "llvm/IR/Verifier.h"
2829 #include "llvm/Linker/Linker.h"
2930 #include "llvm/MC/SubtargetFeature.h"
3031 #include "llvm/Object/IRObjectFile.h"
31 #include "llvm/PassManager.h"
3232 #include "llvm/Support/FormattedStream.h"
3333 #include "llvm/Support/Host.h"
3434 #include "llvm/Support/ManagedStatic.h"
692692 }
693693
694694 static void runLTOPasses(Module &M, TargetMachine &TM) {
695 PassManager passes;
695 legacy::PassManager passes;
696696 passes.add(new DataLayoutPass());
697697 passes.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));
698698
699 PassManagerBuilder PMB;
699 legacy::PassManagerBuilder PMB;
700700 PMB.LibraryInfo = new TargetLibraryInfoImpl(Triple(TM.getTargetTriple()));
701701 PMB.Inliner = createFunctionInliningPass();
702702 PMB.VerifyInput = true;
742742 if (options::TheOutputType == options::OT_SAVE_TEMPS)
743743 saveBCFile(output_name + ".opt.bc", M);
744744
745 PassManager CodeGenPasses;
745 legacy::PassManager CodeGenPasses;
746746 CodeGenPasses.add(new DataLayoutPass());
747747
748748 SmallString<128> Filename;
2121 #include "llvm/IR/DataLayout.h"
2222 #include "llvm/IR/IRPrintingPasses.h"
2323 #include "llvm/IR/LLVMContext.h"
24 #include "llvm/IR/LegacyPassManager.h"
2425 #include "llvm/IR/Module.h"
2526 #include "llvm/IRReader/IRReader.h"
2627 #include "llvm/MC/SubtargetFeature.h"
2728 #include "llvm/Pass.h"
28 #include "llvm/PassManager.h"
2929 #include "llvm/Support/CommandLine.h"
3030 #include "llvm/Support/Debug.h"
3131 #include "llvm/Support/FileSystem.h"
292292 if (!Out) return 1;
293293
294294 // Build up all of the passes that we want to do to the module.
295 PassManager PM;
295 legacy::PassManager PM;
296296
297297 // Add an appropriate TargetLibraryInfo pass for the module's triple.
298298 TargetLibraryInfoImpl TLII(Triple(M->getTargetTriple()));
1919 #include "llvm/IR/LLVMContext.h"
2020 #include "llvm/IR/Module.h"
2121 #include "llvm/IRReader/IRReader.h"
22 #include "llvm/PassManager.h"
22 #include "llvm/IR/LegacyPassManager.h"
2323 #include "llvm/Support/CommandLine.h"
2424 #include "llvm/Support/FileSystem.h"
2525 #include "llvm/Support/ManagedStatic.h"
245245
246246 // In addition to deleting all other functions, we also want to spiff it
247247 // up a little bit. Do this now.
248 PassManager Passes;
248 legacy::PassManager Passes;
249249 Passes.add(new DataLayoutPass()); // Use correct DataLayout
250250
251251 std::vector Gvs(GVs.begin(), GVs.end());
1919 #include "llvm/IR/LegacyPassNameParser.h"
2020 #include "llvm/IR/Module.h"
2121 #include "llvm/IR/Verifier.h"
22 #include "llvm/PassManager.h"
22 #include "llvm/IR/LegacyPassManager.h"
2323 #include "llvm/Support/Debug.h"
2424 #include "llvm/Support/FileSystem.h"
2525 #include "llvm/Support/ManagedStatic.h"
710710 return 1;
711711 }
712712
713 PassManager Passes;
713 legacy::PassManager Passes;
714714 Passes.add(createVerifierPass());
715715 Passes.add(createDebugInfoVerifierPass());
716716 Passes.add(createPrintModulePass(Out->os()));
3434 #include "llvm/LinkAllIR.h"
3535 #include "llvm/LinkAllPasses.h"
3636 #include "llvm/MC/SubtargetFeature.h"
37 #include "llvm/PassManager.h"
37 #include "llvm/IR/LegacyPassManager.h"
3838 #include "llvm/Support/Debug.h"
3939 #include "llvm/Support/FileSystem.h"
4040 #include "llvm/Support/ManagedStatic.h"
179179
180180
181181
182 static inline void addPass(PassManagerBase &PM, Pass *P) {
182 static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
183183 // Add the pass to the pass manager...
184184 PM.add(P);
185185
194194 /// OptLevel.
195195 ///
196196 /// OptLevel - Optimization Level
197 static void AddOptimizationPasses(PassManagerBase &MPM,FunctionPassManager &FPM,
197 static void AddOptimizationPasses(legacy::PassManagerBase &MPM,
198 legacy::FunctionPassManager &FPM,
198199 unsigned OptLevel, unsigned SizeLevel) {
199200 FPM.add(createVerifierPass()); // Verify that input is correct
200201 MPM.add(createDebugInfoVerifierPass()); // Verify that debug info is correct
229230 Builder.populateModulePassManager(MPM);
230231 }
231232
232 static void AddStandardLinkPasses(PassManagerBase &PM) {
233 static void AddStandardLinkPasses(legacy::PassManagerBase &PM) {
233234 PassManagerBuilder Builder;
234235 Builder.VerifyInput = true;
235236 Builder.StripDebug = StripDebug;
405406 // Create a PassManager to hold and optimize the collection of passes we are
406407 // about to build.
407408 //
408 PassManager Passes;
409 legacy::PassManager Passes;
409410
410411 // Add an appropriate TargetLibraryInfo pass for the module's triple.
411412 TargetLibraryInfoImpl TLII(ModuleTriple);
429430 Passes.add(createTargetTransformInfoWrapperPass(TM ? TM->getTargetIRAnalysis()
430431 : TargetIRAnalysis()));
431432
432 std::unique_ptr<FunctionPassManager> FPasses;
433 std::unique_ptr<legacy::FunctionPassManager> FPasses;
433434 if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) {
434 FPasses.reset(new FunctionPassManager(M.get()));
435 FPasses.reset(new legacy::FunctionPassManager(M.get()));
435436 if (DL)
436437 FPasses->add(new DataLayoutPass());
437438 FPasses->add(createTargetTransformInfoWrapperPass(
1515 #include "llvm/IR/LLVMContext.h"
1616 #include "llvm/IR/Module.h"
1717 #include "llvm/Pass.h"
18 #include "llvm/PassManager.h"
18 #include "llvm/IR/LegacyPassManager.h"
1919 #include "llvm/Support/ErrorHandling.h"
2020 #include "llvm/Support/SourceMgr.h"
2121 #include "gtest/gtest.h"
106106
107107 IsPotentiallyReachableTestPass *P =
108108 new IsPotentiallyReachableTestPass(ExpectedResult, A, B);
109 PassManager PM;
109 legacy::PassManager PM;
110110 PM.add(P);
111111 PM.run(*M);
112112 }
1212 #include "llvm/IR/LLVMContext.h"
1313 #include "llvm/IR/MDBuilder.h"
1414 #include "llvm/IR/Module.h"
15 #include "llvm/PassManager.h"
15 #include "llvm/IR/LegacyPassManager.h"
1616 #include "llvm/Support/CommandLine.h"
1717 #include "gtest/gtest.h"
1818
2626 LLVMContext C;
2727 Module M;
2828 MDBuilder MD;
29 PassManager PM;
29 legacy::PassManager PM;
3030 };
3131
3232 TEST_F(MixedTBAATest, MixedTBAA) {
1313 #include "llvm/IR/GlobalVariable.h"
1414 #include "llvm/IR/LLVMContext.h"
1515 #include "llvm/IR/Module.h"
16 #include "llvm/PassManager.h"
16 #include "llvm/IR/LegacyPassManager.h"
1717 #include "gtest/gtest.h"
1818
1919 namespace llvm {
3131 }
3232 LLVMContext Context;
3333 Module M;
34 PassManager PM;
34 legacy::PassManager PM;
3535 ScalarEvolution &SE;
3636 };
3737
1212 #include "llvm/IR/Instructions.h"
1313 #include "llvm/IR/LLVMContext.h"
1414 #include "llvm/IR/Module.h"
15 #include "llvm/PassManager.h"
15 #include "llvm/IR/LegacyPassManager.h"
1616 #include "llvm/Support/SourceMgr.h"
1717 #include "gtest/gtest.h"
1818
217217 TEST(DominatorTree, Unreachable) {
218218 DPass *P = new DPass();
219219 std::unique_ptr M = makeLLVMModule(P);
220 PassManager Passes;
220 legacy::PassManager Passes;
221221 Passes.add(P);
222222 Passes.run(*M);
223223 }
77 //===----------------------------------------------------------------------===//
88 //
99 // This unit test exercises the legacy pass manager infrastructure. We use the
10 // old names as well to ensure that the source-level compatibility wrapper
11 // works for out-of-tree code that expects to include llvm/PassManager.h and
12 // subclass the core pass classes.
10 // old names as well to ensure that the source-level compatibility is preserved
11 // where possible.
1312 //
1413 //===----------------------------------------------------------------------===//
1514
16 #include "llvm/PassManager.h"
15 #include "llvm/IR/LegacyPassManager.h"
1716 #include "llvm/ADT/SmallVector.h"
1817 #include "llvm/Analysis/CallGraphSCCPass.h"
1918 #include "llvm/Analysis/LoopInfo.h"
301300
302301 mNDM->run = mNDNM->run = mDNM->run = mNDM2->run = 0;
303302
304 PassManager Passes;
303 legacy::PassManager Passes;
305304 Passes.add(new DataLayoutPass());
306305 Passes.add(mNDM2);
307306 Passes.add(mNDM);
325324
326325 mNDM->run = mNDNM->run = mDNM->run = mNDM2->run = 0;
327326
328 PassManager Passes;
327 legacy::PassManager Passes;
329328 Passes.add(new DataLayoutPass());
330329 Passes.add(mNDM);
331330 Passes.add(mNDNM);
347346 void MemoryTestHelper(int run) {
348347 std::unique_ptr M(makeLLVMModule());
349348 T *P = new T();
350 PassManager Passes;
349 legacy::PassManager Passes;
351350 Passes.add(new DataLayoutPass());
352351 Passes.add(P);
353352 Passes.run(*M);
358357 void MemoryTestHelper(int run, int N) {
359358 Module *M = makeLLVMModule();
360359 T *P = new T();
361 PassManager Passes;
360 legacy::PassManager Passes;
362361 Passes.add(new DataLayoutPass());
363362 Passes.add(P);
364363 Passes.run(*M);
396395 {
397396 SCOPED_TRACE("Running OnTheFlyTest");
398397 struct OnTheFlyTest *O = new OnTheFlyTest();
399 PassManager Passes;
398 legacy::PassManager Passes;
400399 Passes.add(new DataLayoutPass());
401400 Passes.add(O);
402401 Passes.run(*M);