Changeset 7f62b708 for src/ResolvExpr
- Timestamp:
- Jul 5, 2021, 4:57:41 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8f1a99e
- Parents:
- e84ab3d
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
re84ab3d r7f62b708 1302 1302 1303 1303 try { 1304 // Attempt 1 : turn (thread&)X into ( $thread&)X.__thrd1304 // Attempt 1 : turn (thread&)X into (thread$&)X.__thrd 1305 1305 // Clone is purely for memory management 1306 1306 std::unique_ptr<Expression> tech1 { new UntypedMemberExpr(new NameExpr(castExpr->concrete_target.field), castExpr->arg->clone()) }; … … 1313 1313 } catch(SemanticErrorException & ) {} 1314 1314 1315 // Fallback : turn (thread&)X into ( $thread&)get_thread(X)1315 // Fallback : turn (thread&)X into (thread$&)get_thread(X) 1316 1316 std::unique_ptr<Expression> fallback { UntypedExpr::createDeref( new UntypedExpr(new NameExpr(castExpr->concrete_target.getter), { castExpr->arg->clone() })) }; 1317 1317 // don't prune here, since it's guaranteed all alternatives will have the same type -
src/ResolvExpr/CandidateFinder.cpp
re84ab3d r7f62b708 1180 1180 1181 1181 try { 1182 // Attempt 1 : turn (thread&)X into ( $thread&)X.__thrd1182 // Attempt 1 : turn (thread&)X into (thread$&)X.__thrd 1183 1183 // Clone is purely for memory management 1184 1184 std::unique_ptr<const ast::Expr> tech1 { new ast::UntypedMemberExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.field), castExpr->arg) }; … … 1191 1191 } catch(SemanticErrorException & ) {} 1192 1192 1193 // Fallback : turn (thread&)X into ( $thread&)get_thread(X)1193 // Fallback : turn (thread&)X into (thread$&)get_thread(X) 1194 1194 std::unique_ptr<const ast::Expr> fallback { ast::UntypedExpr::createDeref(loc, new ast::UntypedExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.getter), { castExpr->arg })) }; 1195 1195 // don't prune here, since it's guaranteed all alternatives will have the same type
Note: See TracChangeset
for help on using the changeset viewer.