Changes in src/GenPoly/Box.cc [aa19ccf:4b8f918]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
raa19ccf r4b8f918 292 292 /// adds type parameters to the layout call; will generate the appropriate parameters if needed 293 293 void addOtypeParamsToLayoutCall( UntypedExpr *layoutCall, const std::list< Type* > &otypeParams ); 294 295 /// Enters a new scope for type-variables, adding the type variables from ty296 void beginTypeScope( Type *ty );297 /// Exits the type-variable scope298 void endTypeScope();299 294 300 295 ScopedSet< std::string > knownLayouts; ///< Set of generic type layouts known in the current scope, indexed by sizeofName … … 1826 1821 ////////////////////////////////////////// PolyGenericCalculator //////////////////////////////////////////////////// 1827 1822 1828 void PolyGenericCalculator::beginTypeScope( Type *ty ) {1829 scopeTyVars.beginScope();1830 makeTyVarMap( ty, scopeTyVars );1831 }1832 1833 void PolyGenericCalculator::endTypeScope() {1834 scopeTyVars.endScope();1835 }1836 1837 1823 template< typename DeclClass > 1838 1824 DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) { 1839 beginTypeScope( type ); 1840 knownLayouts.beginScope(); 1841 knownOffsets.beginScope(); 1825 scopeTyVars.beginScope(); 1826 makeTyVarMap( type, scopeTyVars ); 1842 1827 1843 1828 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 1844 1829 1845 knownOffsets.endScope(); 1846 knownLayouts.endScope(); 1847 endTypeScope(); 1830 scopeTyVars.endScope(); 1848 1831 return ret; 1849 1832 } … … 1867 1850 1868 1851 Type * PolyGenericCalculator::mutate( PointerType *pointerType ) { 1869 beginTypeScope( pointerType ); 1852 scopeTyVars.beginScope(); 1853 makeTyVarMap( pointerType, scopeTyVars ); 1870 1854 1871 1855 Type *ret = Mutator::mutate( pointerType ); 1872 1856 1873 endTypeScope();1857 scopeTyVars.endScope(); 1874 1858 return ret; 1875 1859 } 1876 1860 1877 1861 Type * PolyGenericCalculator::mutate( FunctionType *funcType ) { 1878 beginTypeScope( funcType ); 1862 scopeTyVars.beginScope(); 1863 makeTyVarMap( funcType, scopeTyVars ); 1879 1864 1880 1865 // make sure that any type information passed into the function is accounted for … … 1889 1874 Type *ret = Mutator::mutate( funcType ); 1890 1875 1891 endTypeScope();1876 scopeTyVars.endScope(); 1892 1877 return ret; 1893 1878 }
Note:
See TracChangeset
for help on using the changeset viewer.