source: src/Tuples/Tuples.h @ fd642d2

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since fd642d2 was fd642d2, checked in by Andrew Beach <ajbeach@…>, 5 years ago

Added const in a few more places. This should be all the leaf areas need to make unify const.

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[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
[b910d15]11// Last Modified By : Andrew Beach
[bc92bee]12// Last Modified On : Tue Jun 18 09:36:00 2019
13// Update Count     : 18
[51587aa]14//
15
[6b0b624]16#pragma once
[51b7345]17
18#include <string>
[c43c171]19#include <vector>
[51b7345]20
[9b4f329]21#include "AST/Fwd.hpp"
22#include "AST/Node.hpp"
[51b7345]23#include "SynTree/Expression.h"
24#include "SynTree/Declaration.h"
25#include "SynTree/Type.h"
26
[141b786]27#include "ResolvExpr/AlternativeFinder.h"
[432ce7a]28#include "ResolvExpr/CandidateFinder.hpp"
[141b786]29
[51b7345]30namespace Tuples {
[6eb8948]31        // TupleAssignment.cc
[77bfc80]32        void handleTupleAssignment( ResolvExpr::AlternativeFinder & currentFinder, UntypedExpr * assign,
[c43c171]33                std::vector< ResolvExpr::AlternativeFinder >& args );
[432ce7a]34        void handleTupleAssignment( 
35                ResolvExpr::CandidateFinder & finder, const ast::UntypedExpr * assign, 
36                std::vector< ResolvExpr::CandidateFinder > & args );
[77bfc80]37
[6eb8948]38        // TupleExpansion.cc
[bf32bb8]39        /// expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate
40        void expandMemberTuples( std::list< Declaration * > & translationUnit );
41
42        /// replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc.
[6eb8948]43        void expandTuples( std::list< Declaration * > & translationUnit );
[3c13c03]44
[bf32bb8]45        /// replaces UniqueExprs with a temporary variable and one call
46        void expandUniqueExpr( std::list< Declaration * > & translationUnit );
[aefcc3b]47
[bf32bb8]48        /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types
49        Type * makeTupleType( const std::list< Expression * > & exprs );
[9b4f329]50        const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs );
[65660bd]51
[8bf784a]52        /// returns a TypeInstType if `type` is a ttype, nullptr otherwise
53        TypeInstType * isTtype( Type * type );
[fd642d2]54        const TypeInstType * isTtype( const Type * type );
[77bfc80]55        const ast::TypeInstType * isTtype( const ast::Type * type );
[8bf784a]56
[bf32bb8]57        /// returns true if the expression may contain side-effects.
[335d81f]58        bool maybeImpure( const Expression * expr );
[bc92bee]59        bool maybeImpure( const ast::Expr * expr );
[9f10c4b8]60
[b910d15]61        /// Returns true if the expression may contain side-effect,
62        /// ignoring the presence of unique expressions.
[335d81f]63        bool maybeImpureIgnoreUnique( const Expression * expr );
[b910d15]64        bool maybeImpureIgnoreUnique( const ast::Expr * expr );
[51b7345]65} // namespace Tuples
66
[51587aa]67// Local Variables: //
68// tab-width: 4 //
69// mode: c++ //
70// compile-command: "make install" //
71// End: //
Note: See TracBrowser for help on using the repository browser.