Changes in src/GenPoly/ScrubTyVars.h [ea2ed3a:fad1f14]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScrubTyVars.h
rea2ed3a rfad1f14 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Dec 7 16:57:00 202213 // Update Count : 512 // Last Modified On : Fri Oct 7 15:51:00 2022 13 // Update Count : 4 14 14 // 15 15 … … 109 109 } 110 110 111 // ScrubMode and scrubTypeVarsBase are internal.112 enum class ScrubMode { FromMap, DynamicFromMap, All };113 114 const ast::Node * scrubTypeVarsBase(115 const ast::Node * target, const TypeVarMap * typeVars, ScrubMode mode );116 117 118 111 /// For all polymorphic types with type variables in `typeVars`, 119 112 /// replaces generic types, dtypes, and ftypes with the appropriate void type, … … 123 116 node_t const * target, const TypeVarMap & typeVars ) { 124 117 return strict_dynamic_cast<node_t const *>( 125 scrubTypeVars Base( target, &typeVars, ScrubMode::FromMap) );118 scrubTypeVars<ast::Node>( target, typeVars ) ); 126 119 } 127 120 … … 130 123 /// and sizeof/alignof expressions with the proper variable. 131 124 template<typename node_t> 132 node_tconst * scrubTypeVarsDynamic(125 ast::Node const * scrubTypeVarsDynamic( 133 126 node_t const * target, const TypeVarMap & typeVars ) { 134 127 return strict_dynamic_cast<node_t const *>( 135 scrubTypeVars Base( target, &typeVars, ScrubMode::DynamicFromMap) );128 scrubTypeVarsDynamic<ast::Node>( target, typeVars ) ); 136 129 } 137 130 … … 141 134 node_t const * scrubAllTypeVars( node_t const * target ) { 142 135 return strict_dynamic_cast<node_t const *>( 143 scrub TypeVarsBase( target, nullptr, ScrubMode::All) );136 scrubAllTypeVars<ast::Node>( target ) ); 144 137 } 138 139 // We specialize for Node as a base case. 140 template<> 141 ast::Node const * scrubTypeVars<ast::Node>( 142 const ast::Node * target, const TypeVarMap & typeVars ); 143 144 template<> 145 ast::Node const * scrubTypeVarsDynamic<ast::Node>( 146 ast::Node const * target, const TypeVarMap & typeVars ); 147 148 template<> 149 ast::Node const * scrubAllTypeVars<ast::Node>( const ast::Node * target ); 145 150 146 151 } // namespace GenPoly
Note: See TracChangeset
for help on using the changeset viewer.