changeset 404:3ad8295cfac6

Mark most of the current EH implementation as x86 Linux specific.
author Christian Kamm <kamm incasoftware de>
date Sun, 27 Jul 2008 13:51:55 +0200
parents 62715be72a06
children c39813438df7
files tango/lib/compiler/llvmdc/eh.d
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tango/lib/compiler/llvmdc/eh.d	Sun Jul 27 13:29:31 2008 +0200
+++ b/tango/lib/compiler/llvmdc/eh.d	Sun Jul 27 13:51:55 2008 +0200
@@ -52,6 +52,7 @@
         int private_2;
     }
 
+version(X86) { version(linux) {
     void _Unwind_Resume(_Unwind_Exception*);
     _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception*);
     ulong _Unwind_GetLanguageSpecificData(_Unwind_Context_Ptr context);
@@ -59,6 +60,21 @@
     ulong _Unwind_SetIP(_Unwind_Context_Ptr context, ulong new_value);
     ulong _Unwind_SetGR(_Unwind_Context_Ptr context, int index, ulong new_value);
     ulong _Unwind_GetRegionStart(_Unwind_Context_Ptr context);
+} }
+else
+{
+    // runtime calls these directly
+    void _Unwind_Resume(_Unwind_Exception*)
+    {
+        console("_Unwind_Resume is not implemented on this platform.\n");
+    }
+    _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception*)
+    {
+        console("_Unwind_RaiseException is not implemented on this platform.\n");
+        return _Unwind_Reason_Code.FATAL_PHASE1_ERROR;
+    }
+}
+
 }
 
 
@@ -127,6 +143,13 @@
 //TODO: This may be the wrong way around
 char[8] _d_exception_class = "LLDCD1\0\0";
 
+
+//
+// x86 Linux specific implementation of personality function
+// and helpers
+//
+version(X86) version(linux) {
+
 // the personality routine gets called by the unwind handler and is responsible for
 // reading the EH tables and deciding what to do
 extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions, ulong exception_class, _Unwind_Exception* exception_info, _Unwind_Context_Ptr context)
@@ -306,6 +329,9 @@
   callsite = data;
 }
 
+} // end of x86 Linux specific implementation
+
+
 extern(C) void _d_throw_exception(Object e)
 {
     if (e !is null)