2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / libgo / runtime / go-defer.h
blobacf2d40c69c2c16564d8d6b869b99b0b6fc7873b
1 /* go-defer.h -- the defer stack.
3 Copyright 2010 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 struct __go_panic_stack;
9 /* The defer stack is a list of these structures. */
11 struct __go_defer_stack
13 /* The next entry in the stack. */
14 struct __go_defer_stack *__next;
16 /* The stack variable for the function which called this defer
17 statement. This is set to 1 if we are returning from that
18 function, 0 if we are panicing through it. */
19 _Bool *__frame;
21 /* The value of the panic stack when this function is deferred.
22 This function can not recover this value from the panic stack.
23 This can happen if a deferred function has a defer statement
24 itself. */
25 struct __go_panic_stack *__panic;
27 /* The function to call. */
28 void (*__pfn) (void *);
30 /* The argument to pass to the function. */
31 void *__arg;
33 /* The return address that a recover thunk matches against. This is
34 set by __go_set_defer_retaddr which is called by the thunks
35 created by defer statements. */
36 const void *__retaddr;
38 /* Set to true if a function created by reflect.MakeFunc is
39 permitted to recover. The return address of such a function
40 function will be somewhere in libffi, so __retaddr is not
41 useful. */
42 _Bool __makefunc_can_recover;
44 /* Set to true if this defer stack entry is not part of the defer
45 pool. */
46 _Bool __special;