Ignore:
Timestamp:
Oct 8, 2022, 9:43:21 AM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
b2ddaf3
Parents:
815943f (diff), d8c96a9 (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/GenPoly/ScrubTyVars.h

    r815943f r265e460  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Aug 19 14:14:00 2022
    13 // Update Count     : 3
     12// Last Modified On : Fri Oct  7 15:51:00 2022
     13// Update Count     : 4
    1414//
    1515
     
    109109        }
    110110
     111/// For all polymorphic types with type variables in `typeVars`,
     112/// replaces generic types, dtypes, and ftypes with the appropriate void type,
     113/// and sizeof/alignof expressions with the proper variable.
     114template<typename node_t>
     115node_t const * scrubTypeVars(
     116                node_t const * target, const TypeVarMap & typeVars ) {
     117        return strict_dynamic_cast<node_t const *>(
     118                        scrubTypeVars<ast::Node>( target ) );
     119}
     120
     121/// For all dynamic-layout types with type variables in `typeVars`,
     122/// replaces generic types, dtypes, and ftypes with the appropriate void type,
     123/// and sizeof/alignof expressions with the proper variable.
     124template<typename node_t>
     125ast::Node const * scrubTypeVarsDynamic(
     126                node_t const * target, const TypeVarMap & typeVars ) {
     127        return strict_dynamic_cast<node_t const *>(
     128                        scrubTypeVarsDynamic<ast::Node>( target, typeVars ) );
     129}
     130
    111131/// For all polymorphic types, replaces generic types, with the appropriate
    112132/// void type, and sizeof/alignof expressions with the proper variable.
    113133template<typename node_t>
    114134node_t const * scrubAllTypeVars( node_t const * target ) {
    115         return strict_dynamic_cast<node_t const *>( scrubAllTypeVars<ast::Node>( target ) );
     135        return strict_dynamic_cast<node_t const *>(
     136                        scrubAllTypeVars<ast::Node>( target ) );
    116137}
     138
     139// We specialize for Node as a base case.
     140template<>
     141ast::Node const * scrubTypeVars<ast::Node>(
     142                const ast::Node * target, const TypeVarMap & typeVars );
     143
     144template<>
     145ast::Node const * scrubTypeVarsDynamic<ast::Node>(
     146                ast::Node const * target, const TypeVarMap & typeVars );
    117147
    118148template<>
Note: See TracChangeset for help on using the changeset viewer.