Changeset 4b2589a


Ignore:
Timestamp:
Jun 29, 2016, 12:41:56 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, with_gc
Children:
85f0713
Parents:
982d63f
Message:

clean up comments, remove dead code

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r982d63f r4b2589a  
    750750        void CodeGenerator::visit( ReturnStmt *returnStmt ) {
    751751                output << "return ";
    752 
    753                 // xxx -- check for null expression;
    754                 if ( returnStmt->get_expr() ) {
    755                         returnStmt->get_expr()->accept( *this );
    756                 } // if
     752                maybeAccept( returnStmt->get_expr(), *this );
    757753                output << ";";
    758754        }
  • src/ControlStruct/MLEMutator.cc

    r982d63f r4b2589a  
    166166                        throw SemanticError("The label defined in the exit loop statement does not exist: " + originalTarget );  // shouldn't happen (since that's already checked)
    167167                }
    168 
    169                 // xxx - possibly remove this
    170                 // what about exiting innermost block or switch???
    171                 // if ( enclosingControlStructures.back() == (*targetEntry) )
    172                 //      return branchStmt;                              // exit the innermost loop (labels unnecessary)
    173168
    174169                // branch error checks, get the appropriate label name and create a goto
  • src/InitTweak/FixInit.cc

    r982d63f r4b2589a  
    496496
    497497                void ObjDeclCollector::visit( DeclStmt *stmt ) {
     498                        // keep track of all variables currently in scope
    498499                        if ( ObjectDecl * objDecl = dynamic_cast< ObjectDecl * > ( stmt->get_decl() ) ) {
    499500                                curVars.insert( objDecl );
     
    503504
    504505                void LabelFinder::handleStmt( Statement * stmt ) {
     506                        // for each label, remember the variables in scope at that label.
    505507                        for ( Label l : stmt->get_labels() ) {
    506508                                vars[l] = curVars;
     
    549551                        Parent::visit( compoundStmt );
    550552
     553                        // add destructors for the current scope that we're exiting
    551554                        std::list< Statement * > & statements = compoundStmt->get_kids();
    552555                        insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) );
    553 
    554                         // xxx - ??
    555                         // deleteAll( dtorStmts.back() );
    556556                        reverseDeclOrder.pop_front();
    557557                }
    558558
    559559                void InsertDtors::visit( ReturnStmt * returnStmt ) {
     560                        // return exits all scopes, so dump destructors for all scopes
    560561                        for ( OrderedDecls & od : reverseDeclOrder ) {
    561562                                insertDtors( od.begin(), od.end(), back_inserter( stmtsToAdd ) );
  • src/SynTree/Label.h

    r982d63f r4b2589a  
    2121#include <iostream>
    2222#include "SynTree.h"
    23 
    24 // Label needs to know
    25 // * how deeply nested it is (scopeLevel)
    26 // * relative position in a scope compared with other labels (index?)
    27 // * either the original label it was generated from or the labels it generates (for labelled break/continue)
    2823
    2924class Label {
Note: See TracChangeset for help on using the changeset viewer.