source: src/Tuples/Tuples.h

Last change on this file was 7aa209e7, checked in by Andrew Beach <ajbeach@…>, 2 weeks ago

Fixing some whitespace around a recent merge. That lead to some general clean-up, including removing tailing whitespace and removing some unneeded dependences.

  • Property mode set to 100644
File size: 1.9 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//
[11df881]7// Tuples.h -- A collection of tuple operations.
[51587aa]8//
[843054c2]9// Author           : Rodolfo G. Esteves
[51587aa]10// Created On       : Mon May 18 07:44:20 2015
[d249e0b]11// Last Modified By : Henry Xue
12// Last Modified On : Mon Aug 23 15:36:09 2021
13// Update Count     : 19
[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"
[7aa209e7]23namespace ResolvExpr {
24        class CandidateFinder;
25}
[141b786]26
[51b7345]27namespace Tuples {
[77bfc80]28
[e580aa5]29// TupleAssignment.cc
30void handleTupleAssignment(
31        ResolvExpr::CandidateFinder & finder, const ast::UntypedExpr * assign,
32        std::vector< ResolvExpr::CandidateFinder > & args );
[bf32bb8]33
[e580aa5]34// TupleExpansion.cc
35/// Expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate.
36void expandMemberTuples( ast::TranslationUnit & translationUnit );
[3c13c03]37
[e580aa5]38/// Replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc.
39void expandTuples( ast::TranslationUnit & translaionUnit );
[aefcc3b]40
[e580aa5]41/// Replaces UniqueExprs with a temporary variable and one call.
42void expandUniqueExpr( ast::TranslationUnit & translationUnit );
[65660bd]43
[e580aa5]44/// Returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types.
45const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs );
[8bf784a]46
[e580aa5]47/// Returns a TypeInstType if `type` is a ttype, nullptr otherwise
48const ast::TypeInstType * isTtype( const ast::Type * type );
49
50/// Returns true if the expression may contain side-effects.
51bool maybeImpure( const ast::Expr * expr );
52
53/// Returns true if the expression may contain side-effect,
54/// ignoring the presence of unique expressions.
55bool maybeImpureIgnoreUnique( const ast::Expr * expr );
[9f10c4b8]56
[51b7345]57} // namespace Tuples
58
[51587aa]59// Local Variables: //
60// tab-width: 4 //
61// mode: c++ //
62// compile-command: "make install" //
63// End: //
Note: See TracBrowser for help on using the repository browser.