Ignore:
Timestamp:
May 29, 2019, 9:09:30 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
466fa01
Parents:
c786e1d (diff), d88f8b3b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/DeclReplacer.h

    rc786e1d r6054b18  
    2626        typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap;
    2727        typedef std::map< TypeDecl *, TypeDecl * > TypeMap;
     28        typedef std::map< DeclarationWithType *, Expression * > ExprMap;
    2829
    2930        void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false );
    3031        void replace( BaseSyntaxNode * node, const TypeMap & typeMap, bool debug = false );
    3132        void replace( BaseSyntaxNode * node, const DeclMap & declMap, const TypeMap & typeMap, bool debug = false );
     33
     34        void replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug = false);
     35        template<typename T>
     36                void replace( T *& node, const ExprMap & exprMap, bool debug = false ) {
     37                if ( ! node ) return;
     38                BaseSyntaxNode * arg = node;
     39                replace( arg, exprMap, debug );
     40                node = dynamic_cast<T *>( arg );
     41                assertf( node, "DeclReplacer fundamentally changed the type of its argument." );
     42        }
    3243}
    3344
Note: See TracChangeset for help on using the changeset viewer.