source: src/Tuples/Tuples.h@ 0e76cf4f

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 0e76cf4f was 141b786, checked in by Rob Schluntz <rschlunt@…>, 9 years ago

rework UniqueExpr, handle UniqueExpr in FixInit, fix translation for UniqueExprs, refactor explode functions and fix AddressExpr distribution over exploded tuple exprs

  • Property mode set to 100644
File size: 1.7 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// Tuples.h --
8//
9// Author : Rodolfo G. Esteves
10// Created On : Mon May 18 07:44:20 2015
11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Nov 9 13:17:58 2016
13// Update Count : 15
14//
15
16#ifndef _TUPLES_H_
17#define _TUPLES_H_
18
19#include <string>
20
21#include "SynTree/Expression.h"
22#include "SynTree/Declaration.h"
23#include "SynTree/Type.h"
24
25#include "ResolvExpr/AlternativeFinder.h"
26
27namespace Tuples {
28 // TupleAssignment.cc
29 void handleTupleAssignment( ResolvExpr::AlternativeFinder & currentFinder, UntypedExpr * assign, const std::list<ResolvExpr::AltList> & possibilities );
30
31 // TupleExpansion.cc
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.
36 void expandTuples( std::list< Declaration * > & translationUnit );
37
38 /// replaces UniqueExprs with a temporary variable and one call
39 void expandUniqueExpr( std::list< Declaration * > & translationUnit );
40
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 );
43
44 /// returns true if the expression may contain side-effects.
45 bool maybeImpure( Expression * expr );
46} // namespace Tuples
47
48#endif // _TUPLE_ASSIGNMENT_H_
49
50// Local Variables: //
51// tab-width: 4 //
52// mode: c++ //
53// compile-command: "make install" //
54// End: //
Note: See TracBrowser for help on using the repository browser.