Ignore:
Timestamp:
May 19, 2015, 4:58:14 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, 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, string, with_gc
Children:
843054c2
Parents:
01aeade
Message:

licencing: sixth groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/InitTweak/InitExpander.h

    r01aeade ra08ba92  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // XXX.cc --
     7// InitExpander.h --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By :
    12 // Last Modified On :
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue May 19 16:35:33 2015
     13// Update Count     : 2
    1414//
     15
    1516#ifndef _INIT_EXPANDER_H_
    1617#define _INIT_EXPANDER_H_
     
    2728
    2829namespace InitTweak {
     30        class InitExpander : public Mutator {
     31                typedef Mutator Parent;
     32          public:
     33                InitExpander();
     34                ~InitExpander();
    2935
    30   class InitExpander : public Mutator
    31   {
    32     typedef Mutator Parent;
     36                virtual ObjectDecl *mutate( ObjectDecl * );
    3337
    34   public:
    35     InitExpander();
    36     ~InitExpander();
     38                // indexer runs
     39                virtual FunctionDecl   *mutate( FunctionDecl *functionDecl ) {
     40                        functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
     41                        mutateAll( functionDecl->get_oldDecls(), *this );
     42                        functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    3743
    38     virtual ObjectDecl *mutate( ObjectDecl * );
     44                        index.visit( functionDecl );
     45                        return functionDecl;
     46                }
    3947
    40     // indexer runs
    41     virtual FunctionDecl   *mutate( FunctionDecl *functionDecl )
    42     {
    43       functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) );
    44       mutateAll( functionDecl->get_oldDecls(), *this );
    45       functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
     48                virtual TypeDecl *mutate( TypeDecl *typeDecl )
     49                        { index.visit( typeDecl ); return typeDecl; }
     50                virtual TypedefDecl *mutate( TypedefDecl *typeDecl )
     51                        { index.visit( typeDecl ); return typeDecl; }
     52                virtual StructDecl *mutate( StructDecl *aggregateDecl )
     53                        { index.visit( aggregateDecl ); return aggregateDecl; }
     54                virtual UnionDecl *mutate( UnionDecl *aggregateDecl )
     55                        { index.visit( aggregateDecl ); return aggregateDecl; }
     56                virtual EnumDecl *mutate( EnumDecl *aggregateDecl )
     57                        { index.visit( aggregateDecl ); return aggregateDecl; }
    4658
    47       index.visit( functionDecl );
    48       return functionDecl;
    49     }
    50 
    51     virtual TypeDecl       *mutate( TypeDecl *typeDecl )
    52     { index.visit( typeDecl ); return typeDecl; }
    53     virtual TypedefDecl    *mutate( TypedefDecl *typeDecl )
    54     { index.visit( typeDecl ); return typeDecl; }
    55     virtual StructDecl     *mutate( StructDecl *aggregateDecl )
    56     { index.visit( aggregateDecl ); return aggregateDecl; }
    57     virtual UnionDecl      *mutate( UnionDecl *aggregateDecl )
    58     { index.visit( aggregateDecl ); return aggregateDecl; }
    59     virtual EnumDecl       *mutate( EnumDecl *aggregateDecl )
    60     { index.visit( aggregateDecl ); return aggregateDecl; }
    61 
    62     virtual Type           *mutate( StructInstType *aggrInst )
    63     { index.visit( aggrInst ); return aggrInst; }
    64     virtual Type           *mutate( UnionInstType *aggrInst )
    65     { index.visit( aggrInst ); return aggrInst; }
    66 
    67   private:
    68     SymTab::Indexer index;
    69   };  // class InitExpander
    70 
     59                virtual Type *mutate( StructInstType *aggrInst )
     60                        { index.visit( aggrInst ); return aggrInst; }
     61                virtual Type *mutate( UnionInstType *aggrInst )
     62                        { index.visit( aggrInst ); return aggrInst; }
     63          private:
     64                SymTab::Indexer index;
     65        };  // class InitExpander
    7166} // namespace InitTweak
    7267
     68#endif // _INIT_EXPANDER_H_
    7369
    74 #endif // #ifndef _INIT_EXPANDER_H_
    75 
    76 /*
    77   Local Variables:
    78   mode: c++
    79   End:
    80 */
    8170// Local Variables: //
    8271// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.