[AA] Enhance the new AliasAnalysis infrastructure with an optional
[oota-llvm.git] / include / llvm / Analysis / AliasAnalysis.h
index 683b0ed690729e97a7cd5354e21152c0845a2830..781ab25b391973ffe2e5f976e99aca3e69888436 100644 (file)
@@ -1024,6 +1024,16 @@ public:
 
 FunctionPass *createAAResultsWrapperPass();
 
+/// A wrapper pass around a callback which can be used to populate the
+/// AAResults in the AAResultsWrapperPass from an external AA.
+///
+/// The callback provided here will be used each time we prepare an AAResults
+/// object, and will receive a reference to the function wrapper pass, the
+/// function, and the AAResults object to populate. This should be used when
+/// setting up a custom pass pipeline to inject a hook into the AA results.
+ImmutablePass *createExternalAAWrapperPass(
+    std::function<void(Pass &, Function &, AAResults &)> Callback);
+
 /// A helper for the legacy pass manager to create a \c AAResults
 /// object populated to the best of our ability for a particular function when
 /// inside of a \c ModulePass or a \c CallGraphSCCPass.