source: src/ResolvExpr/AdjustExprType.hpp @ a2f1ea8d

Last change on this file since a2f1ea8d was 5bf3976, checked in by Andrew Beach <ajbeach@…>, 22 months ago

Header Clean-Up: Created new headers for new AST typeops and moved declarations.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 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// AdjustExprType.hpp --
8//
9// Author           : Andrew Beach
10// Created On       : Wed Jan 18  9:56:00 2023
11// Last Modified By : Andrew Beach
12// Last Modified On : Wed Jan 18  9:56:00 2023
13// Update Count     : 0
14//
15
16#pragma once
17
18class Type;
19namespace SymTab {
20        class Indexer;
21}
22namespace ast {
23        class SymbolTable;
24        class Type;
25        class TypeEnvironment;
26}
27
28namespace ResolvExpr {
29
30class TypeEnvironment;
31
32/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function
33void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
34
35/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer.
36void adjustExprType( Type *& type );
37
38template< typename ForwardIterator >
39void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) {
40        while ( begin != end ) {
41                adjustExprType( *begin++, env, indexer );
42        } // while
43}
44
45/// Replaces array types with equivalent pointer,
46/// and function types with a pointer-to-function.
47const ast::Type * adjustExprType( const ast::Type * type,
48        const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );
49
50}
51
52// Local Variables: //
53// tab-width: 4 //
54// mode: c++ //
55// compile-command: "make install" //
56// End: //
Note: See TracBrowser for help on using the repository browser.