Ignore:
Timestamp:
Nov 16, 2023, 3:31:57 PM (6 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.cc

    r3f4f30a re580aa5  
    2525namespace {
    2626
    27         /// Determines if impurity (read: side-effects) may exist in a piece of code. Currently gives
    28         /// a very crude approximation, wherein any function call expression means the code may be
    29         /// impure.
    30     struct ImpurityDetector : public ast::WithShortCircuiting {
    31                 bool result = false;
     27/// Determines if impurity (read: side-effects) may exist in a piece of code.
     28/// Currently gives a very crude approximation, wherein almost any function
     29/// call expression means the code may be impure.
     30struct ImpurityDetector : public ast::WithShortCircuiting {
     31        bool result = false;
    3232
    33                 void previsit( ast::ApplicationExpr const * appExpr ) {
    34                         if ( ast::DeclWithType const * function = ast::getFunction( appExpr ) ) {
    35                                 if ( function->linkage == ast::Linkage::Intrinsic
    36                                                 && ( function->name == "*?" || function->name == "?[?]" ) ) {
    37                                         return;
    38                                 }
     33        void previsit( ast::ApplicationExpr const * appExpr ) {
     34                if ( ast::DeclWithType const * function = ast::getFunction( appExpr ) ) {
     35                        if ( function->linkage == ast::Linkage::Intrinsic
     36                                        && ( function->name == "*?" || function->name == "?[?]" ) ) {
     37                                return;
    3938                        }
    40                         result = true; visit_children = false;
    4139                }
    42                 void previsit( ast::UntypedExpr const * ) {
    43                         result = true; visit_children = false;
    44                 }
    45         };
     40                result = true; visit_children = false;
     41        }
     42        void previsit( ast::UntypedExpr const * ) {
     43                result = true; visit_children = false;
     44        }
     45};
    4646
    47         struct ImpurityDetectorIgnoreUnique : public ImpurityDetector {
    48                 using ImpurityDetector::previsit;
    49                 void previsit( ast::UniqueExpr const * ) {
    50                         visit_children = false;
    51                 }
    52         };
     47struct ImpurityDetectorIgnoreUnique : public ImpurityDetector {
     48        using ImpurityDetector::previsit;
     49        void previsit( ast::UniqueExpr const * ) {
     50                visit_children = false;
     51        }
     52};
     53
    5354} // namespace
    5455
Note: See TracChangeset for help on using the changeset viewer.