53 #ifndef LLVM_IR_PASSINSTRUMENTATION_H 54 #define LLVM_IR_PASSINSTRUMENTATION_H 60 #include <type_traits> 64 class PreservedAnalyses;
99 template <
typename CallableT>
101 AfterPassInvalidatedCallbacks.
emplace_back(std::move(C));
104 template <
typename CallableT>
109 template <
typename CallableT>
120 AfterPassInvalidatedCallbacks;
122 BeforeAnalysisCallbacks;
124 AfterAnalysisCallbacks;
143 template <
typename IRUnitT,
typename PassT>
148 bool ShouldRun =
true;
149 for (
auto &
C : Callbacks->BeforePassCallbacks)
157 template <
typename IRUnitT,
typename PassT>
160 for (
auto &
C : Callbacks->AfterPassCallbacks)
167 template <
typename IRUnitT,
typename PassT>
170 for (
auto &
C : Callbacks->AfterPassInvalidatedCallbacks)
176 template <
typename IRUnitT,
typename PassT>
179 for (
auto &
C : Callbacks->BeforeAnalysisCallbacks)
185 template <
typename IRUnitT,
typename PassT>
188 for (
auto &
C : Callbacks->AfterAnalysisCallbacks)
197 template <
typename IRUnitT,
typename... ExtraArgsT>
Pass interface - Implemented by all 'passes'.
reference emplace_back(ArgTypes &&... Args)
void registerAfterAnalysisCallback(CallableT C)
This class represents lattice values for constants.
void operator=(const PassInstrumentationCallbacks &)=delete
PassInstrumentation(PassInstrumentationCallbacks *CB=nullptr)
Callbacks object is not owned by PassInstrumentation, its life-time should at least match the life-ti...
void(StringRef, Any) BeforeAnalysisFunc
void(StringRef, Any) AfterAnalysisFunc
bool runBeforePass(const PassT &Pass, const IRUnitT &IR) const
BeforePass instrumentation point - takes Pass instance to be executed and constant reference to IR it...
bool invalidate(IRUnitT &, const class llvm::PreservedAnalyses &, ExtraArgsT...)
Handle invalidation from the pass manager when PassInstrumentation is used as the result of PassInstr...
void(StringRef, Any) AfterPassFunc
A set of analyses that are preserved following a run of a transformation pass.
void registerBeforeAnalysisCallback(CallableT C)
void registerBeforePassCallback(CallableT C)
void(StringRef) AfterPassInvalidatedFunc
void runAfterPass(const PassT &Pass, const IRUnitT &IR) const
AfterPass instrumentation point - takes Pass instance that has just been executed and constant refere...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void runAfterPassInvalidated(const PassT &Pass) const
AfterPassInvalidated instrumentation point - takes Pass instance that has just been executed...
void registerAfterPassInvalidatedCallback(CallableT C)
void runBeforeAnalysis(const PassT &Analysis, const IRUnitT &IR) const
BeforeAnalysis instrumentation point - takes Analysis instance to be executed and constant reference ...
void registerAfterPassCallback(CallableT C)
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
StringRef - Represent a constant reference to a string, i.e.
This class provides instrumentation entry points for the Pass Manager, doing calls to callbacks regis...
bool(StringRef, Any) BeforePassFunc
Statically lint checks LLVM IR
PassInstrumentationCallbacks()
void runAfterAnalysis(const PassT &Analysis, const IRUnitT &IR) const
AfterAnalysis instrumentation point - takes Analysis instance that has just been executed and constan...