Ignore:
Timestamp:
May 19, 2015, 7:57:09 AM (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:
a08ba92
Parents:
51587aa
Message:

licencing: fifth groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/GenPoly/ScrubTyVars.h

    r51587aa r01aeade  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // XXX.cc --
     7// ScrubTyVars.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 07:48:14 2015
     13// Update Count     : 1
    1414//
    15 #ifndef GENPOLY_SCRUBTYVARS_H
    16 #define GENPOLY_SCRUBTYVARS_H
     15
     16#ifndef _SCRUBTYVARS_H
     17#define _SCRUBTYVARS_H
    1718
    1819#include "GenPoly.h"
     
    2223
    2324namespace GenPoly {
    24     class ScrubTyVars : public Mutator {
    25       public:
    26         ScrubTyVars( bool doAll, const TyVarMap &tyVars ): doAll( doAll ), tyVars( tyVars ) {}
     25        class ScrubTyVars : public Mutator {
     26          public:
     27                ScrubTyVars( bool doAll, const TyVarMap &tyVars ): doAll( doAll ), tyVars( tyVars ) {}
    2728 
     29                template< typename SynTreeClass >
     30                static SynTreeClass *scrub( SynTreeClass *target, const TyVarMap &tyVars );
     31                template< typename SynTreeClass >
     32                static SynTreeClass *scrub( SynTreeClass *target );
     33 
     34                virtual Type* mutate( TypeInstType *typeInst );
     35                Expression* mutate( SizeofExpr *szeof );
     36                virtual Type* mutate( PointerType *pointer );
     37          private:
     38                bool doAll;
     39                const TyVarMap &tyVars;
     40        };
     41
     42        /* static class method */
    2843        template< typename SynTreeClass >
    29         static SynTreeClass *scrub( SynTreeClass *target, const TyVarMap &tyVars );
     44        SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target, const TyVarMap &tyVars ) {
     45                ScrubTyVars scrubber( false, tyVars );
     46                return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) );
     47        }
     48
     49        /* static class method */
    3050        template< typename SynTreeClass >
    31         static SynTreeClass *scrub( SynTreeClass *target );
    32  
    33         virtual Type* mutate( TypeInstType *typeInst );
    34         Expression* mutate( SizeofExpr *szeof );
    35         virtual Type* mutate( PointerType *pointer );
    36       private:
    37         bool doAll;
    38         const TyVarMap &tyVars;
    39     };
    40 
    41     /* static class method */
    42     template< typename SynTreeClass >
    43     SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target, const TyVarMap &tyVars ) {
    44         ScrubTyVars scrubber( false, tyVars );
    45         return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) );
    46     }
    47 
    48     /* static class method */
    49     template< typename SynTreeClass >
    50     SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target ) {
    51         TyVarMap tyVars;
    52         ScrubTyVars scrubber( true, tyVars );
    53         return static_cast< SynTreeClass* >( target->acceptMutator( scrubber ) );
    54     }
     51        SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target ) {
     52                TyVarMap tyVars;
     53                ScrubTyVars scrubber( true, tyVars );
     54                return static_cast< SynTreeClass* >( target->acceptMutator( scrubber ) );
     55        }
    5556} // namespace GenPoly
    5657
    57 #endif // GENPOLY_SCRUBTYVARS_H
     58#endif // _SCRUBTYVARS_H
     59
    5860// Local Variables: //
    5961// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.