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