- Timestamp:
- Nov 25, 2020, 3:14:30 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:
- 0292aa4, 1389810
- Parents:
- e5c3811 (diff), bb87dd0 (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. - Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
re5c3811 r4702a2c 299 299 }; 300 300 301 /// Whether a cast existed in the program source or not 301 /// Inidicates whether the cast is introduced by the CFA type system. 302 /// GeneratedCast for casts that the resolver introduces to force a return type 303 /// ExplicitCast for casts from user code 304 /// ExplicitCast for casts from desugaring advanced CFA features into simpler CFA 305 /// example 306 /// int * p; // declaration 307 /// (float *) p; // use, with subject cast 308 /// subject cast being GeneratedCast means we are considering an interpretation with a type mismatch 309 /// subject cast being ExplicitCast means someone in charge wants it that way 302 310 enum GeneratedFlag { ExplicitCast, GeneratedCast }; 303 311 -
src/InitTweak/FixInit.h
re5c3811 r4702a2c 21 21 class Declaration; 22 22 namespace ast { 23 classTranslationUnit;23 struct TranslationUnit; 24 24 } 25 25 -
src/Parser/ParseNode.h
re5c3811 r4702a2c 37 37 class Attribute; 38 38 class Declaration; 39 classDeclarationNode;39 struct DeclarationNode; 40 40 class DeclarationWithType; 41 41 class ExpressionNode; 42 42 class Initializer; 43 classStatementNode;43 struct StatementNode; 44 44 45 45 //############################################################################## -
src/ResolvExpr/CandidateFinder.cpp
re5c3811 r4702a2c 1101 1101 // unification run for side-effects 1102 1102 unify( toType, cand->expr->result, cand->env, need, have, open, symtab ); 1103 Cost thisCost = castCost( cand->expr->result, toType, cand->expr->get_lvalue(), 1104 symtab, cand->env ); 1103 Cost thisCost = 1104 (castExpr->isGenerated == ast::GeneratedFlag::GeneratedCast) 1105 ? conversionCost( cand->expr->result, toType, cand->expr->get_lvalue(), symtab, cand->env ) 1106 : castCost( cand->expr->result, toType, cand->expr->get_lvalue(), symtab, cand->env ); 1107 1105 1108 PRINT( 1106 1109 std::cerr << "working on cast with result: " << toType << std::endl; … … 1591 1594 1592 1595 // unification run for side-effects 1593 unify( toType, cand->expr->result, env, need, have, open, symtab ); 1596 bool canUnify = unify( toType, cand->expr->result, env, need, have, open, symtab ); 1597 (void) canUnify; 1594 1598 Cost thisCost = computeConversionCost( cand->expr->result, toType, cand->expr->get_lvalue(), 1599 symtab, env ); 1600 PRINT( 1601 Cost legacyCost = castCost( cand->expr->result, toType, cand->expr->get_lvalue(), 1595 1602 symtab, env ); 1596 1603 std::cerr << "Considering initialization:"; 1604 std::cerr << std::endl << " FROM: " << cand->expr->result << std::endl; 1605 std::cerr << std::endl << " TO: " << toType << std::endl; 1606 std::cerr << std::endl << " Unification " << (canUnify ? "succeeded" : "failed"); 1607 std::cerr << std::endl << " Legacy cost " << legacyCost; 1608 std::cerr << std::endl << " New cost " << thisCost; 1609 std::cerr << std::endl; 1610 ) 1597 1611 if ( thisCost != Cost::infinity ) { 1598 1612 // count one safe conversion for each value that is thrown away -
src/ResolvExpr/Resolver.h
re5c3811 r4702a2c 35 35 class StmtExpr; 36 36 class SymbolTable; 37 classTranslationUnit;37 struct TranslationUnit; 38 38 class Type; 39 39 class TypeEnvironment; … … 63 63 ast::ptr< ast::Expr > resolveInVoidContext( 64 64 const ast::Expr * expr, const ast::SymbolTable & symtab, ast::TypeEnvironment & env ); 65 /// Resolve `untyped` to the single expression whose candidate is the best match for the 65 /// Resolve `untyped` to the single expression whose candidate is the best match for the 66 66 /// given type. 67 67 ast::ptr< ast::Expr > findSingleExpression(
Note: See TracChangeset
for help on using the changeset viewer.