* function.c (expand_function_end): If current_function_calls_alloca,
[official-gcc.git] / gcc / unwind-compat.c
blob26f45ac8e576e88d8caecd2e1b4d39f73e9dd635
1 /* Backward compatibility unwind routines.
2 Copyright (C) 2004
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 In addition to the permissions in the GNU General Public License, the
13 Free Software Foundation gives you unlimited permission to link the
14 compiled version of this file into combinations with other programs,
15 and to distribute those combinations without any restriction coming
16 from the use of this file. (The General Public License restrictions
17 do apply in other respects; for example, they cover modification of
18 the file, and distribution when not linked into a combined
19 executable.)
21 GCC is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
24 License for more details.
26 You should have received a copy of the GNU General Public License
27 along with GCC; see the file COPYING. If not, write to the Free
28 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
29 02111-1307, USA. */
31 #if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
32 #include "unwind.h"
33 #include "unwind-dw2-fde.h"
34 #include "unwind-compat.h"
36 extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
37 (_Unwind_Trace_Fn, void *);
39 _Unwind_Reason_Code
40 _Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument)
42 return __libunwind_Unwind_Backtrace (trace, trace_argument);
44 symver (_Unwind_Backtrace, GCC_3.3);
46 extern void __libunwind_Unwind_DeleteException
47 (struct _Unwind_Exception *);
49 void
50 _Unwind_DeleteException (struct _Unwind_Exception *exc)
52 return __libunwind_Unwind_DeleteException (exc);
54 symver (_Unwind_DeleteException, GCC_3.0);
56 extern void * __libunwind_Unwind_FindEnclosingFunction (void *);
58 void *
59 _Unwind_FindEnclosingFunction (void *pc)
61 return __libunwind_Unwind_FindEnclosingFunction (pc);
63 symver (_Unwind_FindEnclosingFunction, GCC_3.3);
65 extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind
66 (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
68 _Unwind_Reason_Code
69 _Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
70 _Unwind_Stop_Fn stop, void * stop_argument)
72 return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument);
74 symver (_Unwind_ForcedUnwind, GCC_3.0);
76 extern _Unwind_Word __libunwind_Unwind_GetCFA
77 (struct _Unwind_Context *);
79 _Unwind_Word
80 _Unwind_GetCFA (struct _Unwind_Context *context)
82 return __libunwind_Unwind_GetCFA (context);
84 symver (_Unwind_GetCFA, GCC_3.3);
86 #ifdef __ia64__
87 extern _Unwind_Word __libunwind_Unwind_GetBSP
88 (struct _Unwind_Context *);
90 _Unwind_Word
91 _Unwind_GetBSP (struct _Unwind_Context * context)
93 return __libunwind_Unwind_GetBSP (context);
95 symver (_Unwind_GetBSP, GCC_3.3.2);
96 #else
97 extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase
98 (struct _Unwind_Context *);
100 _Unwind_Ptr
101 _Unwind_GetDataRelBase (struct _Unwind_Context *context)
103 return __libunwind_Unwind_GetDataRelBase (context);
105 symver (_Unwind_GetDataRelBase, GCC_3.0);
107 extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase
108 (struct _Unwind_Context *);
110 _Unwind_Ptr
111 _Unwind_GetTextRelBase (struct _Unwind_Context *context)
113 return __libunwind_Unwind_GetTextRelBase (context);
115 symver (_Unwind_GetTextRelBase, GCC_3.0);
116 #endif
118 extern _Unwind_Word __libunwind_Unwind_GetGR
119 (struct _Unwind_Context *, int );
121 _Unwind_Word
122 _Unwind_GetGR (struct _Unwind_Context *context, int index)
124 return __libunwind_Unwind_GetGR (context, index);
126 symver (_Unwind_GetGR, GCC_3.0);
128 extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
130 _Unwind_Ptr
131 _Unwind_GetIP (struct _Unwind_Context *context)
133 return __libunwind_Unwind_GetIP (context);
135 symver (_Unwind_GetIP, GCC_3.0);
137 extern void *__libunwind_Unwind_GetLanguageSpecificData
138 (struct _Unwind_Context *);
140 void *
141 _Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
143 return __libunwind_Unwind_GetLanguageSpecificData (context);
145 symver (_Unwind_GetLanguageSpecificData, GCC_3.0);
147 extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart
148 (struct _Unwind_Context *);
150 _Unwind_Ptr
151 _Unwind_GetRegionStart (struct _Unwind_Context *context)
153 return __libunwind_Unwind_GetRegionStart (context);
155 symver (_Unwind_GetRegionStart, GCC_3.0);
157 extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException
158 (struct _Unwind_Exception *);
160 _Unwind_Reason_Code
161 _Unwind_RaiseException(struct _Unwind_Exception *exc)
163 return __libunwind_Unwind_RaiseException (exc);
165 symver (_Unwind_RaiseException, GCC_3.0);
167 extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *);
169 void
170 _Unwind_Resume (struct _Unwind_Exception *exc)
172 __libunwind_Unwind_Resume (exc);
174 symver (_Unwind_Resume, GCC_3.0);
176 extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow
177 (struct _Unwind_Exception *);
179 _Unwind_Reason_Code
180 _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
182 return __libunwind_Unwind_Resume_or_Rethrow (exc);
184 symver (_Unwind_Resume_or_Rethrow, GCC_3.3);
186 extern void __libunwind_Unwind_SetGR
187 (struct _Unwind_Context *, int, _Unwind_Word);
189 void
190 _Unwind_SetGR (struct _Unwind_Context *context, int index,
191 _Unwind_Word val)
193 __libunwind_Unwind_SetGR (context, index, val);
195 symver (_Unwind_SetGR, GCC_3.0);
197 extern void __libunwind_Unwind_SetIP
198 (struct _Unwind_Context *, _Unwind_Ptr);
200 void
201 _Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
203 return __libunwind_Unwind_SetIP (context, val);
205 symver (_Unwind_SetIP, GCC_3.0);
206 #endif