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

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 20 12:00:24 PDT 2018


majnemer added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp:60-72
+  for (auto &MI : *MBB) {
+    if (MI.getOpcode() == WebAssembly::CATCH_I32 ||
+        MI.getOpcode() == WebAssembly::CATCH_I64) {
+      SeenCatch = true;
+      continue;
+    }
+    if (SeenCatch && MI.isCall()) {
----------------
Similar concern here.


================
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);
----------------
Is it not possible for the MBB to branch to block which then calls std::terminate?


================
Comment at: lib/Target/WebAssembly/WebAssemblyExceptionInfo.h:38-39
+  ~WebAssemblyException() {
+    for (size_t I = 0, E = SubExceptions.size(); I != E; ++I)
+      delete SubExceptions[I];
+  }
----------------
DeleteContainerPointers(SubExceptions);

Even better would be to use a std::vector<unique_ptr<WebAssemblyException>>


Repository:
  rL LLVM

https://reviews.llvm.org/D44134





More information about the llvm-commits mailing list