source: src/libcfa/exception.h @ b826e6b

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since b826e6b was 38ac6ec, checked in by Andrew Beach <ajbeach@…>, 7 years ago

Fixed some names that had drifted from terminate/resume.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// exception.h -- Builtins for exception handling.
8//
9// Author           : Andrew Beach
10// Created On       : Mon Jun 26 15:11:00 2017
11// Last Modified By : Andrew Beach
12// Last Modified On : Tus Jul 11 16:31:00 2017
13// Update Count     : 2
14//
15
16#ifndef EXCEPTION_H
17#define EXCEPTION_H
18
19
20// Later to be a special structure type.
21typedef int exception;
22
23#ifdef __CFORALL__
24extern "C" {
25#endif
26
27// Used in throw statement translation.
28void __cfaehm__throw_terminate(exception * except) __attribute__((noreturn));
29void __cfaehm__rethrow_terminate() __attribute__((noreturn));
30void __cfaehm__throw_resume(exception * except);
31
32// Function catches termination exceptions.
33void __cfaehm__try_terminate(
34    void (*try_block)(),
35    void (*catch_block)(int index, exception * except),
36    int (*match_block)(exception * except));
37
38// Data structure creates a list of resume handlers.
39struct __cfaehm__try_resume_node {
40    struct __cfaehm__try_resume_node * next;
41    int (*handler)(exception * except);
42};
43
44void __cfaehm__try_resume_setup(
45    struct __cfaehm__try_resume_node * node,
46    int (*handler)(exception * except));
47void __cfaehm__try_resume_cleanup(
48    struct __cfaehm__try_resume_node * node);
49
50// Check for a standard way to call fake deconstructors.
51struct __cfaehm__cleanup_hook {
52};
53
54#ifdef __CFORALL__
55}
56#endif
57
58#endif //EXCEPTION_H
Note: See TracBrowser for help on using the repository browser.