[51587aa] | 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 | // |
---|
[6eb8948] | 7 | // Tuples.h -- |
---|
[51587aa] | 8 | // |
---|
[843054c2] | 9 | // Author : Rodolfo G. Esteves |
---|
[51587aa] | 10 | // Created On : Mon May 18 07:44:20 2015 |
---|
[6b0b624] | 11 | // Last Modified By : Peter A. Buhr |
---|
| 12 | // Last Modified On : Sat Jul 22 09:55:00 2017 |
---|
| 13 | // Update Count : 16 |
---|
[51587aa] | 14 | // |
---|
| 15 | |
---|
[6b0b624] | 16 | #pragma once |
---|
[51b7345] | 17 | |
---|
| 18 | #include <string> |
---|
[c43c171] | 19 | #include <vector> |
---|
[51b7345] | 20 | |
---|
| 21 | #include "SynTree/Expression.h" |
---|
| 22 | #include "SynTree/Declaration.h" |
---|
| 23 | #include "SynTree/Type.h" |
---|
| 24 | |
---|
[141b786] | 25 | #include "ResolvExpr/AlternativeFinder.h" |
---|
| 26 | |
---|
[51b7345] | 27 | namespace Tuples { |
---|
[6eb8948] | 28 | // TupleAssignment.cc |
---|
[c43c171] | 29 | void handleTupleAssignment( ResolvExpr::AlternativeFinder & currentFinder, UntypedExpr * assign, |
---|
| 30 | std::vector< ResolvExpr::AlternativeFinder >& args ); |
---|
| 31 | |
---|
[6eb8948] | 32 | // TupleExpansion.cc |
---|
[bf32bb8] | 33 | /// expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate |
---|
| 34 | void expandMemberTuples( std::list< Declaration * > & translationUnit ); |
---|
| 35 | |
---|
| 36 | /// replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc. |
---|
[6eb8948] | 37 | void expandTuples( std::list< Declaration * > & translationUnit ); |
---|
[3c13c03] | 38 | |
---|
[bf32bb8] | 39 | /// replaces UniqueExprs with a temporary variable and one call |
---|
| 40 | void expandUniqueExpr( std::list< Declaration * > & translationUnit ); |
---|
[aefcc3b] | 41 | |
---|
[bf32bb8] | 42 | /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types |
---|
| 43 | Type * makeTupleType( const std::list< Expression * > & exprs ); |
---|
[65660bd] | 44 | |
---|
[8bf784a] | 45 | /// returns a TypeInstType if `type` is a ttype, nullptr otherwise |
---|
| 46 | TypeInstType * isTtype( Type * type ); |
---|
| 47 | |
---|
[bf32bb8] | 48 | /// returns true if the expression may contain side-effects. |
---|
| 49 | bool maybeImpure( Expression * expr ); |
---|
[9f10c4b8] | 50 | |
---|
| 51 | /// returns true if the expression may contain side-effect, ignoring the presence of unique expressions. |
---|
| 52 | bool maybeImpureIgnoreUnique( Expression * expr ); |
---|
[51b7345] | 53 | } // namespace Tuples |
---|
| 54 | |
---|
[51587aa] | 55 | // Local Variables: // |
---|
| 56 | // tab-width: 4 // |
---|
| 57 | // mode: c++ // |
---|
| 58 | // compile-command: "make install" // |
---|
| 59 | // End: // |
---|