Changeset eb8d791
- Timestamp:
- Apr 12, 2023, 3:10:28 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 52f9804
- Parents:
- 153d3440
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInitNew.cpp
r153d3440 reb8d791 1312 1312 // xxx - functions returning ast::ptr seems wrong... 1313 1313 auto res = ResolvExpr::findVoidExpression( untypedExpr, { symtab, transUnit().global } ); 1314 // Fix CodeLocation (at least until resolver is fixed). 1315 auto fix = localFillCodeLocations( untypedExpr->location, res.release() ); 1316 return strict_dynamic_cast<const ast::Expr *>( fix ); 1314 return res.release(); 1317 1315 } 1318 1316 -
src/ResolvExpr/CandidateFinder.cpp
r153d3440 reb8d791 279 279 /// Instantiates an argument to match a parameter, returns false if no matching results left 280 280 bool instantiateArgument( 281 const CodeLocation & location, 281 282 const ast::Type * paramType, const ast::Init * init, const ExplodedArgs_new & args, 282 283 std::vector< ArgPack > & results, std::size_t & genStart, const ast::SymbolTable & symtab, … … 289 290 // xxx - dropping initializer changes behaviour from previous, but seems correct 290 291 // ^^^ need to handle the case where a tuple has a default argument 291 if ( ! instantiateArgument( 292 if ( ! instantiateArgument( location, 292 293 type, nullptr, args, results, genStart, symtab, nTuples ) ) return false; 293 294 nTuples = 0; … … 341 342 // push empty tuple expression 342 343 newResult.parent = i; 343 newResult.expr = new ast::TupleExpr { CodeLocation{}, {} };344 newResult.expr = new ast::TupleExpr( location, {} ); 344 345 argType = newResult.expr->result; 345 346 } else { … … 614 615 /// Builds a list of candidates for a function, storing them in out 615 616 void makeFunctionCandidates( 617 const CodeLocation & location, 616 618 const CandidateRef & func, const ast::FunctionType * funcType, 617 619 const ExplodedArgs_new & args, CandidateList & out ); … … 732 734 /// Builds a list of candidates for a function, storing them in out 733 735 void Finder::makeFunctionCandidates( 736 const CodeLocation & location, 734 737 const CandidateRef & func, const ast::FunctionType * funcType, 735 738 const ExplodedArgs_new & args, CandidateList & out … … 768 771 for (size_t i=0; i<nParams; ++i) { 769 772 auto obj = funcDecl->params[i].strict_as<ast::ObjectDecl>(); 770 if (!instantiateArgument( 773 if (!instantiateArgument( location, 771 774 funcType->params[i], obj->init, args, results, genStart, symtab)) return; 772 775 } … … 778 781 // matches 779 782 // no default args for indirect calls 780 if ( ! instantiateArgument( 783 if ( ! instantiateArgument( location, 781 784 param, nullptr, args, results, genStart, symtab ) ) return; 782 785 } … … 1007 1010 newFunc->expr = 1008 1011 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); 1009 makeFunctionCandidates( newFunc, function, argExpansions, found ); 1012 makeFunctionCandidates( untypedExpr->location, 1013 newFunc, function, argExpansions, found ); 1010 1014 } 1011 1015 } else if ( … … 1017 1021 newFunc->expr = 1018 1022 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); 1019 makeFunctionCandidates( newFunc, function, argExpansions, found ); 1023 makeFunctionCandidates( untypedExpr->location, 1024 newFunc, function, argExpansions, found ); 1020 1025 } 1021 1026 } … … 1043 1048 newOp->expr = 1044 1049 referenceToRvalueConversion( newOp->expr, newOp->cost ); 1045 makeFunctionCandidates( newOp, function, argExpansions, found ); 1050 makeFunctionCandidates( untypedExpr->location, 1051 newOp, function, argExpansions, found ); 1046 1052 } 1047 1053 } -
src/ResolvExpr/ExplodedArg.hpp
r153d3440 reb8d791 35 35 ExplodedArg() : env(), cost( Cost::zero ), exprs() {} 36 36 ExplodedArg( const Candidate & arg, const ast::SymbolTable & symtab ); 37 37 38 38 ExplodedArg( ExplodedArg && ) = default; 39 39 ExplodedArg & operator= ( ExplodedArg && ) = default; -
src/main.cc
r153d3440 reb8d791 310 310 311 311 PASS( "Hoist Type Decls", Validate::hoistTypeDecls( transUnit ) ); 312 // Hoist Type Decls pulls some declarations out of contexts where313 // locations are not tracked. Perhaps they should be, but for now314 // the full fill solves it.315 forceFillCodeLocations( transUnit );316 312 317 313 PASS( "Translate Exception Declarations", ControlStruct::translateExcept( transUnit ) ); … … 343 339 PASS( "Implement Actors", Concurrency::implementActors( transUnit ) ); 344 340 PASS( "Implement Virtual Destructors", Virtual::implementVirtDtors(transUnit) ); 345 346 341 PASS( "Implement Mutex", Concurrency::implementMutex( transUnit ) ); 347 342 PASS( "Implement Thread Start", Concurrency::implementThreadStarter( transUnit ) ); … … 396 391 return EXIT_SUCCESS; 397 392 } // if 398 399 forceFillCodeLocations( transUnit );400 393 401 394 PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
Note: See TracChangeset
for help on using the changeset viewer.