Changeset 145f1fc for src/ResolvExpr


Ignore:
Timestamp:
Jul 15, 2015, 2:59:57 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
1ab4ce2, 2794fff, e45215c
Parents:
85c4ef0
Message:

modified ForStmt? to have a list of statements for the initialization portion, and reverted to hoisting the initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r85c4ef0 r145f1fc  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul  3 16:18:20 2015
    13 // Update Count     : 159
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 15 14:54:04 2015
     13// Update Count     : 167
    1414//
    1515
     
    226226
    227227        void Resolver::visit( ForStmt *forStmt ) {
    228             // SymTab::Indexer::visit( forStmt );
    229                 Expression *newExpr;
    230             // for statements introduce a level of scope
    231             enterScope();
    232             maybeAccept( forStmt->get_initialization(), *this );
     228                SymTab::Indexer::visit( forStmt );
     229
    233230                if ( forStmt->get_condition() ) {
    234                         newExpr = findSingleExpression( forStmt->get_condition(), *this );
     231                        Expression * newExpr = findSingleExpression( forStmt->get_condition(), *this );
    235232                        delete forStmt->get_condition();
    236233                        forStmt->set_condition( newExpr );
    237234                } // if
    238  
     235               
    239236                if ( forStmt->get_increment() ) {
    240                         newExpr = findVoidExpression( forStmt->get_increment(), *this );
     237                        Expression * newExpr = findVoidExpression( forStmt->get_increment(), *this );
    241238                        delete forStmt->get_increment();
    242239                        forStmt->set_increment( newExpr );
    243240                } // if
    244 
    245             maybeAccept( forStmt->get_condition(), *this );
    246             maybeAccept( forStmt->get_increment(), *this );
    247             maybeAccept( forStmt->get_body(), *this );
    248             leaveScope();
    249241        }
    250242
Note: See TracChangeset for help on using the changeset viewer.