- File:
-
- 1 edited
-
src/ResolvExpr/CandidateFinder.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
rc92bdcc rb2ea0cd 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 pp" // for conversionCast30 #include "Cost.h pp"29 #include "ConversionCost.h" // for conversionCast 30 #include "Cost.h" 31 31 #include "ExplodedArg.hpp" 32 32 #include "PolyCost.hpp" 33 #include "RenameVars.h pp" // for renameTyVars34 #include "Resolver.h pp"35 #include "ResolveTypeof.h pp"33 #include "RenameVars.h" // for renameTyVars 34 #include "Resolver.h" 35 #include "ResolveTypeof.h" 36 36 #include "SatisfyAssertions.hpp" 37 37 #include "SpecCost.hpp" 38 #include " Typeops.hpp" // for combos39 #include "Unify.h pp"40 #include "WidenMode.h pp"38 #include "typeops.h" // for combos 39 #include "Unify.h" 40 #include "WidenMode.h" 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.hpp" // for move, copy48 #include "SymTab/Mangler.h pp"49 #include "Tuples/Tuples.h pp" // for handleTupleAssignment50 #include "InitTweak/InitTweak.h pp" // for getPointerBase51 52 #include "Common/Stats/Counter.h pp"47 #include "Common/utility.h" // for move, copy 48 #include "SymTab/Mangler.h" 49 #include "Tuples/Tuples.h" // for handleTupleAssignment 50 #include "InitTweak/InitTweak.h" // for getPointerBase 51 52 #include "Common/Stats/Counter.h" 53 53 54 54 #include "AST/Inspect.hpp" // for getFunctionName … … 2138 2138 } 2139 2139 2140 // get the valueE(...) ApplicationExpr that returns the enum value 2141 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 2140 2156 const ast::Expr * createCondExpr( const ast::Expr * expr ) { 2141 2157 assert( expr );
Note:
See TracChangeset
for help on using the changeset viewer.