source: src/Virtual/Tables.h @ b93c544

Last change on this file since b93c544 was c6b4432, checked in by Andrew Beach <ajbeach@…>, 8 months ago

Remove BaseSyntaxNode? and clean-up.

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[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
[4f6dda0]12// Last Modified On : Wec Dec  8 16:58:00 2021
13// Update Count     : 3
[1c01c58]14//
15
16#include <list>  // for list
17
[4f6dda0]18#include <string>
19#include "AST/Fwd.hpp"
[1c01c58]20
21namespace Virtual {
22
[ecfd758]23std::string typeIdType( std::string const & type_name );
24std::string typeIdName( std::string const & type_name );
[1c01c58]25std::string vtableTypeName( std::string const & type_name );
26std::string instanceName( std::string const & vtable_name );
27std::string vtableInstanceName( std::string const & type_name );
[b583113]28std::string concurrentDefaultVTableName();
[1c01c58]29bool isVTableInstanceName( std::string const & name );
30
[69c5c00]31/* Create a forward declaration of a vtable of the given type.
32 * vtableType node is consumed.
[1c01c58]33 */
[4f6dda0]34ast::ObjectDecl * makeVtableForward(
35        CodeLocation const & location, std::string const & name,
36        ast::StructInstType const * vtableType );
[1c01c58]37
38/* Create an initialized definition of a vtable.
[69c5c00]39 * vtableType and init (if provided) nodes are consumed.
40 */
[4f6dda0]41ast::ObjectDecl * makeVtableInstance(
42        CodeLocation const & location,
43        std::string const & name,
44        ast::StructInstType const * vtableType,
45        ast::Type const * objectType,
46        ast::Init const * init = nullptr );
[69c5c00]47
48// Some special code for how exceptions interact with virtual tables.
[c6b4432]49
[69c5c00]50/* Create a forward declaration of the exception virtual function
51 * linking the vtableType to the exceptType. Both nodes are consumed.
52 */
[4f6dda0]53ast::FunctionDecl * makeGetExceptionForward(
54        CodeLocation const & location,
55        ast::Type const * vtableType,
56        ast::Type const * exceptType );
[69c5c00]57
58/* Create the definition of the exception virtual function.
59 * exceptType node is consumed.
[1c01c58]60 */
[4f6dda0]61ast::FunctionDecl * makeGetExceptionFunction(
62        CodeLocation const & location,
63        ast::ObjectDecl const * vtableInstance, ast::Type const * exceptType );
[1c01c58]64
[ecfd758]65/* Build an instance of the type-id from the type of the type-id.
66 * TODO: Should take the parent type. Currently locked to the exception_t.
67 */
[4f6dda0]68ast::ObjectDecl * makeTypeIdInstance(
69        const CodeLocation & location, ast::StructInstType const * typeIdType );
[ecfd758]70
[1c01c58]71}
Note: See TracBrowser for help on using the repository browser.