Changeset 73f1b1c
- Timestamp:
- Sep 3, 2020, 11:10:35 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 447b0d2b
- Parents:
- f76ff0b
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
rf76ff0b r73f1b1c 48 48 // 49 49 // Several additional features are available through inheritance 50 // | PureVisitor - makes the visitor pure, it never modifies nodes in place and always 51 // clones nodes it needs to make changes to 50 52 // | WithTypeSubstitution - provides polymorphic const TypeSubstitution * env for the 51 53 // current expression … … 267 269 /// Keep track of the polymorphic const TypeSubstitution * env for the current expression 268 270 269 /// marker to force shallow copies in pass visit271 /// If used the visitor will always clone nodes. 270 272 struct PureVisitor {}; 271 273 -
src/AST/Pass.impl.hpp
rf76ff0b r73f1b1c 21 21 22 22 #include "AST/TypeSubstitution.hpp" 23 // #include "AST/Copy.hpp"24 23 25 24 #define VISIT_START( node ) \ … … 329 328 330 329 if( __pass::differs(old_val, new_val) ) { 331 // auto new_parent = mutate(parent);332 330 auto new_parent = __pass::mutate<core_t>(parent); 333 331 new_parent->*child = new_val; -
src/AST/TypeSubstitution.hpp
rf76ff0b r73f1b1c 46 46 template< typename SynTreeClass > 47 47 struct ApplyResult { 48 // const SynTreeClass * node;49 48 ast::ptr<SynTreeClass> node; 50 49 int count; … … 187 186 assert( input ); 188 187 Pass<Substituter> sub( *this, false ); 189 // input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );190 188 input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) ); 191 189 return { input, sub.core.subCount }; … … 196 194 assert( input ); 197 195 Pass<Substituter> sub( *this, true ); 198 // input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );199 196 input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) ); 200 197 return { input, sub.core.subCount }; -
src/ResolvExpr/Unify.cc
rf76ff0b r73f1b1c 1113 1113 ast::Pass<TtypeExpander_new> expander{ tenv }; 1114 1114 1115 // ast::ptr<ast::TupleType> tuplec = tuple;1116 // ast::ptr<ast::TupleType> tuple2c = tuple2;1117 1115 const ast::Type * flat = tuple->accept( expander ); 1118 1116 const ast::Type * flat2 = tuple2->accept( expander );
Note: See TracChangeset
for help on using the changeset viewer.