Changeset ef1da0e2 for src/ResolvExpr/ConversionCost.cc
- Timestamp:
- Sep 20, 2022, 6:34:55 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 79ae13d, a065f1f
- Parents:
- 8f1e035
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
r8f1e035 ref1da0e2 22 22 #include "ResolvExpr/Cost.h" // for Cost 23 23 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 24 #include "ResolvExpr/Unify.h" 24 25 #include "SymTab/Indexer.h" // for Indexer 25 26 #include "SynTree/Declaration.h" // for TypeDecl, NamedTypeDecl 26 27 #include "SynTree/Type.h" // for Type, BasicType, TypeInstType 27 28 #include "typeops.h" // for typesCompatibleIgnoreQualifiers 29 28 30 29 31 namespace ResolvExpr { … … 655 657 cost = Cost::safe; 656 658 } 657 } else { 659 } 660 /* 661 else if ( const ast::FunctionType * dstFunc = dstAsPtr->base.as<ast::FunctionType>()) { 662 if (const ast::FunctionType * srcFunc = pointerType->base.as<ast::FunctionType>()) { 663 if (dstFunc->params.empty() && dstFunc->isVarArgs ) { 664 cost = Cost::unsafe; // assign any function to variadic fptr 665 } 666 } 667 else { 668 ast::AssertionSet need, have; // unused 669 ast::OpenVarSet open; 670 env.extractOpenVars(open); 671 ast::TypeEnvironment tenv = env; 672 if ( unify(dstAsPtr->base, pointerType->base, tenv, need, have, open, symtab) ) { 673 cost = Cost::safe; 674 } 675 } 676 // else infinity 677 } 678 */ 679 else { 658 680 int assignResult = ptrsAssignable( pointerType->base, dstAsPtr->base, env ); 659 681 if ( 0 < assignResult && tq1 <= tq2 ) {
Note: See TracChangeset
for help on using the changeset viewer.