2222module gcc.unwind.generic ;
2323
2424private import gcc.builtins;
25- private import core.stdc.stdlib ; // for abort
2625
2726/* This is derived from the C++ ABI for IA-64. Where we diverge
2827 for cross-architecture compatibility are noted with "@@@". */
2928
30- extern (C ):
29+ extern (C ):
3130
3231/* Level 1: Base ABI */
3332
3433/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
3534 inefficient for 32-bit and smaller machines. */
3635alias _Unwind_Word = __builtin_unwind_uint;
3736alias _Unwind_Sword = __builtin_unwind_int;
38- version (IA64 )
37+ version (IA64 )
3938{
40- version (HPUX)
39+ version (HPUX)
4140 alias _Unwind_Ptr = __builtin_machine_uint;
4241 else
4342 alias _Unwind_Ptr = __builtin_pointer_uint;
@@ -110,55 +109,55 @@ enum
110109struct _Unwind_Context ;
111110
112111/* Raise an exception, passing along the given exception object. */
113- _Unwind_Reason_Code _Unwind_RaiseException (_Unwind_Exception * );
112+ _Unwind_Reason_Code _Unwind_RaiseException (_Unwind_Exception * );
114113
115114/* Raise an exception for forced unwinding. */
116115
117116extern (C ) alias _Unwind_Stop_Fn
118- = _Unwind_Reason_Code function (int , _Unwind_Action,
119- _Unwind_Exception_Class,
120- _Unwind_Exception * ,
121- _Unwind_Context * , void * );
117+ = _Unwind_Reason_Code function (int , _Unwind_Action,
118+ _Unwind_Exception_Class,
119+ _Unwind_Exception * ,
120+ _Unwind_Context * , void * );
122121
123- _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Exception * , _Unwind_Stop_Fn, void * );
122+ _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Exception * , _Unwind_Stop_Fn, void * );
124123
125124/* Helper to invoke the exception_cleanup routine. */
126- void _Unwind_DeleteException (_Unwind_Exception * );
125+ void _Unwind_DeleteException (_Unwind_Exception * );
127126
128127/* Resume propagation of an existing exception. This is used after
129128 e.g. executing cleanup code, and not to implement rethrowing. */
130- void _Unwind_Resume (_Unwind_Exception * );
129+ void _Unwind_Resume (_Unwind_Exception * );
131130
132131/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow
133132 a normal exception that was handled. */
134- _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Exception * );
133+ _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Exception * );
135134
136135/* @@@ Use unwind data to perform a stack backtrace. The trace callback
137136 is called for every stack frame in the call chain, but no cleanup
138137 actions are performed. */
139138extern (C ) alias _Unwind_Trace_Fn
140- = _Unwind_Reason_Code function (_Unwind_Context * , void * );
139+ = _Unwind_Reason_Code function (_Unwind_Context * , void * );
141140
142- _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void * );
141+ _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void * );
143142
144143/* These functions are used for communicating information about the unwind
145144 context (i.e. the unwind descriptors and the user register state) between
146145 the unwind library and the personality routine and landing pad. Only
147146 selected registers may be manipulated. */
148147
149- _Unwind_Word _Unwind_GetGR (_Unwind_Context * , int );
150- void _Unwind_SetGR (_Unwind_Context * , int , _Unwind_Word);
148+ _Unwind_Word _Unwind_GetGR (_Unwind_Context * , int );
149+ void _Unwind_SetGR (_Unwind_Context * , int , _Unwind_Word);
151150
152- _Unwind_Ptr _Unwind_GetIP (_Unwind_Context * );
153- _Unwind_Ptr _Unwind_GetIPInfo (_Unwind_Context * , int * );
154- void _Unwind_SetIP (_Unwind_Context * , _Unwind_Ptr);
151+ _Unwind_Ptr _Unwind_GetIP (_Unwind_Context * );
152+ _Unwind_Ptr _Unwind_GetIPInfo (_Unwind_Context * , int * );
153+ void _Unwind_SetIP (_Unwind_Context * , _Unwind_Ptr);
155154
156155/* @@@ Retrieve the CFA of the given context. */
157- _Unwind_Word _Unwind_GetCFA (_Unwind_Context * );
156+ _Unwind_Word _Unwind_GetCFA (_Unwind_Context * );
158157
159- void * _Unwind_GetLanguageSpecificData (_Unwind_Context * );
158+ void * _Unwind_GetLanguageSpecificData(_Unwind_Context * );
160159
161- _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context * );
160+ _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context * );
162161
163162
164163/* The personality routine is the function in the C++ (or other language)
@@ -176,55 +175,55 @@ _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
176175 lack of code to handle the different data format. */
177176
178177extern (C ) alias _Unwind_Personality_Fn
179- = _Unwind_Reason_Code function (int , _Unwind_Action,
180- _Unwind_Exception_Class,
181- _Unwind_Exception * ,
182- _Unwind_Context * );
178+ = _Unwind_Reason_Code function (int , _Unwind_Action,
179+ _Unwind_Exception_Class,
180+ _Unwind_Exception * ,
181+ _Unwind_Context * );
183182
184183/* @@@ The following alternate entry points are for setjmp/longjmp
185184 based unwinding. */
186185
187186struct SjLj_Function_Context ;
188- extern void _Unwind_SjLj_Register (SjLj_Function_Context * );
189- extern void _Unwind_SjLj_Unregister (SjLj_Function_Context * );
187+ extern void _Unwind_SjLj_Register(SjLj_Function_Context * );
188+ extern void _Unwind_SjLj_Unregister(SjLj_Function_Context * );
190189
191- _Unwind_Reason_Code _Unwind_SjLj_RaiseException (_Unwind_Exception * );
192- _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind (_Unwind_Exception * , _Unwind_Stop_Fn, void * );
193- void _Unwind_SjLj_Resume (_Unwind_Exception * );
194- _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (_Unwind_Exception * );
190+ _Unwind_Reason_Code _Unwind_SjLj_RaiseException (_Unwind_Exception * );
191+ _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind (_Unwind_Exception * , _Unwind_Stop_Fn, void * );
192+ void _Unwind_SjLj_Resume (_Unwind_Exception * );
193+ _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (_Unwind_Exception * );
195194
196195/* @@@ The following provide access to the base addresses for text
197196 and data-relative addressing in the LDSA. In order to stay link
198197 compatible with the standard ABI for IA-64, we inline these. */
199198
200- version (IA64 )
199+ version (IA64 )
201200{
202201 _Unwind_Ptr
203- _Unwind_GetDataRelBase (_Unwind_Context * _C)
202+ _Unwind_GetDataRelBase(_Unwind_Context * _C)
204203 {
205204 /* The GP is stored in R1. */
206- return _Unwind_GetGR (_C, 1 );
205+ return _Unwind_GetGR (_C, 1 );
207206 }
208207
209208 _Unwind_Ptr
210- _Unwind_GetTextRelBase (_Unwind_Context * )
209+ _Unwind_GetTextRelBase(_Unwind_Context * )
211210 {
212- abort ();
211+ __builtin_trap ();
213212 return 0 ;
214213 }
215214
216215 /* @@@ Retrieve the Backing Store Pointer of the given context. */
217- _Unwind_Word _Unwind_GetBSP (_Unwind_Context * );
216+ _Unwind_Word _Unwind_GetBSP (_Unwind_Context * );
218217}
219218else
220219{
221- _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context * );
222- _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context * );
220+ _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context * );
221+ _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context * );
223222}
224223
225224/* @@@ Given an address, return the entry point of the function that
226225 contains it. */
227- extern void * _Unwind_FindEnclosingFunction (void * pc);
226+ extern void * _Unwind_FindEnclosingFunction(void * pc);
228227
229228
230229/* leb128 type numbers have a potentially unlimited size.
@@ -247,6 +246,6 @@ else static if (long.sizeof >= (void*).sizeof)
247246}
248247else
249248{
250- static assert (0 , " What type shall we use for _sleb128_t?" );
249+ static assert (0 , " What type shall we use for _sleb128_t?" );
251250}
252251
0 commit comments