Changes in src/GenPoly/Box.cc [d18540f:474a170]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rd18540f r474a170 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Dec 19 16:36:00 202213 // Update Count : 34 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:40:34 2019 13 // Update Count : 347 14 14 // 15 15 … … 214 214 /// sizeof expressions of polymorphic types with the proper variable, 215 215 /// and strips fields from generic struct declarations. 216 struct Pass3 final { 216 struct Pass3 final : public BoxPass, public WithGuards { 217 template< typename DeclClass > 218 void handleDecl( DeclClass * decl, Type * type ); 219 217 220 void premutate( ObjectDecl * objectDecl ); 218 221 void premutate( FunctionDecl * functionDecl ); … … 220 223 void premutate( StructDecl * structDecl ); 221 224 void premutate( UnionDecl * unionDecl ); 225 void premutate( TypeDecl * typeDecl ); 226 void premutate( PointerType * pointerType ); 227 void premutate( FunctionType * funcType ); 222 228 }; 223 229 } // anonymous namespace … … 1880 1886 ////////////////////////////////////////// Pass3 //////////////////////////////////////////////////// 1881 1887 1888 template< typename DeclClass > 1889 void Pass3::handleDecl( DeclClass * decl, Type * type ) { 1890 GuardScope( scopeTyVars ); 1891 makeTyVarMap( type, scopeTyVars ); 1892 ScrubTyVars::scrubAll( decl ); 1893 } 1894 1882 1895 void Pass3::premutate( ObjectDecl * objectDecl ) { 1883 ScrubTyVars::scrubAll( objectDecl);1896 handleDecl( objectDecl, objectDecl->type ); 1884 1897 } 1885 1898 1886 1899 void Pass3::premutate( FunctionDecl * functionDecl ) { 1887 ScrubTyVars::scrubAll( functionDecl);1900 handleDecl( functionDecl, functionDecl->type ); 1888 1901 } 1889 1902 1890 1903 void Pass3::premutate( TypedefDecl * typedefDecl ) { 1891 ScrubTyVars::scrubAll( typedefDecl);1904 handleDecl( typedefDecl, typedefDecl->base ); 1892 1905 } 1893 1906 1894 1907 /// Strips the members from a generic aggregate 1895 static void stripGenericMembers( AggregateDecl * decl) {1908 void stripGenericMembers(AggregateDecl * decl) { 1896 1909 if ( ! decl->parameters.empty() ) decl->members.clear(); 1897 1910 } … … 1903 1916 void Pass3::premutate( UnionDecl * unionDecl ) { 1904 1917 stripGenericMembers( unionDecl ); 1918 } 1919 1920 void Pass3::premutate( TypeDecl * typeDecl ) { 1921 addToTyVarMap( typeDecl, scopeTyVars ); 1922 } 1923 1924 void Pass3::premutate( PointerType * pointerType ) { 1925 GuardScope( scopeTyVars ); 1926 makeTyVarMap( pointerType, scopeTyVars ); 1927 } 1928 1929 void Pass3::premutate( FunctionType * functionType ) { 1930 GuardScope( scopeTyVars ); 1931 makeTyVarMap( functionType, scopeTyVars ); 1905 1932 } 1906 1933 } // anonymous namespace … … 1912 1939 // compile-command: "make install" // 1913 1940 // End: // 1941
Note:
See TracChangeset
for help on using the changeset viewer.