Changeset 13deae88
- Timestamp:
- Jan 22, 2018, 11:46:50 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- e5c74d1
- Parents:
- 73367a8
- git-author:
- Rob Schluntz <rschlunt@…> (01/19/18 15:52:52)
- git-committer:
- Rob Schluntz <rschlunt@…> (01/22/18 11:46:50)
- Location:
- src/ResolvExpr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r73367a8 r13deae88 60 60 61 61 namespace ResolvExpr { 62 struct AlternativeFinder::Finder : public WithShortCircuiting { 63 Finder( AlternativeFinder & altFinder ) : altFinder( altFinder ), indexer( altFinder.indexer ), alternatives( altFinder.alternatives ), env( altFinder.env ), targetType( altFinder.targetType ) {} 64 65 void previsit( BaseSyntaxNode * ) { visit_children = false; } 66 67 void postvisit( ApplicationExpr * applicationExpr ); 68 void postvisit( UntypedExpr * untypedExpr ); 69 void postvisit( AddressExpr * addressExpr ); 70 void postvisit( LabelAddressExpr * labelExpr ); 71 void postvisit( CastExpr * castExpr ); 72 void postvisit( VirtualCastExpr * castExpr ); 73 void postvisit( UntypedMemberExpr * memberExpr ); 74 void postvisit( MemberExpr * memberExpr ); 75 void postvisit( NameExpr * variableExpr ); 76 void postvisit( VariableExpr * variableExpr ); 77 void postvisit( ConstantExpr * constantExpr ); 78 void postvisit( SizeofExpr * sizeofExpr ); 79 void postvisit( AlignofExpr * alignofExpr ); 80 void postvisit( UntypedOffsetofExpr * offsetofExpr ); 81 void postvisit( OffsetofExpr * offsetofExpr ); 82 void postvisit( OffsetPackExpr * offsetPackExpr ); 83 void postvisit( AttrExpr * attrExpr ); 84 void postvisit( LogicalExpr * logicalExpr ); 85 void postvisit( ConditionalExpr * conditionalExpr ); 86 void postvisit( CommaExpr * commaExpr ); 87 void postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ); 88 void postvisit( ConstructorExpr * ctorExpr ); 89 void postvisit( RangeExpr * rangeExpr ); 90 void postvisit( UntypedTupleExpr * tupleExpr ); 91 void postvisit( TupleExpr * tupleExpr ); 92 void postvisit( TupleIndexExpr * tupleExpr ); 93 void postvisit( TupleAssignExpr * tupleExpr ); 94 void postvisit( UniqueExpr * unqExpr ); 95 void postvisit( StmtExpr * stmtExpr ); 96 void postvisit( UntypedInitExpr * initExpr ); 97 98 /// Adds alternatives for anonymous members 99 void addAnonConversions( const Alternative & alt ); 100 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 101 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 102 /// Adds alternatives for member expressions where the left side has tuple type 103 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 104 /// Adds alternatives for offsetof expressions, given the base type and name of the member 105 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 106 /// Takes a final result and checks if its assertions can be satisfied 107 template<typename OutputIterator> 108 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 109 /// Finds matching alternatives for a function, given a set of arguments 110 template<typename OutputIterator> 111 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 112 /// Checks if assertion parameters match for a new alternative 113 template< typename OutputIterator > 114 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 115 private: 116 AlternativeFinder & altFinder; 117 const SymTab::Indexer &indexer; 118 AltList & alternatives; 119 const TypeEnvironment &env; 120 Type *& targetType; 121 }; 122 62 123 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 63 124 CastExpr *castToVoid = new CastExpr( expr ); … … 185 246 186 247 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) { 187 expr->accept( *this ); 248 PassVisitor<Finder> finder( *this ); 249 expr->accept( finder ); 188 250 if ( failFast && alternatives.empty() ) { 189 251 PRINT( … … 244 306 } 245 307 246 void AlternativeFinder:: addAnonConversions( const Alternative & alt ) {308 void AlternativeFinder::Finder::addAnonConversions( const Alternative & alt ) { 247 309 // adds anonymous member interpretations whenever an aggregate value type is seen. 248 310 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value … … 265 327 266 328 template< typename StructOrUnionType > 267 void AlternativeFinder:: addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) {329 void AlternativeFinder::Finder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 268 330 // by this point, member must be a name expr 269 331 NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ); … … 284 346 } 285 347 286 void AlternativeFinder:: addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) {348 void AlternativeFinder::Finder::addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 287 349 if ( ConstantExpr * constantExpr = dynamic_cast< ConstantExpr * >( member ) ) { 288 350 // get the value of the constant expression as an int, must be between 0 and the length of the tuple type to have meaning … … 308 370 } 309 371 310 void AlternativeFinder:: visit( ApplicationExpr *applicationExpr ) {372 void AlternativeFinder::Finder::postvisit( ApplicationExpr *applicationExpr ) { 311 373 alternatives.push_back( Alternative( applicationExpr->clone(), env, Cost::zero ) ); 312 374 } … … 541 603 542 604 template< typename OutputIterator > 543 void AlternativeFinder:: inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) {605 void AlternativeFinder::Finder::inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) { 544 606 // PRINT( 545 607 // std::cerr << "inferParameters: assertions needed are" << std::endl; … … 892 954 893 955 template<typename OutputIterator> 894 void AlternativeFinder:: validateFunctionAlternative( const Alternative &func, ArgPack& result,956 void AlternativeFinder::Finder::validateFunctionAlternative( const Alternative &func, ArgPack& result, 895 957 const std::vector<ArgPack>& results, OutputIterator out ) { 896 958 ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() ); … … 915 977 916 978 template<typename OutputIterator> 917 void AlternativeFinder:: makeFunctionAlternatives( const Alternative &func,979 void AlternativeFinder::Finder::makeFunctionAlternatives( const Alternative &func, 918 980 FunctionType *funcType, const ExplodedArgs &args, OutputIterator out ) { 919 981 OpenVarSet funcOpenVars; … … 1022 1084 } 1023 1085 1024 void AlternativeFinder:: visit( UntypedExpr *untypedExpr ) {1086 void AlternativeFinder::Finder::postvisit( UntypedExpr *untypedExpr ) { 1025 1087 AlternativeFinder funcFinder( indexer, env ); 1026 1088 funcFinder.findWithAdjustment( untypedExpr->get_function() ); … … 1029 1091 1030 1092 std::vector< AlternativeFinder > argAlternatives; 1031 findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(),1093 altFinder.findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(), 1032 1094 back_inserter( argAlternatives ) ); 1033 1095 1034 1096 // take care of possible tuple assignments 1035 1097 // if not tuple assignment, assignment is taken care of as a normal function call 1036 Tuples::handleTupleAssignment( *this, untypedExpr, argAlternatives );1098 Tuples::handleTupleAssignment( altFinder, untypedExpr, argAlternatives ); 1037 1099 1038 1100 // find function operators … … 1172 1234 // fix this issue in a more robust way. 1173 1235 targetType = nullptr; 1174 visit( untypedExpr );1236 postvisit( untypedExpr ); 1175 1237 } 1176 1238 } … … 1181 1243 } 1182 1244 1183 void AlternativeFinder:: visit( AddressExpr *addressExpr ) {1245 void AlternativeFinder::Finder::postvisit( AddressExpr *addressExpr ) { 1184 1246 AlternativeFinder finder( indexer, env ); 1185 1247 finder.find( addressExpr->get_arg() ); … … 1192 1254 } 1193 1255 1194 void AlternativeFinder:: visit( LabelAddressExpr * expr ) {1256 void AlternativeFinder::Finder::postvisit( LabelAddressExpr * expr ) { 1195 1257 alternatives.push_back( Alternative{ expr->clone(), env, Cost::zero } ); 1196 1258 } … … 1223 1285 } 1224 1286 1225 void AlternativeFinder:: visit( CastExpr *castExpr ) {1287 void AlternativeFinder::Finder::postvisit( CastExpr *castExpr ) { 1226 1288 Type *& toType = castExpr->get_result(); 1227 1289 assert( toType ); … … 1278 1340 } 1279 1341 1280 void AlternativeFinder:: visit( VirtualCastExpr * castExpr ) {1342 void AlternativeFinder::Finder::postvisit( VirtualCastExpr * castExpr ) { 1281 1343 assertf( castExpr->get_result(), "Implicate virtual cast targets not yet supported." ); 1282 1344 AlternativeFinder finder( indexer, env ); … … 1290 1352 } 1291 1353 1292 void AlternativeFinder:: visit( UntypedMemberExpr *memberExpr ) {1354 void AlternativeFinder::Finder::postvisit( UntypedMemberExpr *memberExpr ) { 1293 1355 AlternativeFinder funcFinder( indexer, env ); 1294 1356 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); … … 1312 1374 } 1313 1375 1314 void AlternativeFinder:: visit( MemberExpr *memberExpr ) {1376 void AlternativeFinder::Finder::postvisit( MemberExpr *memberExpr ) { 1315 1377 alternatives.push_back( Alternative( memberExpr->clone(), env, Cost::zero ) ); 1316 1378 } 1317 1379 1318 void AlternativeFinder:: visit( NameExpr *nameExpr ) {1380 void AlternativeFinder::Finder::postvisit( NameExpr *nameExpr ) { 1319 1381 std::list< SymTab::Indexer::IdData > declList; 1320 1382 indexer.lookupId( nameExpr->get_name(), declList ); … … 1337 1399 } 1338 1400 1339 void AlternativeFinder:: visit( VariableExpr *variableExpr ) {1401 void AlternativeFinder::Finder::postvisit( VariableExpr *variableExpr ) { 1340 1402 // not sufficient to clone here, because variable's type may have changed 1341 1403 // since the VariableExpr was originally created. … … 1343 1405 } 1344 1406 1345 void AlternativeFinder:: visit( ConstantExpr *constantExpr ) {1407 void AlternativeFinder::Finder::postvisit( ConstantExpr *constantExpr ) { 1346 1408 alternatives.push_back( Alternative( constantExpr->clone(), env, Cost::zero ) ); 1347 1409 } 1348 1410 1349 void AlternativeFinder:: visit( SizeofExpr *sizeofExpr ) {1411 void AlternativeFinder::Finder::postvisit( SizeofExpr *sizeofExpr ) { 1350 1412 if ( sizeofExpr->get_isType() ) { 1351 1413 Type * newType = sizeofExpr->get_type()->clone(); … … 1368 1430 } 1369 1431 1370 void AlternativeFinder:: visit( AlignofExpr *alignofExpr ) {1432 void AlternativeFinder::Finder::postvisit( AlignofExpr *alignofExpr ) { 1371 1433 if ( alignofExpr->get_isType() ) { 1372 1434 Type * newType = alignofExpr->get_type()->clone(); … … 1390 1452 1391 1453 template< typename StructOrUnionType > 1392 void AlternativeFinder:: addOffsetof( StructOrUnionType *aggInst, const std::string &name ) {1454 void AlternativeFinder::Finder::addOffsetof( StructOrUnionType *aggInst, const std::string &name ) { 1393 1455 std::list< Declaration* > members; 1394 1456 aggInst->lookup( name, members ); … … 1403 1465 } 1404 1466 1405 void AlternativeFinder:: visit( UntypedOffsetofExpr *offsetofExpr ) {1467 void AlternativeFinder::Finder::postvisit( UntypedOffsetofExpr *offsetofExpr ) { 1406 1468 AlternativeFinder funcFinder( indexer, env ); 1407 1469 // xxx - resolveTypeof? … … 1413 1475 } 1414 1476 1415 void AlternativeFinder:: visit( OffsetofExpr *offsetofExpr ) {1477 void AlternativeFinder::Finder::postvisit( OffsetofExpr *offsetofExpr ) { 1416 1478 alternatives.push_back( Alternative( offsetofExpr->clone(), env, Cost::zero ) ); 1417 1479 } 1418 1480 1419 void AlternativeFinder:: visit( OffsetPackExpr *offsetPackExpr ) {1481 void AlternativeFinder::Finder::postvisit( OffsetPackExpr *offsetPackExpr ) { 1420 1482 alternatives.push_back( Alternative( offsetPackExpr->clone(), env, Cost::zero ) ); 1421 1483 } … … 1444 1506 } 1445 1507 1446 void AlternativeFinder:: visit( AttrExpr *attrExpr ) {1508 void AlternativeFinder::Finder::postvisit( AttrExpr *attrExpr ) { 1447 1509 // assume no 'pointer-to-attribute' 1448 1510 NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() ); … … 1458 1520 if ( function->get_parameters().size() == 1 ) { 1459 1521 if ( attrExpr->get_isType() ) { 1460 resolveAttr( data, function, attrExpr->get_type(), env, *this);1522 resolveAttr( data, function, attrExpr->get_type(), env, altFinder); 1461 1523 } else { 1462 1524 AlternativeFinder finder( indexer, env ); … … 1464 1526 for ( AltList::iterator choice = finder.alternatives.begin(); choice != finder.alternatives.end(); ++choice ) { 1465 1527 if ( choice->expr->get_result()->size() == 1 ) { 1466 resolveAttr(data, function, choice->expr->get_result(), choice->env, *this);1528 resolveAttr(data, function, choice->expr->get_result(), choice->env, altFinder ); 1467 1529 } // fi 1468 1530 } // for … … 1479 1541 } 1480 1542 1481 void AlternativeFinder:: visit( LogicalExpr *logicalExpr ) {1543 void AlternativeFinder::Finder::postvisit( LogicalExpr *logicalExpr ) { 1482 1544 AlternativeFinder firstFinder( indexer, env ); 1483 1545 firstFinder.findWithAdjustment( logicalExpr->get_arg1() ); … … 1492 1554 } 1493 1555 1494 void AlternativeFinder:: visit( ConditionalExpr *conditionalExpr ) {1556 void AlternativeFinder::Finder::postvisit( ConditionalExpr *conditionalExpr ) { 1495 1557 // find alternatives for condition 1496 1558 AlternativeFinder firstFinder( indexer, env ); … … 1524 1586 } 1525 1587 1526 void AlternativeFinder:: visit( CommaExpr *commaExpr ) {1588 void AlternativeFinder::Finder::postvisit( CommaExpr *commaExpr ) { 1527 1589 TypeEnvironment newEnv( env ); 1528 1590 Expression *newFirstArg = resolveInVoidContext( commaExpr->get_arg1(), indexer, newEnv ); … … 1535 1597 } 1536 1598 1537 void AlternativeFinder:: visit( RangeExpr * rangeExpr ) {1599 void AlternativeFinder::Finder::postvisit( RangeExpr * rangeExpr ) { 1538 1600 // resolve low and high, accept alternatives whose low and high types unify 1539 1601 AlternativeFinder firstFinder( indexer, env ); … … 1557 1619 } 1558 1620 1559 void AlternativeFinder:: visit( UntypedTupleExpr *tupleExpr ) {1621 void AlternativeFinder::Finder::postvisit( UntypedTupleExpr *tupleExpr ) { 1560 1622 std::vector< AlternativeFinder > subExprAlternatives; 1561 findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(),1623 altFinder.findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), 1562 1624 back_inserter( subExprAlternatives ) ); 1563 1625 std::vector< AltList > possibilities; … … 1575 1637 } 1576 1638 1577 void AlternativeFinder:: visit( TupleExpr *tupleExpr ) {1639 void AlternativeFinder::Finder::postvisit( TupleExpr *tupleExpr ) { 1578 1640 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1579 1641 } 1580 1642 1581 void AlternativeFinder:: visit( ImplicitCopyCtorExpr * impCpCtorExpr ) {1643 void AlternativeFinder::Finder::postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ) { 1582 1644 alternatives.push_back( Alternative( impCpCtorExpr->clone(), env, Cost::zero ) ); 1583 1645 } 1584 1646 1585 void AlternativeFinder:: visit( ConstructorExpr * ctorExpr ) {1647 void AlternativeFinder::Finder::postvisit( ConstructorExpr * ctorExpr ) { 1586 1648 AlternativeFinder finder( indexer, env ); 1587 1649 // don't prune here, since it's guaranteed all alternatives will have the same type … … 1593 1655 } 1594 1656 1595 void AlternativeFinder:: visit( TupleIndexExpr *tupleExpr ) {1657 void AlternativeFinder::Finder::postvisit( TupleIndexExpr *tupleExpr ) { 1596 1658 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1597 1659 } 1598 1660 1599 void AlternativeFinder:: visit( TupleAssignExpr *tupleAssignExpr ) {1661 void AlternativeFinder::Finder::postvisit( TupleAssignExpr *tupleAssignExpr ) { 1600 1662 alternatives.push_back( Alternative( tupleAssignExpr->clone(), env, Cost::zero ) ); 1601 1663 } 1602 1664 1603 void AlternativeFinder:: visit( UniqueExpr *unqExpr ) {1665 void AlternativeFinder::Finder::postvisit( UniqueExpr *unqExpr ) { 1604 1666 AlternativeFinder finder( indexer, env ); 1605 1667 finder.findWithAdjustment( unqExpr->get_expr() ); … … 1611 1673 } 1612 1674 1613 void AlternativeFinder:: visit( StmtExpr *stmtExpr ) {1675 void AlternativeFinder::Finder::postvisit( StmtExpr *stmtExpr ) { 1614 1676 StmtExpr * newStmtExpr = stmtExpr->clone(); 1615 1677 ResolvExpr::resolveStmtExpr( newStmtExpr, indexer ); … … 1618 1680 } 1619 1681 1620 void AlternativeFinder:: visit( UntypedInitExpr *initExpr ) {1682 void AlternativeFinder::Finder::postvisit( UntypedInitExpr *initExpr ) { 1621 1683 // handle each option like a cast 1622 1684 AltList candidates; 1623 PRINT( std::cerr << "untyped init expr: " << initExpr << std::endl; ) 1685 PRINT( 1686 std::cerr << "untyped init expr: " << initExpr << std::endl; 1687 ) 1624 1688 // O(N^2) checks of d-types with e-types 1625 1689 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { … … 1637 1701 AssertionSet needAssertions, haveAssertions; 1638 1702 OpenVarSet openVars; // find things in env that don't have a "representative type" and claim those are open vars? 1639 PRINT( std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; ) 1703 PRINT( 1704 std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; 1705 ) 1640 1706 // It's possible that a cast can throw away some values in a multiply-valued expression. (An example is a 1641 1707 // cast-to-void, which casts from one value to zero.) Figure out the prefix of the subexpression results -
src/ResolvExpr/AlternativeFinder.h
r73367a8 r13deae88 38 38 using ExplodedArgs = std::vector< std::vector< ExplodedActual > >; 39 39 40 class AlternativeFinder : public Visitor{40 class AlternativeFinder { 41 41 public: 42 42 AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env ); … … 94 94 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ); 95 95 private: 96 virtual void visit( ApplicationExpr *applicationExpr ); 97 virtual void visit( UntypedExpr *untypedExpr ); 98 virtual void visit( AddressExpr *addressExpr ); 99 virtual void visit( LabelAddressExpr *labelExpr ); 100 virtual void visit( CastExpr *castExpr ); 101 virtual void visit( VirtualCastExpr *castExpr ); 102 virtual void visit( UntypedMemberExpr *memberExpr ); 103 virtual void visit( MemberExpr *memberExpr ); 104 virtual void visit( NameExpr *variableExpr ); 105 virtual void visit( VariableExpr *variableExpr ); 106 virtual void visit( ConstantExpr *constantExpr ); 107 virtual void visit( SizeofExpr *sizeofExpr ); 108 virtual void visit( AlignofExpr *alignofExpr ); 109 virtual void visit( UntypedOffsetofExpr *offsetofExpr ); 110 virtual void visit( OffsetofExpr *offsetofExpr ); 111 virtual void visit( OffsetPackExpr *offsetPackExpr ); 112 virtual void visit( AttrExpr *attrExpr ); 113 virtual void visit( LogicalExpr *logicalExpr ); 114 virtual void visit( ConditionalExpr *conditionalExpr ); 115 virtual void visit( CommaExpr *commaExpr ); 116 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 117 virtual void visit( ConstructorExpr * ctorExpr ); 118 virtual void visit( RangeExpr * rangeExpr ); 119 virtual void visit( UntypedTupleExpr *tupleExpr ); 120 virtual void visit( TupleExpr *tupleExpr ); 121 virtual void visit( TupleIndexExpr *tupleExpr ); 122 virtual void visit( TupleAssignExpr *tupleExpr ); 123 virtual void visit( UniqueExpr *unqExpr ); 124 virtual void visit( StmtExpr *stmtExpr ); 125 virtual void visit( UntypedInitExpr *initExpr ); 126 127 /// Adds alternatives for anonymous members 128 void addAnonConversions( const Alternative & alt ); 129 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 130 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 131 /// Adds alternatives for member expressions where the left side has tuple type 132 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 133 /// Adds alternatives for offsetof expressions, given the base type and name of the member 134 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 135 /// Takes a final result and checks if its assertions can be satisfied 136 template<typename OutputIterator> 137 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 138 /// Finds matching alternatives for a function, given a set of arguments 139 template<typename OutputIterator> 140 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 141 /// Checks if assertion parameters match for a new alternative 142 template< typename OutputIterator > 143 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 144 96 struct Finder; 145 97 const SymTab::Indexer &indexer; 146 98 AltList alternatives;
Note: See TracChangeset
for help on using the changeset viewer.