Changeset 8d70648 for src/ResolvExpr
- Timestamp:
- May 30, 2019, 4:15:08 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a935892, f474e91
- Parents:
- d76c588 (diff), d88f8b3b (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/Resolver.cc
rd76c588 r8d70648 45 45 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 46 46 #include "Tuples/Tuples.h" 47 #include "Validate/FindSpecialDecls.h" // for SizeType 47 48 48 49 using namespace std; … … 237 238 winner.cost = winner.cvtCost; 238 239 } 239 240 240 241 // produce ambiguous errors, if applicable 241 242 if ( winners.size() != 1 ) { … … 257 258 258 259 // xxx - check for ambiguous expressions 259 260 260 261 // output selected choice 261 262 alt = std::move( choice ); … … 421 422 void Resolver_old::handlePtrType( PtrType * type ) { 422 423 if ( type->get_dimension() ) { 423 findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer );424 findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer ); 424 425 } 425 426 } … … 446 447 // default value expressions have an environment which shouldn't be there and trips up 447 448 // later passes. 448 // xxx - it might be necessary to somehow keep the information from this environment, but I 449 // xxx - it might be necessary to somehow keep the information from this environment, but I 449 450 // can't currently see how it's useful. 450 451 for ( Declaration * d : functionDecl->type->parameters ) { … … 797 798 initExpr->expr = nullptr; 798 799 std::swap( initExpr->env, newExpr->env ); 799 // InitExpr may have inferParams in the case where the expression specializes a function 800 // pointer, and newExpr may already have inferParams of its own, so a simple swap is not 800 // InitExpr may have inferParams in the case where the expression specializes a function 801 // pointer, and newExpr may already have inferParams of its own, so a simple swap is not 801 802 // sufficient. 802 803 newExpr->spliceInferParams( initExpr ); 803 804 delete initExpr; 804 805 805 // get the actual object's type (may not exactly match what comes back from the resolver 806 // get the actual object's type (may not exactly match what comes back from the resolver 806 807 // due to conversions) 807 808 Type * initContext = currentObject.getCurrentType(); … … 816 817 if ( isCharType( pt->get_base() ) ) { 817 818 if ( CastExpr * ce = dynamic_cast< CastExpr * >( newExpr ) ) { 818 // strip cast if we're initializing a char[] with a char *, 819 // strip cast if we're initializing a char[] with a char *, 819 820 // e.g. char x[] = "hello"; 820 821 newExpr = ce->get_arg(); … … 839 840 // move cursor into brace-enclosed initializer-list 840 841 currentObject.enterListInit(); 841 // xxx - fix this so that the list isn't copied, iterator should be used to change current 842 // xxx - fix this so that the list isn't copied, iterator should be used to change current 842 843 // element 843 844 std::list<Designation *> newDesignations; 844 845 for ( auto p : group_iterate(listInit->get_designations(), listInit->get_initializers()) ) { 845 // iterate designations and initializers in pairs, moving the cursor to the current 846 // iterate designations and initializers in pairs, moving the cursor to the current 846 847 // designated object and resolving the initializer against that object. 847 848 Designation * des = std::get<0>(p);
Note: See TracChangeset
for help on using the changeset viewer.