[PATCH] CodeGen support for x86_64 SEH catch handlers in LLVM

David Majnemer david.majnemer at gmail.com
Mon Dec 29 16:29:51 PST 2014


================
Comment at: lib/CodeGen/AsmPrinter/EHStreamer.cpp:587
@@ -588,1 +586,3 @@
+                                      S.LPad->LandingPadLabel->getName());
+        Asm->EmitLabelDifference(S.LPad->LandingPadLabel, EHFuncBeginSym, 4);
       }
----------------
Huh, I never knew we had a 32-bit size limit on Itanium...

================
Comment at: lib/CodeGen/AsmPrinter/EHStreamer.h:68
@@ -65,3 +67,3 @@
 
-    // The landing pad starts at PadLabel.
-    MCSymbol *PadLabel;   // zero indicates that there is no landing pad.
+    // LPad contains the landing pad start labels. There may be more than one.
+    const LandingPadInfo *LPad;  // zero indicates that there is no landing pad.
----------------
> There may be more than one.

This seems superfluous.

================
Comment at: lib/CodeGen/AsmPrinter/EHStreamer.h:69
@@ -68,1 +68,3 @@
+    // LPad contains the landing pad start labels. There may be more than one.
+    const LandingPadInfo *LPad;  // zero indicates that there is no landing pad.
     unsigned Action;
----------------
s/zero/null/ ?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:113
@@ +112,3 @@
+      else
+        report_fatal_error("unexpected personality function");
+    } else {
----------------
It would probably be nice to twine the unexpected personality function's name.

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:130
@@ +129,3 @@
+/// handler lives in the x64 Microsoft C runtime and allows catching or cleaning
+/// up after faults with __try, __except, and __finally.  The typeinfo values
+/// are not really RTTI data, but pointers to filter functions that return an
----------------
s/typeinfo/typeid/ ?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:143
@@ +142,3 @@
+///     Continue searching this table or continue unwinding.
+///   EXCEPTION_CONTINUE_EXECUTION (1):
+///     Resume execution at the trapping PC.
----------------
This should be -1, no?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:188
@@ +187,3 @@
+    for (int TypeID : CSE.LPad->TypeIds)
+      if (TypeID >= 0)
+        ++NumEntries;
----------------
What special purpose does zero have here?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:230-231
@@ +229,4 @@
+      MCSymbol *ClauseLabel = LPad->ClauseLabels[I];
+      assert(TypeID >= 0 && "SEH personality functions don't support filter "
+                            "clauses in landing pads");
+
----------------
Is this an IR invariant?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:235
@@ +234,3 @@
+      Asm->OutStreamer.EmitValue(End, 4);
+      if (TypeID == 0)
+        Asm->OutStreamer.EmitIntValue(0, 4);
----------------
What special purpose does zero have here?

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.h:19
@@ -18,1 +18,3 @@
 
+#include <vector>
+
----------------
Is there a reason behind this change?

http://reviews.llvm.org/D6300

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list