Changeset 265e460 for src/GenPoly/ScrubTyVars.h
- Timestamp:
- Oct 8, 2022, 9:43:21 AM (3 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScrubTyVars.h
r815943f r265e460 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Aug 19 14:14:00 202213 // Update Count : 312 // Last Modified On : Fri Oct 7 15:51:00 2022 13 // Update Count : 4 14 14 // 15 15 … … 109 109 } 110 110 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. 114 template<typename node_t> 115 node_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. 124 template<typename node_t> 125 ast::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 111 131 /// For all polymorphic types, replaces generic types, with the appropriate 112 132 /// void type, and sizeof/alignof expressions with the proper variable. 113 133 template<typename node_t> 114 134 node_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 ) ); 116 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 ); 117 147 118 148 template<>
Note:
See TracChangeset
for help on using the changeset viewer.