Changeset fc638d2 for src/SynTree


Ignore:
Timestamp:
Dec 13, 2016, 4:13:08 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
7933351
Parents:
f7e749f
Message:

fixed StmtExpr code in PolyMutator, added missing copy constructor, misc documentation

Location:
src/SynTree
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/CompoundStmt.cc

    rf7e749f rfc638d2  
    4949                Statement * origStmt = *origit++;
    5050                if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) {
    51                         DeclStmt * origDeclStmt = dynamic_cast< DeclStmt * >( origStmt );
    52                         assert( origDeclStmt );
     51                        DeclStmt * origDeclStmt = safe_dynamic_cast< DeclStmt * >( origStmt );
    5352                        if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) {
    54                                 DeclarationWithType * origdwt = dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
    55                                 assert( origdwt );
     53                                DeclarationWithType * origdwt = safe_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
    5654                                assert( dwt->get_name() == origdwt->get_name() );
    5755                                declMap[ origdwt ] = dwt;
    58                         }
    59                 }
     56                        } else assert( ! dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ) );
     57                } else assert( ! dynamic_cast< DeclStmt * > ( s ) );
    6058        }
    6159        if ( ! declMap.empty() ) {
  • src/SynTree/Initializer.cc

    rf7e749f rfc638d2  
    6565}
    6666
     67ListInit::ListInit( const ListInit & other ) : Initializer( other ) {
     68        cloneAll( other.initializers, initializers );
     69        cloneAll( other.designators, designators );
     70}
     71
     72
    6773ListInit::~ListInit() {
    6874        deleteAll( initializers );
  • src/SynTree/Initializer.h

    rf7e749f rfc638d2  
    8888        ListInit( const std::list<Initializer*> &initializers,
    8989                          const std::list<Expression *> &designators = std::list< Expression * >(), bool maybeConstructed = false );
     90        ListInit( const ListInit & other );
    9091        virtual ~ListInit();
    9192
  • src/SynTree/VarExprReplacer.cc

    rf7e749f rfc638d2  
    2121// replace variable with new node from decl map
    2222void VarExprReplacer::visit( VariableExpr * varExpr ) {
     23  // xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are)
    2324  if ( declMap.count( varExpr->get_var() ) ) {
    2425    varExpr->set_var( declMap.at( varExpr->get_var() ) );
Note: See TracChangeset for help on using the changeset viewer.