Changeset aa19ccf for src/GenPoly
- Timestamp:
- Apr 13, 2016, 3:02:30 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 02ad3f5
- Parents:
- 3849857
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r3849857 raa19ccf 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 ty 296 void beginTypeScope( Type *ty ); 297 /// Exits the type-variable scope 298 void endTypeScope(); 294 299 295 300 ScopedSet< std::string > knownLayouts; ///< Set of generic type layouts known in the current scope, indexed by sizeofName … … 1821 1826 ////////////////////////////////////////// PolyGenericCalculator //////////////////////////////////////////////////// 1822 1827 1828 void PolyGenericCalculator::beginTypeScope( Type *ty ) { 1829 scopeTyVars.beginScope(); 1830 makeTyVarMap( ty, scopeTyVars ); 1831 } 1832 1833 void PolyGenericCalculator::endTypeScope() { 1834 scopeTyVars.endScope(); 1835 } 1836 1823 1837 template< typename DeclClass > 1824 1838 DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) { 1825 scopeTyVars.beginScope(); 1826 makeTyVarMap( type, scopeTyVars ); 1839 beginTypeScope( type ); 1840 knownLayouts.beginScope(); 1841 knownOffsets.beginScope(); 1827 1842 1828 1843 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 1829 1844 1830 scopeTyVars.endScope(); 1845 knownOffsets.endScope(); 1846 knownLayouts.endScope(); 1847 endTypeScope(); 1831 1848 return ret; 1832 1849 } … … 1850 1867 1851 1868 Type * PolyGenericCalculator::mutate( PointerType *pointerType ) { 1852 scopeTyVars.beginScope(); 1853 makeTyVarMap( pointerType, scopeTyVars ); 1869 beginTypeScope( pointerType ); 1854 1870 1855 1871 Type *ret = Mutator::mutate( pointerType ); 1856 1872 1857 scopeTyVars.endScope();1873 endTypeScope(); 1858 1874 return ret; 1859 1875 } 1860 1876 1861 1877 Type * PolyGenericCalculator::mutate( FunctionType *funcType ) { 1862 scopeTyVars.beginScope(); 1863 makeTyVarMap( funcType, scopeTyVars ); 1878 beginTypeScope( funcType ); 1864 1879 1865 1880 // make sure that any type information passed into the function is accounted for … … 1874 1889 Type *ret = Mutator::mutate( funcType ); 1875 1890 1876 scopeTyVars.endScope();1891 endTypeScope(); 1877 1892 return ret; 1878 1893 }
Note: See TracChangeset
for help on using the changeset viewer.