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

Andy Kaylor andrew.kaylor at intel.com
Tue Nov 18 18:25:09 PST 2014


================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:159
@@ +158,3 @@
+
+  // Compute call site entries as we would for DWARF, but with a fake actions
+  // table.
----------------
rnk wrote:
> andrew.w.kaylor wrote:
> > Could you clarify what "as we would for DWARF" means?  This comment doesn't really tell me what's happening here.
> I guess I meant "as we would for the Itanium LSDA" instead. This comment predated my attempt to separate DWARF CFI from the Itanium LSDA. Previously those concepts were conflated.
Yeah, I understood that much.  I just didn't know what it's actually doing.  The comment doesn't seem to tell me anything that the name of the computeCallSiteTable function tells me.

This is computing the LabelStart and LabelEnd values for the table, right?  Then whatever is going into FirstActions is ignored? I guess maybe the comment just confused me more than it helped.

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:215
@@ +214,3 @@
+      MCSymbol *ClauseLabel = LPad->ClauseLabels[I];
+      assert(TypeID >= 0 && "SEH personality functions don't support filters");
+
----------------
rnk wrote:
> andrew.w.kaylor wrote:
> > The existing naming is a bit unfortunate.  I take it this is referring to landingpad type filters, not SEH filters.  At least in the Windows-specific code perhaps we can use a term like "type filters."
> How about "filter clauses in landing pads"?
Yeah, that's clear.

================
Comment at: lib/CodeGen/AsmPrinter/Win64Exception.cpp:226
@@ +225,3 @@
+          Asm->OutStreamer.EmitValue(createImageRel32(Asm->getSymbol(TI)), 4);
+        else // catch i8* null
+          Asm->OutStreamer.EmitIntValue(0, 4);
----------------
rnk wrote:
> andrew.w.kaylor wrote:
> > Are there two different ways to specify a __finally handler?
> "catch i8* null" is a catch-all handler, not a `__finally` handler. The difference is that unwinding will continue through `__finally`, but catch-all handles the exception.
It looks like the same information is being written to the table in either case.  How does that work?

http://reviews.llvm.org/D6300






More information about the llvm-commits mailing list