majnemer added inline comments.

================
Comment at: lib/CodeGen/CGException.cpp:1164
+      CurrentFuncletPad);
+  llvm::BasicBlock *CatchStartBlock = nullptr;
+  if (EHPersonality::get(*this).isWasmPersonality()) {
----------------
Maybe this should be called WasmCatchStartBlock?


================
Comment at: lib/CodeGen/CGException.cpp:1173
+        cast<llvm::CatchPadInst>(CatchStartBlock->getFirstNonPHI());
+    CurrentFuncletPad = CPI;
+  }
----------------
Hmm, why is this done? Won't RestoreCurrentFuncletPad undo this?


================
Comment at: lib/CodeGen/CGException.cpp:1241-1245
+    while (llvm::TerminatorInst *TI = RethrowBlock->getTerminator()) {
+      llvm::BranchInst *BI = cast<llvm::BranchInst>(TI);
+      assert(BI->isConditional());
+      RethrowBlock = BI->getSuccessor(1);
+    }
----------------
This seems pretty fragile, why is this guaranteed to work? Could we maintain a 
map from CatchSwitchInst to catch-all block?


Repository:
  rC Clang

https://reviews.llvm.org/D44931



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to