[PATCH] D44134: [WebAssembly] Add WebAssemblyException information analysis

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 20 22:22:06 PDT 2018


majnemer added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp:79-90
+  for (auto &MI : *MBB) {
+    if (MI.getOpcode() == WebAssembly::CATCH_ALL) {
+      SeenCatchAll = true;
+      continue;
+    }
+    if (SeenCatchAll && MI.isCall()) {
+      const MachineOperand &CalleeOp = MI.getOperand(0);
----------------
aheejin wrote:
> majnemer wrote:
> > Is it not possible for the MBB to branch to block which then calls std::terminate?
> Hmm, good point... I assumed a terminatepad would be always a single BB but it may not hold. Do you think I should DFS all descendants from here?
We handled problems like this one by using getFuncletMembership on the MachineFunction. This does a DFS to let you know which MBBs are part of which catch scopes. I think I'd find a way to reuse it for this.


Repository:
  rL LLVM

https://reviews.llvm.org/D44134





More information about the llvm-commits mailing list