llvm.org GIT mirror llvm / 9136fdd
[PM] Re-clang-format much of this code as the code has changed some and so has clang-format. Notably, this fixes a bunch of formatting in the CGSCC pass manager side of things that has been improved in clang-format recently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225743 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
4 changed file(s) with 22 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
5151 private:
5252 // Pull in the concept type and model template specialized for SCCs.
5353 typedef detail::PassConcept
54 CGSCCPassConcept;
54 CGSCCPassConcept;
5555 template
5656 struct CGSCCPassModel
5757 : detail::PassModel {
6868
6969 /// \brief A function analysis manager to coordinate and cache analyses run over
7070 /// a module.
71 class CGSCCAnalysisManager : public detail::AnalysisManagerBase<
72 CGSCCAnalysisManager, LazyCallGraph::SCC> {
71 class CGSCCAnalysisManager
72 : public detail::AnalysisManagerBase
73 LazyCallGraph::SCC> {
7374 friend class detail::AnalysisManagerBase
7475 LazyCallGraph::SCC>;
75 typedef detail::AnalysisManagerBase
76 LazyCallGraph::SCC> BaseT;
76 typedef detail::AnalysisManagerBase
77 BaseT;
7778 typedef BaseT::ResultConceptT ResultConceptT;
7879 typedef BaseT::PassConceptT PassConceptT;
7980
126127 /// Requires iterators to be valid across appending new entries and arbitrary
127128 /// erases. Provides both the pass ID and concept pointer such that it is
128129 /// half of a bijection and provides storage for the actual result concept.
129 typedef std::list<
130 std::pair
131 LazyCallGraph::SCC>>>> CGSCCAnalysisResultListT;
130 typedef std::list
131 void *,
132 std::unique_ptr>>>
133 CGSCCAnalysisResultListT;
132134
133135 /// \brief Map type from function pointer to our custom list type.
134136 typedef DenseMap
135 CGSCCAnalysisResultListMapT;
137 CGSCCAnalysisResultListMapT;
136138
137139 /// \brief Map from function to a list of function analysis results.
138140 ///
200202 : CGAM(&CGAM) {}
201203 // We have to explicitly define all the special member functions because MSVC
202204 // refuses to generate them.
203 CGSCCAnalysisManagerModuleProxy(
204 const CGSCCAnalysisManagerModuleProxy &Arg)
205 CGSCCAnalysisManagerModuleProxy(const CGSCCAnalysisManagerModuleProxy &Arg)
205206 : CGAM(Arg.CGAM) {}
206207 CGSCCAnalysisManagerModuleProxy(CGSCCAnalysisManagerModuleProxy &&Arg)
207208 : CGAM(std::move(Arg.CGAM)) {}
272273 : MAM(&MAM) {}
273274 // We have to explicitly define all the special member functions because MSVC
274275 // refuses to generate them.
275 ModuleAnalysisManagerCGSCCProxy(
276 const ModuleAnalysisManagerCGSCCProxy &Arg)
276 ModuleAnalysisManagerCGSCCProxy(const ModuleAnalysisManagerCGSCCProxy &Arg)
277277 : MAM(Arg.MAM) {}
278278 ModuleAnalysisManagerCGSCCProxy(ModuleAnalysisManagerCGSCCProxy &&Arg)
279279 : MAM(std::move(Arg.MAM)) {}
540540 : Pass(Arg.Pass) {}
541541 CGSCCToFunctionPassAdaptor(CGSCCToFunctionPassAdaptor &&Arg)
542542 : Pass(std::move(Arg.Pass)) {}
543 friend void swap(CGSCCToFunctionPassAdaptor &LHS, CGSCCToFunctionPassAdaptor &RHS) {
543 friend void swap(CGSCCToFunctionPassAdaptor &LHS,
544 CGSCCToFunctionPassAdaptor &RHS) {
544545 using std::swap;
545546 swap(LHS.Pass, RHS.Pass);
546547 }
596597 createCGSCCToFunctionPassAdaptor(FunctionPassT Pass) {
597598 return std::move(CGSCCToFunctionPassAdaptor(std::move(Pass)));
598599 }
599
600600 }
601601
602602 #endif
202202
203203 private:
204204 // Pull in the concept type and model template specialized for modules.
205 typedef detail::PassConcept
206 ModulePassConcept;
205 typedef detail::PassConcept ModulePassConcept;
207206 template
208207 struct ModulePassModel
209208 : detail::PassModel {
473472 class FunctionAnalysisManager
474473 : public detail::AnalysisManagerBase {
475474 friend class detail::AnalysisManagerBase;
476 typedef detail::AnalysisManagerBase
477 BaseT;
475 typedef detail::AnalysisManagerBase BaseT;
478476 typedef BaseT::ResultConceptT ResultConceptT;
479477 typedef BaseT::PassConceptT PassConceptT;
480478
829827 /// analysis passes to be re-run to produce fresh results if any are needed.
830828 struct InvalidateAllAnalysesPass {
831829 /// \brief Run this pass over some unit of IR.
832 template
833 PreservedAnalyses run(T &&Arg) {
830 template PreservedAnalyses run(T &&Arg) {
834831 return PreservedAnalyses::none();
835832 }
836833
1313 using namespace llvm;
1414
1515 static cl::opt
16 DebugPM("debug-cgscc-pass-manager", cl::Hidden,
17 cl::desc("Print CGSCC pass management debugging information"));
16 DebugPM("debug-cgscc-pass-manager", cl::Hidden,
17 cl::desc("Print CGSCC pass management debugging information"));
1818
1919 PreservedAnalyses CGSCCPassManager::run(LazyCallGraph::SCC &C,
2020 CGSCCAnalysisManager *AM) {
106106 // of the analysis manager is required for this invalidation event.
107107 if (I->second->invalidate(M, PA)) {
108108 if (DebugPM)
109 dbgs() << "Invalidating module analysis: "
110 << lookupPass(PassID).name() << "\n";
109 dbgs() << "Invalidating module analysis: " << lookupPass(PassID).name()
110 << "\n";
111111
112112 ModuleAnalysisResults.erase(I);
113113 }