bitc_exception_t Struct Reference

Common "base class" for all exception objects. More...

#include <runtime.h>


Data Fields

const char * __fileName
int __line
const char * __name


Detailed Description

Common "base class" for all exception objects.

We use bitc_exception_t as a common "base" class (i.e. as the first element) of every exception structure that is emitted by the C emitter. This gives us something that we can cast to at the site of the catch in order to perform the dispatch across the catch blocks.

The inclusion of the name field gives us something to print for debugging purposes. At the moment, it is also used as our unique exception code. To support this, we emit a C declaration of the form:

const char *CMANGLE(excpt-id) = "CMANGLE(excpt-id)"

for each exception at the point of declaration.

Bug:
The string strategy works fine when we are doing whole-program compiles, but it does not generalize. It relies on the linker to perform cross-file string constang merging, which is not implemented by many (or even most) linkers. A better strategy would be to emit an uninitialized common symbol of (e.g.) type integer, which must be merged by the linker, and use the address of that symbol as the exception ID.

Definition at line 117 of file runtime.h.


Field Documentation

const char* bitc_exception_t::__fileName

Definition at line 118 of file runtime.h.

int bitc_exception_t::__line

Definition at line 119 of file runtime.h.

const char* bitc_exception_t::__name

Definition at line 121 of file runtime.h.


The documentation for this struct was generated from the following file:
Generated on Fri Feb 10 07:59:22 2012 for BitC Runtime Library by  doxygen 1.4.7