Changeset 3b0bc16 for src/Common


Ignore:
Timestamp:
Feb 1, 2022, 8:22:12 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
fde0a58
Parents:
729c991
Message:

change class name WhileStmt? to WhileDoStmt?, add else clause to WhileDoStmt? and ForStmt?, change names thenPart/ElsePart to then/else_

Location:
src/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/CodeLocationTools.cpp

    r729c991 r3b0bc16  
    1010// Created On       : Fri Dec  4 15:42:00 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 12 18:35:37 2021
    13 // Update Count     : 2
     12// Last Modified On : Tue Feb  1 09:14:39 2022
     13// Update Count     : 3
    1414//
    1515
     
    109109    macro(DirectiveStmt, Stmt) \
    110110    macro(IfStmt, Stmt) \
    111     macro(WhileStmt, Stmt) \
     111    macro(WhileDoStmt, Stmt) \
    112112    macro(ForStmt, Stmt) \
    113113    macro(SwitchStmt, Stmt) \
  • src/Common/PassVisitor.h

    r729c991 r3b0bc16  
    9292        virtual void visit( IfStmt * ifStmt ) override final;
    9393        virtual void visit( const IfStmt * ifStmt ) override final;
    94         virtual void visit( WhileStmt * whileStmt ) override final;
    95         virtual void visit( const WhileStmt * whileStmt ) override final;
     94        virtual void visit( WhileDoStmt * whileDoStmt ) override final;
     95        virtual void visit( const WhileDoStmt * whileDoStmt ) override final;
    9696        virtual void visit( ForStmt * forStmt ) override final;
    9797        virtual void visit( const ForStmt * forStmt ) override final;
     
    277277        virtual Statement * mutate( DirectiveStmt * dirStmt ) override final;
    278278        virtual Statement * mutate( IfStmt * ifStmt ) override final;
    279         virtual Statement * mutate( WhileStmt * whileStmt ) override final;
     279        virtual Statement * mutate( WhileDoStmt * whileDoStmt ) override final;
    280280        virtual Statement * mutate( ForStmt * forStmt ) override final;
    281281        virtual Statement * mutate( SwitchStmt * switchStmt ) override final;
  • src/Common/PassVisitor.impl.h

    r729c991 r3b0bc16  
    11891189                maybeAccept_impl( node->initialization, *this );
    11901190                visitExpression ( node->condition );
    1191                 node->thenPart = visitStatement( node->thenPart );
    1192                 node->elsePart = visitStatement( node->elsePart );
     1191                node->then = visitStatement( node->then );
     1192                node->else_ = visitStatement( node->else_ );
    11931193        }
    11941194        VISIT_END( node );
     
    12031203                maybeAccept_impl( node->initialization, *this );
    12041204                visitExpression ( node->condition );
    1205                 visitStatement  ( node->thenPart );
    1206                 visitStatement  ( node->elsePart );
     1205                visitStatement  ( node->then );
     1206                visitStatement  ( node->else_ );
    12071207        }
    12081208        VISIT_END( node );
     
    12171217                maybeMutate_impl( node->initialization, *this );
    12181218                node->condition = mutateExpression( node->condition );
    1219                 node->thenPart  = mutateStatement ( node->thenPart  );
    1220                 node->elsePart  = mutateStatement ( node->elsePart  );
     1219                node->then  = mutateStatement ( node->then  );
     1220                node->else_  = mutateStatement ( node->else_  );
    12211221        }
    12221222        MUTATE_END( Statement, node );
     
    12241224
    12251225//--------------------------------------------------------------------------
    1226 // WhileStmt
    1227 template< typename pass_type >
    1228 void PassVisitor< pass_type >::visit( WhileStmt * node ) {
     1226// WhileDoStmt
     1227template< typename pass_type >
     1228void PassVisitor< pass_type >::visit( WhileDoStmt * node ) {
    12291229        VISIT_START( node );
    12301230
     
    12411241
    12421242template< typename pass_type >
    1243 void PassVisitor< pass_type >::visit( const WhileStmt * node ) {
     1243void PassVisitor< pass_type >::visit( const WhileDoStmt * node ) {
    12441244        VISIT_START( node );
    12451245
     
    12561256
    12571257template< typename pass_type >
    1258 Statement * PassVisitor< pass_type >::mutate( WhileStmt * node ) {
     1258Statement * PassVisitor< pass_type >::mutate( WhileDoStmt * node ) {
    12591259        MUTATE_START( node );
    12601260
Note: See TracChangeset for help on using the changeset viewer.