================
@@ -1859,3 +1868,24 @@ void 
WebAssemblyLowerEmscriptenEHSjLj::handleLongjmpableCallsForWasmSjLj(
     }
   }
 }
+
+bool WebAssemblyLowerEmscriptenEHSjLjLegacy::runOnModule(Module &M) {
+  WebAssemblyLowerEmscriptenEHSjLjImpl Impl(
+      [&](Function &F) -> DominatorTree & {
+        return getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
+      });
+  return Impl.runOnModule(M);
+}
+
+PreservedAnalyses
+WebAssemblyLowerEmscriptenEHSjLjPass::run(Module &M,
+                                          ModuleAnalysisManager &MAM) {
+  WebAssemblyLowerEmscriptenEHSjLjImpl Impl(
+      [&](Function &F) -> DominatorTree & {
+        return MAM.getResult<FunctionAnalysisManagerModuleProxy>(M)
+            .getManager()
+            .getResult<DominatorTreeAnalysis>(F);
----------------
boomanaiden154 wrote:

You only need to go through this to get a module analysis from a 
Function/MachineFunction pass and vice versa. In the normal case where we need 
something like a DominatorTree in a function pass, it becomes 
`FAM.getResult<DominatorTreeAnalysis>(F)`.

The explicit nesting here is an intentional part of the design and helps to 
enforce things like F/MF passes only being able to request cached module 
analyses.

https://github.com/llvm/llvm-project/pull/209040
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to