Ignore:
Timestamp:
Nov 16, 2023, 3:31:57 PM (9 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
b0845f9
Parents:
3f4f30a
Message:

Round of clean-up in Tuples directory. (Skipping TupleExpansion?, which will be fused together later.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/Tuples.h

    r3f4f30a re580aa5  
    2424
    2525namespace Tuples {
    26         // TupleAssignment.cc
    27         void handleTupleAssignment(
    28                 ResolvExpr::CandidateFinder & finder, const ast::UntypedExpr * assign,
    29                 std::vector< ResolvExpr::CandidateFinder > & args );
    3026
    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( ast::TranslationUnit & translationUnit );
     27// TupleAssignment.cc
     28void handleTupleAssignment(
     29        ResolvExpr::CandidateFinder & finder, const ast::UntypedExpr * assign,
     30        std::vector< ResolvExpr::CandidateFinder > & args );
    3431
    35         /// replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc.
    36         void expandTuples( ast::TranslationUnit & translaionUnit );
     32// TupleExpansion.cc
     33/// Expands z.[a, b.[x, y], c] into [z.a, z.b.x, z.b.y, z.c], inserting UniqueExprs as appropriate.
     34void expandMemberTuples( ast::TranslationUnit & translationUnit );
    3735
    38         /// replaces UniqueExprs with a temporary variable and one call
    39         void expandUniqueExpr( ast::TranslationUnit & translationUnit );
     36/// Replaces tuple-related elements, such as TupleType, TupleExpr, TupleAssignExpr, etc.
     37void expandTuples( ast::TranslationUnit & translaionUnit );
    4038
    41         /// returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types
    42         const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs );
     39/// Replaces UniqueExprs with a temporary variable and one call.
     40void expandUniqueExpr( ast::TranslationUnit & translationUnit );
    4341
    44         /// returns a TypeInstType if `type` is a ttype, nullptr otherwise
    45         const ast::TypeInstType * isTtype( const ast::Type * type );
     42/// Returns VoidType if any of the expressions have Voidtype, otherwise TupleType of the Expression result types.
     43const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs );
    4644
    47         /// returns true if the expression may contain side-effects.
    48         bool maybeImpure( const ast::Expr * expr );
     45/// Returns a TypeInstType if `type` is a ttype, nullptr otherwise
     46const ast::TypeInstType * isTtype( const ast::Type * type );
    4947
    50         /// Returns true if the expression may contain side-effect,
    51         /// ignoring the presence of unique expressions.
    52         bool maybeImpureIgnoreUnique( const ast::Expr * expr );
     48/// Returns true if the expression may contain side-effects.
     49bool maybeImpure( const ast::Expr * expr );
     50
     51/// Returns true if the expression may contain side-effect,
     52/// ignoring the presence of unique expressions.
     53bool maybeImpureIgnoreUnique( const ast::Expr * expr );
     54
    5355} // namespace Tuples
    5456
Note: See TracChangeset for help on using the changeset viewer.