Changes in src/GenPoly/Box.cc [18070ee:801978b]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r18070ee r801978b 189 189 /// Enters a new scope for type-variables, adding the type variables from ty 190 190 void beginTypeScope( Type *ty ); 191 /// Exits the type-variable scope 192 void endTypeScope(); 191 193 /// Enters a new scope for knowLayouts and knownOffsets and queues exit calls 192 194 void beginGenericScope(); … … 196 198 UniqueName bufNamer; ///< Namer for VLA buffers 197 199 Expression * addrMember = nullptr; ///< AddressExpr argument is MemberExpr? 198 bool expect_func_type = false; ///< used to avoid recursing too deep in type decls199 200 }; 200 201 … … 1276 1277 FunctionType * ftype = functionDecl->type; 1277 1278 if ( ! ftype->returnVals.empty() && functionDecl->statements ) { 1278 // intrinsic functions won't be using the _retval so no need to generate it. 1279 if ( functionDecl->linkage != LinkageSpec::Intrinsic && !isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1279 if ( ! isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1280 1280 assert( ftype->returnVals.size() == 1 ); 1281 1281 DeclarationWithType * retval = ftype->returnVals.front(); … … 1418 1418 void PolyGenericCalculator::beginGenericScope() { 1419 1419 GuardScope( *this ); 1420 // We expect the first function type see to be the type relating to this scope1421 // but any further type is probably some unrelated function pointer1422 // keep track of which is the first1423 GuardValue( expect_func_type );1424 expect_func_type = true;1425 1420 } 1426 1421 … … 1472 1467 void PolyGenericCalculator::premutate( FunctionType *funcType ) { 1473 1468 beginTypeScope( funcType ); 1474 1475 GuardValue( expect_func_type );1476 1477 if(!expect_func_type) {1478 GuardAction( [this]() {1479 knownLayouts.endScope();1480 knownOffsets.endScope();1481 });1482 // If this is the first function type we see1483 // Then it's the type of the declaration and we care about it1484 knownLayouts.beginScope();1485 knownOffsets.beginScope();1486 }1487 1488 // The other functions type we will see in this scope are probably functions parameters1489 // they don't help us with the layout and offsets so don't mark them as known in this scope1490 expect_func_type = false;1491 1469 1492 1470 // make sure that any type information passed into the function is accounted for … … 1767 1745 } 1768 1746 1769 // std::cout << "TRUE 2" << std::endl;1770 1771 1747 return true; 1772 1748 } else if ( UnionInstType *unionTy = dynamic_cast< UnionInstType* >( ty ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.