source: src/Virtual/Tables.h @ b91bfde

arm-ehjacob/cs343-translationnew-ast-unique-expr
Last change on this file since b91bfde was ecfd758, checked in by Andrew Beach <ajbeach@…>, 8 months ago

Major exception update, seperating type-ids from virtual tables. The major interface changes are done. There is a regression of ?Cancelled(T) to Some?Cancelled. There is some bits of code for the new verion of the ?Cancelled(T) interface already there. Not connected yet but I just reached the limit of what I wanted to do in one commit and then spent over a day cleaning up, so it will replace Some?Cancelled in a future commit.

  • Property mode set to 100644
File size: 1.9 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// Tables.h --
8//
9// Author           : Andrew Beach
10// Created On       : Mon Aug 31 11:07:00 2020
11// Last Modified By : Andrew Beach
12// Last Modified On : Thr Apr  8 15:55:00 2021
13// Update Count     : 1
14//
15
16#include <list>  // for list
17
18class Declaration;
19class StructDecl;
20class Expression;
21
22namespace Virtual {
23
24std::string typeIdType( std::string const & type_name );
25std::string typeIdName( std::string const & type_name );
26std::string vtableTypeName( std::string const & type_name );
27std::string instanceName( std::string const & vtable_name );
28std::string vtableInstanceName( std::string const & type_name );
29bool isVTableInstanceName( std::string const & name );
30
31ObjectDecl * makeVtableForward( StructInstType * vtableType );
32/* Create a forward declaration of a vtable of the given type.
33 * vtableType node is consumed.
34 */
35
36ObjectDecl * makeVtableInstance( StructInstType * vtableType, Type * objectType,
37        Initializer * init = nullptr );
38/* Create an initialized definition of a vtable.
39 * vtableType and init (if provided) nodes are consumed.
40 */
41
42// Some special code for how exceptions interact with virtual tables.
43FunctionDecl * 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
48FunctionDecl * makeGetExceptionFunction(
49        ObjectDecl * vtableInstance, Type * exceptType );
50/* Create the definition of the exception virtual function.
51 * exceptType node is consumed.
52 */
53
54ObjectDecl * 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
59}
Note: See TracBrowser for help on using the repository browser.