Changeset 335d81f
- Timestamp:
- Jul 19, 2019, 3:29:37 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 884f1409
- Parents:
- 85dac33
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r85dac33 r335d81f 9 9 // Author : Rob Schluntz 10 10 // Created On : Fri May 13 11:26:36 2016 11 // Last Modified By : A aron B. Moss12 // Last Modified On : Mon Jun 10 13:30:00 201913 // Update Count : 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 19 14:34:00 2019 13 // Update Count : 6 14 14 // 15 15 … … 633 633 return nullptr; 634 634 } 635 636 DeclarationWithType * getFunctionCore( const Expression * expr ) { 637 if ( const auto * appExpr = dynamic_cast< const ApplicationExpr * >( expr ) ) { 638 return getCalledFunction( appExpr->function ); 639 } else if ( const auto * untyped = dynamic_cast< const UntypedExpr * >( expr ) ) { 640 return getCalledFunction( untyped->function ); 641 } 642 assertf( false, "getFunction with unknown expression: %s", toString( expr ).c_str() ); 643 } 635 644 } 636 645 637 646 DeclarationWithType * getFunction( Expression * expr ) { 638 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) { 639 return getCalledFunction( appExpr->get_function() ); 640 } else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) { 641 return getCalledFunction( untyped->get_function() ); 642 } 643 assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() ); 647 return getFunctionCore( expr ); 648 } 649 650 const DeclarationWithType * getFunction( const Expression * expr ) { 651 return getFunctionCore( expr ); 644 652 } 645 653 -
src/InitTweak/InitTweak.h
r85dac33 r335d81f 9 9 // Author : Rob Schluntz 10 10 // Created On : Fri May 13 11:26:36 2016 11 // Last Modified By : A aron B. Moss12 // Last Modified On : Mon Jun 10 13:30:00 201913 // Update Count : 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 19 14:18:00 2019 13 // Update Count : 6 14 14 // 15 15 … … 61 61 /// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr) 62 62 DeclarationWithType * getFunction( Expression * expr ); 63 const DeclarationWithType * getFunction( const Expression * expr ); 63 64 const ast::DeclWithType * getFunction( const ast::Expr * expr ); 64 65 -
src/Tuples/TupleExpansion.cc
r85dac33 r335d81f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Feb 13 18:14:12201913 // Update Count : 2 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 19 14:39:00 2019 13 // Update Count : 22 14 14 // 15 15 … … 364 364 ImpurityDetector( bool ignoreUnique ) : ignoreUnique( ignoreUnique ) {} 365 365 366 void previsit( ApplicationExpr * appExpr ) {366 void previsit( const ApplicationExpr * appExpr ) { 367 367 visit_children = false; 368 if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) {369 if ( function-> get_linkage()== LinkageSpec::Intrinsic ) {370 if ( function-> get_name() == "*?" || function->get_name()== "?[?]" ) {368 if ( const DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) { 369 if ( function->linkage == LinkageSpec::Intrinsic ) { 370 if ( function->name == "*?" || function->name == "?[?]" ) { 371 371 // intrinsic dereference, subscript are pure, but need to recursively look for impurity 372 372 visit_children = true; … … 377 377 maybeImpure = true; 378 378 } 379 void previsit( UntypedExpr * ) { maybeImpure = true; visit_children = false; }380 void previsit( UniqueExpr * ) {379 void previsit( const UntypedExpr * ) { maybeImpure = true; visit_children = false; } 380 void previsit( const UniqueExpr * ) { 381 381 if ( ignoreUnique ) { 382 382 // bottom out at unique expression. … … 393 393 } // namespace 394 394 395 bool maybeImpure( Expression * expr ) {395 bool maybeImpure( const Expression * expr ) { 396 396 PassVisitor<ImpurityDetector> detector( false ); 397 397 expr->accept( detector ); … … 399 399 } 400 400 401 bool maybeImpureIgnoreUnique( Expression * expr ) {401 bool maybeImpureIgnoreUnique( const Expression * expr ) { 402 402 PassVisitor<ImpurityDetector> detector( true ); 403 403 expr->accept( detector ); -
src/Tuples/Tuples.h
r85dac33 r335d81f 55 55 56 56 /// returns true if the expression may contain side-effects. 57 bool maybeImpure( Expression * expr );57 bool maybeImpure( const Expression * expr ); 58 58 bool maybeImpure( const ast::Expr * expr ); 59 59 60 60 /// Returns true if the expression may contain side-effect, 61 61 /// ignoring the presence of unique expressions. 62 bool maybeImpureIgnoreUnique( Expression * expr );62 bool maybeImpureIgnoreUnique( const Expression * expr ); 63 63 bool maybeImpureIgnoreUnique( const ast::Expr * expr ); 64 64 } // namespace Tuples
Note: See TracChangeset
for help on using the changeset viewer.