Changeset bf4fe05 for src/ResolvExpr/CandidateFinder.cpp
- Timestamp:
- May 13, 2024, 7:07:06 AM (17 months ago)
- Branches:
- master
- Children:
- ca4f2b2
- Parents:
- ec20ab9 (diff), 5f225f5 (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/ResolvExpr/CandidateFinder.cpp
rec20ab9 rbf4fe05 17 17 18 18 #include <deque> 19 #include <iterator> // for back_inserter19 #include <iterator> // for back_inserter 20 20 #include <sstream> 21 21 #include <string> … … 25 25 #include "AdjustExprType.hpp" 26 26 #include "Candidate.hpp" 27 #include "CastCost.hpp" // for castCost27 #include "CastCost.hpp" // for castCost 28 28 #include "CompilationState.hpp" 29 #include "ConversionCost.h " // for conversionCast30 #include "Cost.h "29 #include "ConversionCost.hpp" // for conversionCast 30 #include "Cost.hpp" 31 31 #include "ExplodedArg.hpp" 32 32 #include "PolyCost.hpp" 33 #include "RenameVars.h " // for renameTyVars34 #include "Resolver.h "35 #include "ResolveTypeof.h "33 #include "RenameVars.hpp" // for renameTyVars 34 #include "Resolver.hpp" 35 #include "ResolveTypeof.hpp" 36 36 #include "SatisfyAssertions.hpp" 37 37 #include "SpecCost.hpp" 38 #include " typeops.h" // for combos39 #include "Unify.h "40 #include "WidenMode.h "38 #include "Typeops.hpp" // for combos 39 #include "Unify.hpp" 40 #include "WidenMode.hpp" 41 41 #include "AST/Expr.hpp" 42 42 #include "AST/Node.hpp" … … 45 45 #include "AST/SymbolTable.hpp" 46 46 #include "AST/Type.hpp" 47 #include "Common/ utility.h" // for move, copy48 #include "SymTab/Mangler.h "49 #include "Tuples/Tuples.h " // for handleTupleAssignment50 #include "InitTweak/InitTweak.h " // for getPointerBase51 52 #include "Common/Stats/Counter.h "47 #include "Common/Utility.hpp" // for move, copy 48 #include "SymTab/Mangler.hpp" 49 #include "Tuples/Tuples.hpp" // for handleTupleAssignment 50 #include "InitTweak/InitTweak.hpp" // for getPointerBase 51 52 #include "Common/Stats/Counter.hpp" 53 53 54 54 #include "AST/Inspect.hpp" // for getFunctionName … … 2138 2138 } 2139 2139 2140 // get the valueE(...) ApplicationExpr that returns the enum value2141 const ast::Expr * getValueEnumCall(2142 const ast::Expr * expr,2143 const ResolvExpr::ResolveContext & context, const ast::TypeEnvironment & env ) {2144 auto callExpr = new ast::UntypedExpr(2145 expr->location, new ast::NameExpr( expr->location, "valueE"), {expr} );2146 CandidateFinder finder( context, env );2147 finder.find( callExpr );2148 CandidateList winners = findMinCost( finder.candidates );2149 if (winners.size() != 1) {2150 SemanticError( callExpr, "Ambiguous expression in valueE..." );2151 }2152 CandidateRef & choice = winners.front();2153 return choice->expr;2154 }2155 2156 2140 const ast::Expr * createCondExpr( const ast::Expr * expr ) { 2157 2141 assert( expr );
Note:
See TracChangeset
for help on using the changeset viewer.