source: src/libcfa/exception.h@ 39fea2f

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 39fea2f was c315863, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

Fix warning in base exception vtable

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[fa4805f]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
[86d5ba7c]11// Last Modified By : Andrew Beach
[e9145a3]12// Last Modified On : Thr Aug 17 15:44:00 2017
13// Update Count : 6
[fa4805f]14//
15
[6b0b624]16#pragma once
[fa4805f]17
18
19#ifdef __CFORALL__
[0fc9756b]20extern "C" {
[fa4805f]21#endif
22
[cbce272]23struct __cfaehm__base_exception_t;
24typedef struct __cfaehm__base_exception_t exception;
25struct __cfaehm__base_exception_t_vtable {
26 const struct __cfaehm__base_exception_t_vtable * parent;
[86d5ba7c]27 size_t size;
[cbce272]28 void (*copy)(struct __cfaehm__base_exception_t *this,
29 struct __cfaehm__base_exception_t * other);
30 void (*free)(struct __cfaehm__base_exception_t *this);
[c315863]31 const char * (*msg)(struct __cfaehm__base_exception_t *this);
[86d5ba7c]32};
[cbce272]33struct __cfaehm__base_exception_t {
34 struct __cfaehm__base_exception_t_vtable const * virtual_table;
[86d5ba7c]35};
[cbce272]36extern struct __cfaehm__base_exception_t_vtable
37 ___cfaehm__base_exception_t_vtable_instance;
[86d5ba7c]38
39
[fa4805f]40// Used in throw statement translation.
[38ac6ec]41void __cfaehm__throw_terminate(exception * except) __attribute__((noreturn));
42void __cfaehm__rethrow_terminate() __attribute__((noreturn));
43void __cfaehm__throw_resume(exception * except);
[fa4805f]44
45// Function catches termination exceptions.
46void __cfaehm__try_terminate(
47 void (*try_block)(),
48 void (*catch_block)(int index, exception * except),
49 int (*match_block)(exception * except));
50
[86d5ba7c]51// Clean-up the exception in catch blocks.
[cbce272]52void __cfaehm__cleanup_terminate(void * except);
[86d5ba7c]53
[fa4805f]54// Data structure creates a list of resume handlers.
55struct __cfaehm__try_resume_node {
[307a732]56 struct __cfaehm__try_resume_node * next;
[e9145a3]57 _Bool (*handler)(exception * except);
[fa4805f]58};
59
[86d5ba7c]60// These act as constructor and destructor for the resume node.
[fa4805f]61void __cfaehm__try_resume_setup(
[307a732]62 struct __cfaehm__try_resume_node * node,
[e9145a3]63 _Bool (*handler)(exception * except));
[fa4805f]64void __cfaehm__try_resume_cleanup(
[307a732]65 struct __cfaehm__try_resume_node * node);
[fa4805f]66
67// Check for a standard way to call fake deconstructors.
[86d5ba7c]68struct __cfaehm__cleanup_hook {};
[fa4805f]69
70#ifdef __CFORALL__
71}
72#endif
Note: See TracBrowser for help on using the repository browser.