Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r6180274 r6cebfef  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  2 20:30:30 2022
    13 // Update Count     : 541
     12// Last Modified On : Fri Mar 12 19:00:42 2021
     13// Update Count     : 536
    1414//
    1515#include "CodeGenerator.h"
     
    4242        bool wantSpacing( Statement * stmt) {
    4343                return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) ||
    44                         dynamic_cast< WhileDoStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );
     44                        dynamic_cast< WhileStmt * >( stmt ) || dynamic_cast< ForStmt * >( stmt ) || dynamic_cast< SwitchStmt *>( stmt );
    4545        }
    4646
     
    955955                output << " ) ";
    956956
    957                 ifStmt->get_then()->accept( *visitor );
    958 
    959                 if ( ifStmt->get_else() != 0) {
     957                ifStmt->get_thenPart()->accept( *visitor );
     958
     959                if ( ifStmt->get_elsePart() != 0) {
    960960                        output << " else ";
    961                         ifStmt->get_else()->accept( *visitor );
     961                        ifStmt->get_elsePart()->accept( *visitor );
    962962                } // if
    963963        }
     
    10201020                        output << "fallthru";
    10211021                        break;
    1022                   default: ;                                                                    // prevent warning
    10231022                } // switch
    10241023                // print branch target for labelled break/continue/fallthru in debug mode
     
    11261125        }
    11271126
    1128         void CodeGenerator::postvisit( WhileDoStmt * whileDoStmt ) {
    1129                 if ( whileDoStmt->get_isDoWhile() ) {
     1127        void CodeGenerator::postvisit( WhileStmt * whileStmt ) {
     1128                if ( whileStmt->get_isDoWhile() ) {
    11301129                        output << "do";
    11311130                } else {
    11321131                        output << "while (";
    1133                         whileDoStmt->get_condition()->accept( *visitor );
     1132                        whileStmt->get_condition()->accept( *visitor );
    11341133                        output << ")";
    11351134                } // if
    11361135                output << " ";
    11371136
    1138                 output << CodeGenerator::printLabels( whileDoStmt->get_body()->get_labels() );
    1139                 whileDoStmt->get_body()->accept( *visitor );
     1137                output << CodeGenerator::printLabels( whileStmt->get_body()->get_labels() );
     1138                whileStmt->get_body()->accept( *visitor );
    11401139
    11411140                output << indent;
    11421141
    1143                 if ( whileDoStmt->get_isDoWhile() ) {
     1142                if ( whileStmt->get_isDoWhile() ) {
    11441143                        output << " while (";
    1145                         whileDoStmt->get_condition()->accept( *visitor );
     1144                        whileStmt->get_condition()->accept( *visitor );
    11461145                        output << ");";
    11471146                } // if
Note: See TracChangeset for help on using the changeset viewer.