Ignore:
Timestamp:
Jul 19, 2019, 3:29:37 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
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
Message:

getFunction has const version and maybeImpure[IgnoreUnique?] have const input.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleExpansion.cc

    r85dac33 r335d81f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 18:14:12 2019
    13 // Update Count     : 21
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Jul 19 14:39:00 2019
     13// Update Count     : 22
    1414//
    1515
     
    364364                        ImpurityDetector( bool ignoreUnique ) : ignoreUnique( ignoreUnique ) {}
    365365
    366                         void previsit( ApplicationExpr * appExpr ) {
     366                        void previsit( const ApplicationExpr * appExpr ) {
    367367                                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 == "?[?]" ) {
    371371                                                        // intrinsic dereference, subscript are pure, but need to recursively look for impurity
    372372                                                        visit_children = true;
     
    377377                                maybeImpure = true;
    378378                        }
    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 * ) {
    381381                                if ( ignoreUnique ) {
    382382                                        // bottom out at unique expression.
     
    393393        } // namespace
    394394
    395         bool maybeImpure( Expression * expr ) {
     395        bool maybeImpure( const Expression * expr ) {
    396396                PassVisitor<ImpurityDetector> detector( false );
    397397                expr->accept( detector );
     
    399399        }
    400400
    401         bool maybeImpureIgnoreUnique( Expression * expr ) {
     401        bool maybeImpureIgnoreUnique( const Expression * expr ) {
    402402                PassVisitor<ImpurityDetector> detector( true );
    403403                expr->accept( detector );
Note: See TracChangeset for help on using the changeset viewer.