[1c01c58] | 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 | // Tables.h --
|
---|
| 8 | //
|
---|
| 9 | // Author : Andrew Beach
|
---|
| 10 | // Created On : Mon Aug 31 11:07:00 2020
|
---|
| 11 | // Last Modified By : Andrew Beach
|
---|
[ecfd758] | 12 | // Last Modified On : Thr Apr 8 15:55:00 2021
|
---|
| 13 | // Update Count : 1
|
---|
[1c01c58] | 14 | //
|
---|
| 15 |
|
---|
| 16 | #include <list> // for list
|
---|
| 17 |
|
---|
| 18 | class Declaration;
|
---|
| 19 | class StructDecl;
|
---|
| 20 | class Expression;
|
---|
| 21 |
|
---|
| 22 | namespace Virtual {
|
---|
| 23 |
|
---|
[ecfd758] | 24 | std::string typeIdType( std::string const & type_name );
|
---|
| 25 | std::string typeIdName( std::string const & type_name );
|
---|
[1c01c58] | 26 | std::string vtableTypeName( std::string const & type_name );
|
---|
| 27 | std::string instanceName( std::string const & vtable_name );
|
---|
| 28 | std::string vtableInstanceName( std::string const & type_name );
|
---|
| 29 | bool isVTableInstanceName( std::string const & name );
|
---|
| 30 |
|
---|
[69c5c00] | 31 | ObjectDecl * makeVtableForward( StructInstType * vtableType );
|
---|
| 32 | /* Create a forward declaration of a vtable of the given type.
|
---|
| 33 | * vtableType node is consumed.
|
---|
[1c01c58] | 34 | */
|
---|
| 35 |
|
---|
[69c5c00] | 36 | ObjectDecl * makeVtableInstance( StructInstType * vtableType, Type * objectType,
|
---|
| 37 | Initializer * init = nullptr );
|
---|
[1c01c58] | 38 | /* Create an initialized definition of a vtable.
|
---|
[69c5c00] | 39 | * vtableType and init (if provided) nodes are consumed.
|
---|
| 40 | */
|
---|
| 41 |
|
---|
| 42 | // Some special code for how exceptions interact with virtual tables.
|
---|
| 43 | FunctionDecl * makeGetExceptionForward( Type * vtableType, Type * exceptType );
|
---|
| 44 | /* Create a forward declaration of the exception virtual function
|
---|
| 45 | * linking the vtableType to the exceptType. Both nodes are consumed.
|
---|
| 46 | */
|
---|
| 47 |
|
---|
| 48 | FunctionDecl * makeGetExceptionFunction(
|
---|
| 49 | ObjectDecl * vtableInstance, Type * exceptType );
|
---|
| 50 | /* Create the definition of the exception virtual function.
|
---|
| 51 | * exceptType node is consumed.
|
---|
[1c01c58] | 52 | */
|
---|
| 53 |
|
---|
[ecfd758] | 54 | ObjectDecl * makeTypeIdInstance( StructInstType const * typeIdType );
|
---|
| 55 | /* Build an instance of the type-id from the type of the type-id.
|
---|
| 56 | * TODO: Should take the parent type. Currently locked to the exception_t.
|
---|
| 57 | */
|
---|
| 58 |
|
---|
[1c01c58] | 59 | }
|
---|