================
@@ -34,23 +37,52 @@ 
INITIALIZE_PASS_DEPENDENCY(MachineDominanceFrontierWrapperPass)
 INITIALIZE_PASS_END(WebAssemblyExceptionInfoWrapperPass, DEBUG_TYPE,
                     "WebAssembly Exception Information", true, true)
 
-bool WebAssemblyExceptionInfoWrapperPass::runOnMachineFunction(
-    MachineFunction &MF) {
+static void computeWEI(WebAssemblyExceptionInfo &WEI, MachineFunction &MF,
+                       function_ref<MachineDominatorTree &()> GetMDT,
+                       function_ref<MachineDominanceFrontier &()> GetMDF) {
   LLVM_DEBUG(dbgs() << "********** Exception Info Calculation **********\n"
                        "********** Function: "
                     << MF.getName() << '\n');
-  releaseMemory();
   if (MF.getTarget().getMCAsmInfo().getExceptionHandlingType() !=
           ExceptionHandling::Wasm ||
       !MF.getFunction().hasPersonalityFn())
-    return false;
-  auto &MDT = getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
-  auto &MDF = getAnalysis<MachineDominanceFrontierWrapperPass>().getMDF();
-  WasmExceptionInfo.recalculate(MF, MDT, MDF);
-  LLVM_DEBUG(dump());
+    return;
+  MachineDominatorTree &MDT = GetMDT();
+  MachineDominanceFrontier &MDF = GetMDF();
+  WEI.recalculate(MF, MDT, MDF);
+}
+
+bool WebAssemblyExceptionInfoWrapperPass::runOnMachineFunction(
+    MachineFunction &MF) {
+  releaseMemory();
----------------
boomanaiden154 wrote:

We don't need to. We construct a fresh analysis results inside of 
`WebAssemblyExceptionAnalysis::run`.

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

Reply via email to