Changeset 0f6d2884 for src/Tuples/Tuples.cc
- Timestamp:
- Nov 17, 2023, 1:56:19 PM (13 months ago)
- Branches:
- master
- Children:
- 16e0dcb, 41606df1
- Parents:
- 3f219eb (diff), b0845f9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/Tuples.cc
r3f219eb r0f6d2884 25 25 namespace { 26 26 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 31 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. 30 struct ImpurityDetector : public ast::WithShortCircuiting { 31 bool result = false; 32 32 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; 39 38 } 40 result = true; visit_children = false;41 39 } 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 }; 46 46 47 struct ImpurityDetectorIgnoreUnique : public ImpurityDetector { 48 using ImpurityDetector::previsit; 49 void previsit( ast::UniqueExpr const * ) { 50 visit_children = false; 51 } 52 }; 47 struct ImpurityDetectorIgnoreUnique : public ImpurityDetector { 48 using ImpurityDetector::previsit; 49 void previsit( ast::UniqueExpr const * ) { 50 visit_children = false; 51 } 52 }; 53 53 54 } // namespace 54 55
Note: See TracChangeset
for help on using the changeset viewer.