source: src/Tuples/Tuples.h @ 4d3cba50

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 4d3cba50 was 8bf784a, checked in by Rob Schluntz <rschlunt@…>, 8 years ago

name mangling for ttype, fix SynTree? operator<< to work with nullptr, add isTtype check, ttype variables are automatically "sized"

  • Property mode set to 100644
File size: 1.8 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
[141b786]11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Nov 9 13:17:58 2016
13// Update Count     : 15
[51587aa]14//
15
[6eb8948]16#ifndef _TUPLES_H_
[65660bd]17#define _TUPLES_H_
[51b7345]18
19#include <string>
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]27namespace Tuples {
[6eb8948]28        // TupleAssignment.cc
[65660bd]29        void handleTupleAssignment( ResolvExpr::AlternativeFinder & currentFinder, UntypedExpr * assign, const std::list<ResolvExpr::AltList> & possibilities );
[6eb8948]30
31        // TupleExpansion.cc
[bf32bb8]32        /// expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate
33        void expandMemberTuples( std::list< Declaration * > & translationUnit );
34
35        /// replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc.
[6eb8948]36        void expandTuples( std::list< Declaration * > & translationUnit );
[3c13c03]37
[bf32bb8]38        /// replaces UniqueExprs with a temporary variable and one call
39        void expandUniqueExpr( std::list< Declaration * > & translationUnit );
[aefcc3b]40
[bf32bb8]41        /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types
42        Type * makeTupleType( const std::list< Expression * > & exprs );
[65660bd]43
[8bf784a]44        /// returns a TypeInstType if `type` is a ttype, nullptr otherwise
45        TypeInstType * isTtype( Type * type );
46
[bf32bb8]47        /// returns true if the expression may contain side-effects.
48        bool maybeImpure( Expression * expr );
[51b7345]49} // namespace Tuples
50
[51587aa]51#endif // _TUPLE_ASSIGNMENT_H_
[51b7345]52
[51587aa]53// Local Variables: //
54// tab-width: 4 //
55// mode: c++ //
56// compile-command: "make install" //
57// End: //
Note: See TracBrowser for help on using the repository browser.