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

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 20 22:23:41 PDT 2018


aheejin 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);
----------------
majnemer wrote:
> 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.
Hmm, no, I guess I shouldn't.. doing DFS from all catchpads or cleanuppads sounds like unnecessarily expensive. Should I search for a function call to `__clang_call_terminate` and search upward from there..?


Repository:
  rL LLVM

https://reviews.llvm.org/D44134





More information about the llvm-commits mailing list