Changeset 43e0949
- Timestamp:
- Feb 19, 2019, 1:19:47 PM (5 years ago)
- Branches:
- no_list
- Children:
- 2f42718
- Parents:
- 99614c2
- Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r99614c2 r43e0949 330 330 331 331 void CodeGenerator::postvisit( Designation * designation ) { 332 std::list< Expression * > designators = designation->get_designators();332 auto & designators = designation->designators; 333 333 if ( designators.size() == 0 ) return; 334 334 for ( Expression * des : designators ) { … … 354 354 auto initBegin = init->begin(); 355 355 auto initEnd = init->end(); 356 auto desigBegin = init-> get_designations().begin();357 auto desigEnd = init-> get_designations().end();356 auto desigBegin = init->designations.begin(); 357 auto desigEnd = init->designations.end(); 358 358 359 359 output << "{ "; -
src/InitTweak/InitTweak.cc
r99614c2 r43e0949 41 41 // short circuit if we already know there are designations 42 42 if ( hasDesignations ) visit_children = false; 43 else if ( ! des-> get_designators().empty() ) {43 else if ( ! des->designators.empty() ) { 44 44 hasDesignations = true; 45 45 visit_children = false; -
src/Parser/InitializerNode.cc
r99614c2 r43e0949 89 89 if ( aggregate ) { 90 90 // steal designators from children 91 std:: list< Designation * > designlist;91 std::vector< Designation * > designlist; 92 92 InitializerNode * child = next_init(); 93 93 for ( ; child != nullptr; child = dynamic_cast< InitializerNode * >( child->get_next() ) ) { -
src/ResolvExpr/AlternativeFinder.cc
r99614c2 r43e0949 367 367 std::string tmp; 368 368 if ( val >= 0 && (unsigned long long)val < tupleType->size() ) { 369 alternatives.push_back( Alternative{ 369 alternatives.push_back( Alternative{ 370 370 alt, new TupleIndexExpr( expr->clone(), val ), newCost } ); 371 371 } // if … … 474 474 } 475 475 476 // specialization cost of return types can't be accounted for directly, it disables 476 // specialization cost of return types can't be accounted for directly, it disables 477 477 // otherwise-identical calls, like this example based on auto-newline in the I/O lib: 478 478 // … … 1225 1225 // count one safe conversion for each value that is thrown away 1226 1226 thisCost.incSafe( discardedValues ); 1227 Alternative newAlt{ 1228 restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 1227 Alternative newAlt{ 1228 restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 1229 1229 alt.env, openVars, needAssertions, alt.cost, alt.cost + thisCost }; 1230 1230 inferParameters( newAlt, back_inserter( candidates ) ); … … 1290 1290 1291 1291 void AlternativeFinder::Finder::postvisit( NameExpr *nameExpr ) { 1292 std:: list< SymTab::Indexer::IdData > declList;1292 std::vector< SymTab::Indexer::IdData > declList; 1293 1293 indexer.lookupId( nameExpr->name, declList ); 1294 1294 PRINT( std::cerr << "nameExpr is " << nameExpr->name << std::endl; ) … … 1327 1327 if ( sizeofExpr->get_isType() ) { 1328 1328 Type * newType = sizeofExpr->get_type()->clone(); 1329 alternatives.push_back( Alternative{ 1329 alternatives.push_back( Alternative{ 1330 1330 new SizeofExpr{ resolveTypeof( newType, indexer ) }, env } ); 1331 1331 } else { … … 1342 1342 Alternative &choice = winners.front(); 1343 1343 referenceToRvalueConversion( choice.expr, choice.cost ); 1344 alternatives.push_back( Alternative{ 1344 alternatives.push_back( Alternative{ 1345 1345 choice, new SizeofExpr( choice.expr->clone() ), Cost::zero } ); 1346 1346 } // if … … 1350 1350 if ( alignofExpr->get_isType() ) { 1351 1351 Type * newType = alignofExpr->get_type()->clone(); 1352 alternatives.push_back( Alternative{ 1352 alternatives.push_back( Alternative{ 1353 1353 new AlignofExpr{ resolveTypeof( newType, indexer ) }, env } ); 1354 1354 } else { … … 1365 1365 Alternative &choice = winners.front(); 1366 1366 referenceToRvalueConversion( choice.expr, choice.cost ); 1367 alternatives.push_back( Alternative{ 1367 alternatives.push_back( Alternative{ 1368 1368 choice, new AlignofExpr{ choice.expr->clone() }, Cost::zero } ); 1369 1369 } // if … … 1376 1376 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) { 1377 1377 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) { 1378 alternatives.push_back( Alternative{ 1378 alternatives.push_back( Alternative{ 1379 1379 new OffsetofExpr{ aggInst->clone(), dwt }, env } ); 1380 1380 renameTypes( alternatives.back().expr ); … … 1420 1420 Cost cost = Cost::zero; 1421 1421 Expression * newExpr = data.combine( cost ); 1422 alternatives.push_back( Alternative{ 1423 new AttrExpr{ newExpr, argType->clone() }, env, OpenVarSet{}, 1422 alternatives.push_back( Alternative{ 1423 new AttrExpr{ newExpr, argType->clone() }, env, OpenVarSet{}, 1424 1424 AssertionList{}, Cost::zero, cost } ); 1425 1425 for ( DeclarationWithType * retVal : function->returnVals ) { … … 1434 1434 NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() ); 1435 1435 assert( nameExpr ); 1436 std:: list< SymTab::Indexer::IdData > attrList;1436 std::vector< SymTab::Indexer::IdData > attrList; 1437 1437 indexer.lookupId( nameExpr->get_name(), attrList ); 1438 1438 if ( attrExpr->get_isType() || attrExpr->get_expr() ) { … … 1461 1461 Cost cost = Cost::zero; 1462 1462 Expression * newExpr = data.combine( cost ); 1463 alternatives.push_back( Alternative{ 1463 alternatives.push_back( Alternative{ 1464 1464 newExpr, env, OpenVarSet{}, AssertionList{}, Cost::zero, cost } ); 1465 1465 renameTypes( alternatives.back().expr ); … … 1485 1485 cloneAll( second.need, need ); 1486 1486 1487 LogicalExpr *newExpr = new LogicalExpr{ 1487 LogicalExpr *newExpr = new LogicalExpr{ 1488 1488 first.expr->clone(), second.expr->clone(), logicalExpr->get_isAnd() }; 1489 alternatives.push_back( Alternative{ 1490 newExpr, std::move(compositeEnv), std::move(openVars), 1489 alternatives.push_back( Alternative{ 1490 newExpr, std::move(compositeEnv), std::move(openVars), 1491 1491 AssertionList( need.begin(), need.end() ), first.cost + second.cost } ); 1492 1492 } … … 1521 1521 cloneAll( third.need, need ); 1522 1522 AssertionSet have; 1523 1523 1524 1524 // unify true and false types, then infer parameters to produce new alternatives 1525 1525 Type* commonType = nullptr; 1526 if ( unify( second.expr->result, third.expr->result, compositeEnv, 1526 if ( unify( second.expr->result, third.expr->result, compositeEnv, 1527 1527 need, have, openVars, indexer, commonType ) ) { 1528 ConditionalExpr *newExpr = new ConditionalExpr{ 1528 ConditionalExpr *newExpr = new ConditionalExpr{ 1529 1529 first.expr->clone(), second.expr->clone(), third.expr->clone() }; 1530 1530 newExpr->result = commonType ? commonType : second.expr->result->clone(); 1531 1531 // convert both options to the conditional result type 1532 1532 Cost cost = first.cost + second.cost + third.cost; 1533 cost += computeExpressionConversionCost( 1533 cost += computeExpressionConversionCost( 1534 1534 newExpr->arg2, newExpr->result, indexer, compositeEnv ); 1535 cost += computeExpressionConversionCost( 1535 cost += computeExpressionConversionCost( 1536 1536 newExpr->arg3, newExpr->result, indexer, compositeEnv ); 1537 1537 // output alternative 1538 Alternative newAlt{ 1539 newExpr, std::move(compositeEnv), std::move(openVars), 1538 Alternative newAlt{ 1539 newExpr, std::move(compositeEnv), std::move(openVars), 1540 1540 AssertionList( need.begin(), need.end() ), cost }; 1541 1541 inferParameters( newAlt, back_inserter( alternatives ) ); … … 1552 1552 secondFinder.findWithAdjustment( commaExpr->get_arg2() ); 1553 1553 for ( const Alternative & alt : secondFinder.alternatives ) { 1554 alternatives.push_back( Alternative{ 1554 alternatives.push_back( Alternative{ 1555 1555 alt, new CommaExpr{ newFirstArg->clone(), alt.expr->clone() }, alt.cost } ); 1556 1556 } // for … … 1578 1578 1579 1579 Type* commonType = nullptr; 1580 if ( unify( first.expr->result, second.expr->result, compositeEnv, need, have, 1580 if ( unify( first.expr->result, second.expr->result, compositeEnv, need, have, 1581 1581 openVars, indexer, commonType ) ) { 1582 RangeExpr * newExpr = 1582 RangeExpr * newExpr = 1583 1583 new RangeExpr{ first.expr->clone(), second.expr->clone() }; 1584 1584 newExpr->result = commonType ? commonType : first.expr->result->clone(); 1585 Alternative newAlt{ 1586 newExpr, std::move(compositeEnv), std::move(openVars), 1585 Alternative newAlt{ 1586 newExpr, std::move(compositeEnv), std::move(openVars), 1587 1587 AssertionList( need.begin(), need.end() ), first.cost + second.cost }; 1588 1588 inferParameters( newAlt, back_inserter( alternatives ) ); … … 1611 1611 cloneAll( alt.need, need ); 1612 1612 } 1613 1614 alternatives.push_back( Alternative{ 1615 new TupleExpr{ exprs }, std::move(compositeEnv), std::move(openVars), 1613 1614 alternatives.push_back( Alternative{ 1615 new TupleExpr{ exprs }, std::move(compositeEnv), std::move(openVars), 1616 1616 AssertionList( need.begin(), need.end() ), sumCost( alts ) } ); 1617 1617 } // for … … 1632 1632 finder.findWithoutPrune( ctorExpr->get_callExpr() ); 1633 1633 for ( Alternative & alt : finder.alternatives ) { 1634 alternatives.push_back( Alternative{ 1634 alternatives.push_back( Alternative{ 1635 1635 alt, new ConstructorExpr( alt.expr->clone() ), alt.cost } ); 1636 1636 } … … 1684 1684 cloneAll( alt.need, need ); 1685 1685 AssertionSet have; 1686 OpenVarSet openVars( alt.openVars ); 1687 // xxx - find things in env that don't have a "representative type" and claim 1686 OpenVarSet openVars( alt.openVars ); 1687 // xxx - find things in env that don't have a "representative type" and claim 1688 1688 // those are open vars? 1689 1689 PRINT( 1690 1690 std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; 1691 1691 ) 1692 // It's possible that a cast can throw away some values in a multiply-valued 1693 // expression. (An example is a cast-to-void, which casts from one value to 1694 // zero.) Figure out the prefix of the subexpression results that are cast 1695 // directly. The candidate is invalid if it has fewer results than there are 1692 // It's possible that a cast can throw away some values in a multiply-valued 1693 // expression. (An example is a cast-to-void, which casts from one value to 1694 // zero.) Figure out the prefix of the subexpression results that are cast 1695 // directly. The candidate is invalid if it has fewer results than there are 1696 1696 // types to cast to. 1697 1697 int discardedValues = alt.expr->result->size() - toType->size(); 1698 1698 if ( discardedValues < 0 ) continue; 1699 // xxx - may need to go into tuple types and extract relevant types and use 1700 // unifyList. Note that currently, this does not allow casting a tuple to an 1699 // xxx - may need to go into tuple types and extract relevant types and use 1700 // unifyList. Note that currently, this does not allow casting a tuple to an 1701 1701 // atomic type (e.g. (int)([1, 2, 3])) 1702 1702 1703 1703 // unification run for side-effects 1704 1704 unify( toType, alt.expr->result, newEnv, need, have, openVars, indexer ); … … 1709 1709 // count one safe conversion for each value that is thrown away 1710 1710 thisCost.incSafe( discardedValues ); 1711 Alternative newAlt{ 1712 new InitExpr{ 1713 restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() }, 1714 std::move(newEnv), std::move(openVars), 1711 Alternative newAlt{ 1712 new InitExpr{ 1713 restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() }, 1714 std::move(newEnv), std::move(openVars), 1715 1715 AssertionList( need.begin(), need.end() ), alt.cost, thisCost }; 1716 1716 inferParameters( newAlt, back_inserter( candidates ) ); -
src/ResolvExpr/CurrentObject.cc
r99614c2 r43e0949 228 228 std::vector<InitAlternative> ret = memberIter->first(); 229 229 for ( InitAlternative & alt : ret ) { 230 alt.designation-> get_designators().push_front( new ConstantExpr( Constant::from_ulong( index ) ) );230 alt.designation->designators.push_front( new ConstantExpr( Constant::from_ulong( index ) ) ); 231 231 } 232 232 return ret; … … 294 294 for ( InitAlternative & alt : ret ) { 295 295 PRINT( std::cerr << "iterating and adding designators" << std::endl; ) 296 alt.designation-> get_designators().push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) );296 alt.designation->designators.push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) ); 297 297 // need to substitute for generic types, so that casts are to concrete types 298 298 PRINT( std::cerr << " type is: " << alt.type; ) … … 354 354 for ( InitAlternative & alt : ret ) { 355 355 PRINT( std::cerr << "iterating and adding designators" << std::endl; ) 356 alt.designation-> get_designators().push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) );356 alt.designation->designators.push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) ); 357 357 } 358 358 } … … 465 465 assertf( ! objStack.empty(), "obj stack empty in setNext" ); 466 466 PRINT( std::cerr << "____setNext" << designation << std::endl; ) 467 objStack.top()->setPosition( designation-> get_designators());467 objStack.top()->setPosition( designation->designators ); 468 468 } 469 469 … … 472 472 PRINT( std::cerr << "___findNext" << std::endl; ) 473 473 // find all the d's 474 std:: list<DesignatorChain> desigAlts{ { } }, newDesigAlts;474 std::vector<DesignatorChain> desigAlts{ { } }, newDesigAlts; 475 475 std::list<Type *> curTypes { (objStack.top())->getType() }, newTypes; 476 for ( Expression * expr : designation-> get_designators()) {476 for ( Expression * expr : designation->designators ) { 477 477 PRINT( std::cerr << "____untyped: " << expr << std::endl; ) 478 std::list<DesignatorChain>::iteratordit = desigAlts.begin();478 auto dit = desigAlts.begin(); 479 479 if ( NameExpr * nexpr = dynamic_cast<NameExpr *>(expr) ) { 480 480 for ( Type * t : curTypes ) { -
src/ResolvExpr/ResolveAssertions.cc
r99614c2 r43e0949 47 47 UniqueId resnSlot; ///< Slot for any recursive assertion IDs 48 48 49 AssnCandidate( const SymTab::Indexer::IdData& cdata, Type* adjType, TypeEnvironment&& env, 50 AssertionSet&& have, AssertionSet&& need, OpenVarSet&& openVars, UniqueId resnSlot ) 51 : cdata(cdata), adjType(adjType), env(std::move(env)), have(std::move(have)), 49 AssnCandidate( const SymTab::Indexer::IdData& cdata, Type* adjType, TypeEnvironment&& env, 50 AssertionSet&& have, AssertionSet&& need, OpenVarSet&& openVars, UniqueId resnSlot ) 51 : cdata(cdata), adjType(adjType), env(std::move(env)), have(std::move(have)), 52 52 need(std::move(need)), openVars(std::move(openVars)), resnSlot(resnSlot) {} 53 53 }; … … 86 86 const AssnCache* cache; ///< Cache storing assertion item 87 87 std::string key; ///< Key into cache 88 88 89 89 DeferItem( const AssnCache& cache, const std::string& key ) : cache(&cache), key(key) {} 90 90 … … 99 99 100 100 // sortable by key 101 // TODO look into optimizing combination process with other sort orders (e.g. by number 101 // TODO look into optimizing combination process with other sort orders (e.g. by number 102 102 // of matches in candidate) 103 103 bool operator< ( const DeferItem& o ) const { return key < o.key; } … … 108 108 using DeferList = std::vector<DeferItem>; 109 109 110 /// Combo iterator that combines candidates into an output list, merging their environments. 110 /// Combo iterator that combines candidates into an output list, merging their environments. 111 111 /// Rejects an appended candidate if the environments cannot be merged. 112 112 class CandidateEnvMerger { … … 119 119 /// Indexer to use for merges 120 120 const SymTab::Indexer& indexer; 121 121 122 122 public: 123 123 /// The merged environment/open variables and the list of candidates … … 127 127 std::vector<DeferRef> assns; 128 128 129 OutType( const TypeEnvironment& env, const OpenVarSet& openVars, 129 OutType( const TypeEnvironment& env, const OpenVarSet& openVars, 130 130 const std::vector<DeferRef>& assns ) 131 131 : env(env), openVars(openVars), assns(assns) {} 132 132 }; 133 133 134 CandidateEnvMerger( const TypeEnvironment& env, const OpenVarSet& openVars, 134 CandidateEnvMerger( const TypeEnvironment& env, const OpenVarSet& openVars, 135 135 const SymTab::Indexer& indexer ) 136 136 : crnt(), envs{ env }, varSets{ openVars }, indexer(indexer) {} … … 158 158 }; 159 159 160 /// Comparator for CandidateEnvMerger outputs that sums their costs and caches the stored 160 /// Comparator for CandidateEnvMerger outputs that sums their costs and caches the stored 161 161 /// sums 162 162 struct CandidateCost { … … 176 176 Cost k = Cost::zero; 177 177 for ( const auto& assn : x.assns ) { 178 k += computeConversionCost( 179 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 178 k += computeConversionCost( 179 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 180 180 x.env ); 181 181 } … … 184 184 return it->second; 185 185 } 186 186 187 187 /// compares elements by cost 188 188 bool operator() ( const Element& a, const Element& b ) const { … … 214 214 /// Updated resolution state with new need-list 215 215 ResnState( ResnState&& o, IterateFlag ) 216 : alt(std::move(o.alt)), need(o.newNeed.begin(), o.newNeed.end()), newNeed(), deferred(), 216 : alt(std::move(o.alt)), need(o.newNeed.begin(), o.newNeed.end()), newNeed(), deferred(), 217 217 inferred(std::move(o.inferred)), indexer(o.indexer) {} 218 218 }; 219 219 220 220 /// Binds a single assertion, updating resolution state 221 void bindAssertion( const DeclarationWithType* decl, AssertionSetValue info, Alternative& alt, 221 void bindAssertion( const DeclarationWithType* decl, AssertionSetValue info, Alternative& alt, 222 222 AssnCandidate& match, InferCache& inferred ) { 223 223 224 224 DeclarationWithType* candidate = match.cdata.id; 225 225 assertf( candidate->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() ); … … 232 232 // place newly-inferred assertion in proper place in cache 233 233 inferred[ info.resnSlot ][ decl->get_uniqueId() ] = ParamEntry{ 234 candidate->get_uniqueId(), match.adjType->clone(), decl->get_type()->clone(), 234 candidate->get_uniqueId(), match.adjType->clone(), decl->get_type()->clone(), 235 235 varExpr }; 236 236 } … … 260 260 if ( it == cache.end() ) { 261 261 // lookup candidates for this assertion 262 std:: list< SymTab::Indexer::IdData > candidates;262 std::vector< SymTab::Indexer::IdData > candidates; 263 263 resn.indexer.lookupId( assn.decl->name, candidates ); 264 264 … … 277 277 278 278 // keep unifying candidates 279 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 279 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 280 280 resn.indexer ) ) { 281 281 // set up binding slot for recursive assertions … … 288 288 } 289 289 290 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 290 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 291 291 std::move(newNeed), std::move(newOpenVars), crntResnSlot ); 292 292 } else { … … 339 339 } 340 340 InferredParams& inferParams = it->second; 341 341 342 342 // place inferred parameters into proper place in expression 343 343 for ( auto& entry : inferParams ) { … … 402 402 // resolve deferred assertions by mutual compatibility 403 403 std::vector<CandidateEnvMerger::OutType> compatible = filterCombos( 404 resn.deferred, 404 resn.deferred, 405 405 CandidateEnvMerger{ resn.alt.env, resn.alt.openVars, resn.indexer } ); 406 406 // sort by cost … … 431 431 // for each deferred assertion with the same form 432 432 for ( AssnId id : r.item.deferIds ) { 433 bindAssertion( 433 bindAssertion( 434 434 id.decl, id.info, new_resn.alt, match, new_resn.inferred ); 435 435 } … … 455 455 new_resns.clear(); 456 456 } 457 457 458 458 // exceeded recursion limit if reaches here 459 459 if ( out.empty() ) { -
src/ResolvExpr/Resolver.cc
r99614c2 r43e0949 839 839 // xxx - fix this so that the list isn't copied, iterator should be used to change current 840 840 // element 841 std:: list<Designation *> newDesignations;842 for ( auto p : group_iterate(listInit-> get_designations(), listInit->get_initializers()) ) {841 std::vector<Designation *> newDesignations; 842 for ( auto p : group_iterate(listInit->designations, listInit->initializers) ) { 843 843 // iterate designations and initializers in pairs, moving the cursor to the current 844 844 // designated object and resolving the initializer against that object. … … 849 849 } 850 850 // set the set of 'resolved' designations and leave the brace-enclosed initializer-list 851 listInit-> get_designations()= newDesignations; // xxx - memory management851 listInit->designations = newDesignations; // xxx - memory management 852 852 currentObject.exitListInit(); 853 853 -
src/SymTab/Indexer.cc
r99614c2 r43e0949 102 102 } 103 103 104 void Indexer::removeSpecialOverrides( const std::string &id, std:: list< IdData > & out ) const {104 void Indexer::removeSpecialOverrides( const std::string &id, std::vector< IdData > & out ) const { 105 105 // only need to perform this step for constructors, destructors, and assignment functions 106 106 if ( ! CodeGen::isCtorDtorAssign( id ) ) return; … … 116 116 bool existsUserDefinedCopyFunc = false; // user-defined copy ctor found 117 117 BaseSyntaxNode * deleteStmt = nullptr; // non-null if a user-defined function is found 118 std:: list< DeclBall > decls;118 std::vector< DeclBall > decls; 119 119 120 120 // another FunctionDecl for the current type was found - determine … … 135 135 }; // ValueType 136 136 137 std:: list< IdData > copy;138 copy.splice( copy.end(), out );137 std::vector< IdData > copy; 138 swap( copy, out ); 139 139 140 140 // organize discovered declarations by type … … 231 231 } 232 232 233 void Indexer::lookupId( const std::string &id, std:: list< IdData > &out ) const {233 void Indexer::lookupId( const std::string &id, std::vector< IdData > &out ) const { 234 234 std::unordered_set< std::string > foundMangleNames; 235 235 -
src/SymTab/Indexer.h
r99614c2 r43e0949 60 60 61 61 /// Gets all declarations with the given ID 62 void lookupId( const std::string &id, std:: list< IdData > &out ) const;62 void lookupId( const std::string &id, std::vector< IdData > &out ) const; 63 63 /// Gets the top-most type declaration with the given ID 64 64 NamedTypeDecl *lookupType( const std::string &id ) const; … … 140 140 // so that they will not be selected 141 141 // void removeSpecialOverrides( FunctionDecl *decl ); 142 void removeSpecialOverrides( const std::string &id, std:: list< IdData > & out ) const;142 void removeSpecialOverrides( const std::string &id, std::vector< IdData > & out ) const; 143 143 144 144 /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope) -
src/SynTree/Initializer.cc
r99614c2 r43e0949 70 70 71 71 72 ListInit::ListInit( const std::vector< Initializer * > & inits, const std::list<Designation *> &des, bool maybeConstructed )72 ListInit::ListInit( const std::vector< Initializer * > & inits, const std::vector<Designation *> & des, bool maybeConstructed ) 73 73 : Initializer( maybeConstructed ), initializers( inits ), designations( des ) { 74 74 // handle the common case where a ListInit is created without designations by making a list of empty designations with the same length as the initializer -
src/SynTree/Initializer.h
r99614c2 r43e0949 36 36 virtual ~Designation(); 37 37 38 std::list< Expression * > & get_designators() { return designators; }39 40 38 virtual Designation * clone() const override { return new Designation( *this ); }; 41 39 virtual void accept( Visitor &v ) override { v.visit( this ); } … … 44 42 }; 45 43 46 const std:: list<Designation *> noDesignators;44 const std::vector<Designation *> noDesignators; 47 45 48 46 // Initializer: base class for object initializers (provide default values) … … 87 85 public: 88 86 std::vector< Initializer * > initializers; // order *is* important 89 std:: list<Designation *> designations; // order/length is consistent with initializers87 std::vector<Designation *> designations; // order/length is consistent with initializers 90 88 91 89 ListInit( const std::vector< Initializer * > &initializers, 92 const std:: list<Designation *> &designators = {}, bool maybeConstructed = false );90 const std::vector<Designation *> &designators = {}, bool maybeConstructed = false ); 93 91 ListInit( const ListInit & other ); 94 92 virtual ~ListInit(); 95 96 std::list<Designation *> & get_designations() { return designations; }97 std::vector< Initializer * > & get_initializers() { return initializers; }98 93 99 94 typedef std::vector< Initializer * >::iterator iterator;
Note: See TracChangeset
for help on using the changeset viewer.