[PATCH] D15139: [IR] Reformulate LLVM's EH funclet IR

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 15:27:30 PST 2015


andrew.w.kaylor added inline comments.

================
Comment at: docs/LangRef.rst:8579
@@ -8718,3 +8578,3 @@
 
       <resultval> = cleanuppad [<args>*]
 
----------------
This syntax is out-of-date.

================
Comment at: lib/Analysis/EHPersonalities.cpp:12
@@ -11,1 +11,3 @@
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/IR/CFG.h"
+#include "llvm/IR/Constants.h"
----------------
Is this still needed?

================
Comment at: lib/Analysis/EHPersonalities.cpp:54
@@ +53,3 @@
+  // For any block B, the "colors" of B are the set of funclets F (possibly
+  // including a root "funclet" representing the main function), such that
+  // F will need to directly contain B or a copy of B (where the term "directly
----------------
Are there circumstances where the colors don't include the root funclet?

================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:102
@@ -103,2 +101,3 @@
     } else if (auto *TPI = dyn_cast<TerminatePadInst>(IP)) {
       IP = TPI->getUnwindDest()->getFirstNonPHI()->getIterator();
+    } else if (isa<CatchSwitchInst>(IP)) {
----------------
This will crash if the terminatepad unwinds to caller.

================
Comment at: lib/AsmParser/LLParser.cpp:2371
@@ -2402,20 +2370,3 @@
   if (Val) {
     // Check operator constraint.
     if (Val->getType() == Ty) return Val;
----------------
This comment should have been deleted.

================
Comment at: lib/AsmParser/LLParser.cpp:5189
@@ -5273,4 +5188,3 @@
   BasicBlock *UnwindBB = nullptr;
-  if (Lex.getKind() == lltok::kw_to) {
-    Lex.Lex();
-    if (ParseToken(lltok::kw_caller, "expected 'caller' in terminatepad"))
+  if (EatIfPresent(lltok::kw_to)) {
+    if (ParseToken(lltok::kw_caller, "expected 'caller' in catchswitch"))
----------------
Just out of curiosity, is there a reason we can't allow "to label %<unwind>"?  It's an easy error to make when hand-editing IR.

================
Comment at: lib/AsmParser/LLParser.cpp:5206
@@ +5205,3 @@
+/// ParseCatchPad
+///   ::= 'catchpad' ParamList 'to' TypeAndValue 'unwind' TypeAndValue
+bool LLParser::ParseCatchPad(Instruction *&Inst, PerFunctionState &PFS) {
----------------
/// := catchpad within <catchswitch> [<args>*]


http://reviews.llvm.org/D15139





More information about the llvm-commits mailing list