Changeset 96ac72c for src/Tuples
- Timestamp:
- Jul 24, 2019, 10:42:18 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 504eb72
- Parents:
- 4eb43fa (diff), 83b52f1 (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. - Location:
- src/Tuples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
r4eb43fa r96ac72c 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 … … 350 350 } 351 351 352 const TypeInstType * isTtype( const Type * type ) { 353 if ( const TypeInstType * inst = dynamic_cast< const TypeInstType * >( type ) ) { 354 if ( inst->baseType && inst->baseType->kind == TypeDecl::Ttype ) { 355 return inst; 356 } 357 } 358 return nullptr; 359 } 360 352 361 const ast::TypeInstType * isTtype( const ast::Type * type ) { 353 362 if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) { … … 364 373 ImpurityDetector( bool ignoreUnique ) : ignoreUnique( ignoreUnique ) {} 365 374 366 void previsit( ApplicationExpr * appExpr ) {375 void previsit( const ApplicationExpr * appExpr ) { 367 376 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()== "?[?]" ) {377 if ( const DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) { 378 if ( function->linkage == LinkageSpec::Intrinsic ) { 379 if ( function->name == "*?" || function->name == "?[?]" ) { 371 380 // intrinsic dereference, subscript are pure, but need to recursively look for impurity 372 381 visit_children = true; … … 377 386 maybeImpure = true; 378 387 } 379 void previsit( UntypedExpr * ) { maybeImpure = true; visit_children = false; }380 void previsit( UniqueExpr * ) {388 void previsit( const UntypedExpr * ) { maybeImpure = true; visit_children = false; } 389 void previsit( const UniqueExpr * ) { 381 390 if ( ignoreUnique ) { 382 391 // bottom out at unique expression. … … 393 402 } // namespace 394 403 395 bool maybeImpure( Expression * expr ) {404 bool maybeImpure( const Expression * expr ) { 396 405 PassVisitor<ImpurityDetector> detector( false ); 397 406 expr->accept( detector ); … … 399 408 } 400 409 401 bool maybeImpureIgnoreUnique( Expression * expr ) {410 bool maybeImpureIgnoreUnique( const Expression * expr ) { 402 411 PassVisitor<ImpurityDetector> detector( true ); 403 412 expr->accept( detector ); -
src/Tuples/Tuples.h
r4eb43fa r96ac72c 52 52 /// returns a TypeInstType if `type` is a ttype, nullptr otherwise 53 53 TypeInstType * isTtype( Type * type ); 54 const TypeInstType * isTtype( const Type * type ); 54 55 const ast::TypeInstType * isTtype( const ast::Type * type ); 55 56 56 57 /// returns true if the expression may contain side-effects. 57 bool maybeImpure( Expression * expr );58 bool maybeImpure( const Expression * expr ); 58 59 bool maybeImpure( const ast::Expr * expr ); 59 60 60 61 /// Returns true if the expression may contain side-effect, 61 62 /// ignoring the presence of unique expressions. 62 bool maybeImpureIgnoreUnique( Expression * expr );63 bool maybeImpureIgnoreUnique( const Expression * expr ); 63 64 bool maybeImpureIgnoreUnique( const ast::Expr * expr ); 64 65 } // namespace Tuples
Note:
See TracChangeset
for help on using the changeset viewer.