diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 74a6d99a4a47..07f20a3f31b9 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -143,9 +143,11 @@ public: private: // Note that this must not be -1 or -2 as those are already used by the // SmallPtrSet. - static const uintptr_t AllPassesID = (intptr_t)-3; + static const uintptr_t AllPassesID = (intptr_t)(-3); - bool areAllPreserved() const { return PreservedPassIDs.count((void *)AllPassesID); } + bool areAllPreserved() const { + return PreservedPassIDs.count((void *)AllPassesID); + } SmallPtrSet PreservedPassIDs; }; @@ -176,7 +178,9 @@ template class PassRunAcceptsAnalysisManager { typedef char SmallType; - struct BigType { char a, b; }; + struct BigType { + char a, b; + }; template struct Checker; @@ -201,8 +205,8 @@ struct PassModel; /// \brief Specialization of \c PassModel for passes that accept an analyis /// manager. template -struct PassModel : PassConcept { +struct PassModel + : PassConcept { explicit PassModel(PassT Pass) : Pass(std::move(Pass)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -223,8 +227,8 @@ struct PassModel -struct PassModel : PassConcept { +struct PassModel + : PassConcept { explicit PassModel(PassT Pass) : Pass(std::move(Pass)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -266,7 +270,9 @@ template struct AnalysisResultConcept { /// \c invalidate member function. template class ResultHasInvalidateMethod { typedef char SmallType; - struct BigType { char a, b; }; + struct BigType { + char a, b; + }; template struct Checker; @@ -292,8 +298,8 @@ struct AnalysisResultModel; /// \brief Specialization of \c AnalysisResultModel which provides the default /// invalidate functionality. template -struct AnalysisResultModel : AnalysisResultConcept { +struct AnalysisResultModel + : AnalysisResultConcept { explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -320,8 +326,8 @@ struct AnalysisResultModel -struct AnalysisResultModel : AnalysisResultConcept { +struct AnalysisResultModel + : AnalysisResultConcept { explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -353,7 +359,7 @@ struct AnalysisPassConcept { /// \returns A unique_ptr to the analysis result object to be queried by /// users. virtual std::unique_ptr> - run(IRUnitT IR, AnalysisManagerT *AM) = 0; + run(IRUnitT IR, AnalysisManagerT *AM) = 0; }; /// \brief Wrapper to model the analysis pass concept. @@ -363,15 +369,14 @@ struct AnalysisPassConcept { /// wrapped in a \c AnalysisResultModel. template ::Value> struct AnalysisPassModel; + IRUnitT, AnalysisManagerT, PassT, typename PassT::Result>::Value> +struct AnalysisPassModel; /// \brief Specialization of \c AnalysisPassModel which passes an /// \c AnalysisManager to PassT's run method. template -struct AnalysisPassModel : AnalysisPassConcept { +struct AnalysisPassModel + : AnalysisPassConcept { explicit AnalysisPassModel(PassT Pass) : Pass(std::move(Pass)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -400,9 +405,8 @@ struct AnalysisPassModel -struct AnalysisPassModel : AnalysisPassConcept { +struct AnalysisPassModel + : AnalysisPassConcept { explicit AnalysisPassModel(PassT Pass) : Pass(std::move(Pass)) {} // We have to explicitly define all the special member functions because MSVC // refuses to generate them. @@ -428,7 +432,7 @@ struct AnalysisPassModel ModulePassConcept; + typedef detail::PassConcept + ModulePassConcept; template struct ModulePassModel : detail::PassModel { @@ -480,7 +485,8 @@ public: // We have to explicitly define all the special member functions because MSVC // refuses to generate them. FunctionPassManager() {} - FunctionPassManager(FunctionPassManager &&Arg) : Passes(std::move(Arg.Passes)) {} + FunctionPassManager(FunctionPassManager &&Arg) + : Passes(std::move(Arg.Passes)) {} FunctionPassManager &operator=(FunctionPassManager &&RHS) { Passes = std::move(RHS.Passes); return *this; @@ -497,7 +503,7 @@ public: private: // Pull in the concept type and model template specialized for functions. typedef detail::PassConcept - FunctionPassConcept; + FunctionPassConcept; template struct FunctionPassModel : detail::PassModel { @@ -526,10 +532,11 @@ namespace detail { /// - invalidateImpl /// /// The details of the call pattern are within. -template -class AnalysisManagerBase { +template class AnalysisManagerBase { DerivedT *derived_this() { return static_cast(this); } - const DerivedT *derived_this() const { return static_cast(this); } + const DerivedT *derived_this() const { + return static_cast(this); + } AnalysisManagerBase(const AnalysisManagerBase &) LLVM_DELETED_FUNCTION; AnalysisManagerBase & @@ -642,7 +649,7 @@ private: AnalysisPassMapT AnalysisPasses; }; -} +} // End namespace detail /// \brief A module analysis pass manager with lazy running and caching of /// results. @@ -683,7 +690,8 @@ private: /// \brief Invalidate results across a module. void invalidateImpl(Module *M, const PreservedAnalyses &PA); - /// \brief Map type from module analysis pass ID to pass result concept pointer. + /// \brief Map type from module analysis pass ID to pass result concept + /// pointer. typedef DenseMap>> ModuleAnalysisResultMapT; @@ -697,7 +705,8 @@ private: class FunctionAnalysisManager : public detail::AnalysisManagerBase { friend class detail::AnalysisManagerBase; - typedef detail::AnalysisManagerBase BaseT; + typedef detail::AnalysisManagerBase + BaseT; typedef BaseT::ResultConceptT ResultConceptT; typedef BaseT::PassConceptT PassConceptT; @@ -728,7 +737,8 @@ public: void clear(); private: - FunctionAnalysisManager(const FunctionAnalysisManager &) LLVM_DELETED_FUNCTION; + FunctionAnalysisManager(const FunctionAnalysisManager &) + LLVM_DELETED_FUNCTION; FunctionAnalysisManager & operator=(const FunctionAnalysisManager &) LLVM_DELETED_FUNCTION; @@ -751,11 +761,11 @@ private: /// half of a bijection and provides storage for the actual result concept. typedef std::list>>> - FunctionAnalysisResultListT; + FunctionAnalysisResultListT; /// \brief Map type from function pointer to our custom list type. typedef DenseMap - FunctionAnalysisResultListMapT; + FunctionAnalysisResultListMapT; /// \brief Map from function to a list of function analysis results. /// @@ -928,8 +938,7 @@ private: /// \c FunctionAnalysisManagerModuleProxy analysis prior to running the function /// pass over the module to enable a \c FunctionAnalysisManager to be used /// within this run safely. -template -class ModuleToFunctionPassAdaptor { +template class ModuleToFunctionPassAdaptor { public: explicit ModuleToFunctionPassAdaptor(FunctionPassT Pass) : Pass(std::move(Pass)) {}