[llvm-commits] [llvm] r132283 - /llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp

Charles Davis cdavis at mines.edu
Sat May 28 21:28:35 PDT 2011


Author: cdavis
Date: Sat May 28 23:28:35 2011
New Revision: 132283

URL: http://llvm.org/viewvc/llvm-project?rev=132283&view=rev
Log:
When generating against the Win64 EH scheme, set the handler to the GCC-specific
handler.

At this moment, only GCC-style exceptions are supported. Other kinds
of exceptions, including "traditional" SEH and Microsoft Visual C++ exceptions,
need more work--and an compiler exception model that isn't specific to
GCC-style exceptions!

In particular, I imagine that it would be possible to mix "traditional" SEH
with GCC-style EH or Microsoft C++ EH. Currently LLVM has no way (beyond some
target-specific defaults and whole-module compiler switches) of knowing which
scheme to use when.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp?rev=132283&r1=132282&r2=132283&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/Win64Exception.cpp Sat May 28 23:28:35 2011
@@ -76,6 +76,13 @@
     return;
 
   Asm->OutStreamer.EmitWin64EHStartProc(Asm->CurrentFnSym);
+
+  if (!shouldEmitPersonality)
+    return;
+
+  MCSymbol *GCCHandlerSym =
+    Asm->GetExternalSymbolSymbol("_GCC_specific_handler");
+  Asm->OutStreamer.EmitWin64EHHandler(GCCHandlerSym, true, true);
 }
 
 /// EndFunction - Gather and emit post-function exception information.





More information about the llvm-commits mailing list