Changeset a783c74


Ignore:
Timestamp:
Mar 11, 2026, 5:47:25 PM (44 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
43b6516
Parents:
4c5ce70
Message:

update documentation for hoisting of loop declarations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/HoistControlDecls.cpp

    r4c5ce70 ra783c74  
    99// Author           : Andrew Beach
    1010// Created On       : Fri Dec  3 15:34:00 2021
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jul 24 12:00:00 2024
    13 // Update Count     : 3
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Mar  5 13:40:58 2026
     13// Update Count     : 80
    1414//
    1515
     
    2929        // If no hoisting is needed (no declaration), then make no changes.
    3030        if ( stmt->inits.size() == 0 ) {
    31                 // if ( /* no conditional declarations */ ...  ) ...
     31                // while ( /* no conditional declarations */ ...  ) ...
    3232                return stmt;
    3333        }
    3434
    3535        StmtT * mutStmt = mutate( stmt );
     36
    3637        CompoundStmt * block = new CompoundStmt( stmt->location );
    3738        //    {}
    3839
    39         //    Label: if ( int x = f(), y = g(); ... ) ...
     40        //    Label: while ( int x = f(), y = g(); ... ) ...
    4041        // link declarations into compound statement
    4142        for ( const Stmt * next : mutStmt->inits ) {
     
    5455        //        int y = g();
    5556        //    }
    56         //    if ( ... ) ...
     57        //    while ( ... ) ...
    5758
    5859        block->kids.push_back( mutStmt );
     
    6061        //        int x = f();
    6162        //        int y = g();
    62         //        if ( ... ) ...
     63        //        while ( ... ) ...
    6364        //    }
     65
    6466        return block;
    6567}
Note: See TracChangeset for help on using the changeset viewer.