[llvm] r342325 - [NFC] minor cleanup in PassManagerInternal.h
Fedor Sergeev via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 15 07:56:12 PDT 2018
Author: fedor.sergeev
Date: Sat Sep 15 07:56:12 2018
New Revision: 342325
URL: http://llvm.org/viewvc/llvm-project?rev=342325&view=rev
Log:
[NFC] minor cleanup in PassManagerInternal.h
A few changes found necessary for upcoming PassInstrumentation patch:
- name() methods made const
- properly forward arguments in AnalysisPassModel::run
Separated out of the main D47858 patch.
Modified:
llvm/trunk/include/llvm/IR/PassManagerInternal.h
Modified: llvm/trunk/include/llvm/IR/PassManagerInternal.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManagerInternal.h?rev=342325&r1=342324&r2=342325&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManagerInternal.h (original)
+++ llvm/trunk/include/llvm/IR/PassManagerInternal.h Sat Sep 15 07:56:12 2018
@@ -48,7 +48,7 @@ struct PassConcept {
ExtraArgTs... ExtraArgs) = 0;
/// Polymorphic method to access the name of a pass.
- virtual StringRef name() = 0;
+ virtual StringRef name() const = 0;
};
/// A template wrapper used to implement the polymorphic API.
@@ -80,7 +80,7 @@ struct PassModel : PassConcept<IRUnitT,
return Pass.run(IR, AM, ExtraArgs...);
}
- StringRef name() override { return PassT::name(); }
+ StringRef name() const override { return PassT::name(); }
PassT Pass;
};
@@ -250,7 +250,7 @@ struct AnalysisPassConcept {
ExtraArgTs... ExtraArgs) = 0;
/// Polymorphic method to access the name of a pass.
- virtual StringRef name() = 0;
+ virtual StringRef name() const = 0;
};
/// Wrapper to model the analysis pass concept.
@@ -290,13 +290,14 @@ struct AnalysisPassModel : AnalysisPassC
AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT>>
run(IRUnitT &IR, AnalysisManager<IRUnitT, ExtraArgTs...> &AM,
ExtraArgTs... ExtraArgs) override {
- return llvm::make_unique<ResultModelT>(Pass.run(IR, AM, ExtraArgs...));
+ return llvm::make_unique<ResultModelT>(
+ Pass.run(IR, AM, std::forward<ExtraArgTs>(ExtraArgs)...));
}
/// The model delegates to a static \c PassT::name method.
///
/// The returned string ref must point to constant immutable data!
- StringRef name() override { return PassT::name(); }
+ StringRef name() const override { return PassT::name(); }
PassT Pass;
};
More information about the llvm-commits
mailing list