index 1b43a72c408cfece3df22a18df906d36abebb857..0d0f178c95cdb0b495496bca1666ca17af4d00de 100644 (file)
/// Note that actual pass object can omit the analysis manager argument if
/// desired. Also that the analysis manager may be null if there is no
/// analysis manager in the pass pipeline.
- virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) = 0;
+ virtual PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT *AM) = 0;
/// \brief Polymorphic method to access the name of a pass.
virtual StringRef name() = 0;
char a, b;
};
- template <typename T, ResultT (T::*)(IRUnitT, AnalysisManagerT *)>
+ template <typename T, ResultT (T::*)(IRUnitT &, AnalysisManagerT *)>
struct Checker;
template <typename T> static SmallType f(Checker<T, &T::run> *);
return *this;
}
- PreservedAnalysesT run(IRUnitT IR, AnalysisManagerT *AM) override {
+ PreservedAnalysesT run(IRUnitT &IR, AnalysisManagerT *AM) override {
return Pass.run(IR, AM);
}
StringRef name() override { return PassT::name(); }
return *this;
}
- PreservedAnalysesT run(IRUnitT IR, AnalysisManagerT *AM) override {
+ PreservedAnalysesT run(IRUnitT &IR, AnalysisManagerT *AM) override {
return Pass.run(IR);
}
StringRef name() override { return PassT::name(); }
/// took care to update or preserve the analysis result in some way.
///
/// \returns true if the result is indeed invalid (the default).
- virtual bool invalidate(IRUnitT IR, const PreservedAnalyses &PA) = 0;
+ virtual bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA) = 0;
};
/// \brief SFINAE metafunction for computing whether \c ResultT provides an
char a, b;
};
- template <typename T, bool (T::*)(IRUnitT, const PreservedAnalyses &)>
+ template <typename T, bool (T::*)(IRUnitT &, const PreservedAnalyses &)>
struct Checker;
template <typename T> static SmallType f(Checker<T, &T::invalidate> *);
// FIXME: We should actually use two different concepts for analysis results
// rather than two different models, and avoid the indirect function call for
// ones that use the trivial behavior.
- bool invalidate(IRUnitT, const PreservedAnalysesT &PA) override {
+ bool invalidate(IRUnitT &, const PreservedAnalysesT &PA) override {
return !PA.preserved(PassT::ID());
}
}
/// \brief The model delegates to the \c ResultT method.
- bool invalidate(IRUnitT IR, const PreservedAnalysesT &PA) override {
+ bool invalidate(IRUnitT &IR, const PreservedAnalysesT &PA) override {
return Result.invalidate(IR, PA);
}
/// \returns A unique_ptr to the analysis result object to be queried by
/// users.
virtual std::unique_ptr<AnalysisResultConcept<IRUnitT>>
- run(IRUnitT IR, AnalysisManagerT *AM) = 0;
+ run(IRUnitT &IR, AnalysisManagerT *AM) = 0;
/// \brief Polymorphic method to access the name of a pass.
virtual StringRef name() = 0;
///
/// The return is wrapped in an \c AnalysisResultModel.
std::unique_ptr<AnalysisResultConcept<IRUnitT>>
- run(IRUnitT IR, AnalysisManagerT *AM) override {
+ run(IRUnitT &IR, AnalysisManagerT *AM) override {
return make_unique<ResultModelT>(Pass.run(IR, AM));
}
///
/// The return is wrapped in an \c AnalysisResultModel.
std::unique_ptr<AnalysisResultConcept<IRUnitT>>
- run(IRUnitT IR, AnalysisManagerT *) override {
+ run(IRUnitT &IR, AnalysisManagerT *) override {
return make_unique<ResultModelT>(Pass.run(IR));
}