Changes in / [cdbab55:efa8b6a]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rcdbab55 refa8b6a 30 30 #include "RenameVars.h" // for RenameVars, global_renamer 31 31 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment 32 #include "ResolveTypeof.h" // for resolveTypeof 32 33 #include "Resolver.h" 33 34 #include "SymTab/Autogen.h" // for SizeType … … 56 57 void postvisit( FunctionDecl *functionDecl ); 57 58 void previsit( ObjectDecl *objectDecll ); 59 void previsit( TypeDecl *typeDecl ); 58 60 void previsit( EnumDecl * enumDecl ); 59 61 void previsit( StaticAssertDecl * assertDecl ); … … 301 303 302 304 void Resolver::previsit( ObjectDecl *objectDecl ) { 305 Type *new_type = resolveTypeof( objectDecl->get_type(), indexer ); 306 objectDecl->set_type( new_type ); 303 307 // To handle initialization of routine pointers, e.g., int (*fp)(int) = foo(), means that class-variable 304 308 // initContext is changed multiple time because the LHS is analysed twice. The second analysis changes … … 330 334 } 331 335 336 void Resolver::previsit( TypeDecl *typeDecl ) { 337 if ( typeDecl->get_base() ) { 338 Type *new_type = resolveTypeof( typeDecl->get_base(), indexer ); 339 typeDecl->set_base( new_type ); 340 } // if 341 } 342 332 343 void Resolver::previsit( FunctionDecl *functionDecl ) { 333 344 #if 0 … … 336 347 std::cerr << std::endl; 337 348 #endif 349 Type *new_type = resolveTypeof( functionDecl->type, indexer ); 350 functionDecl->set_type( new_type ); 338 351 GuardValue( functionReturn ); 339 352 functionReturn = ResolvExpr::extractResultType( functionDecl->type ); -
src/SymTab/Validate.cc
rcdbab55 refa8b6a 62 62 #include "ResolvExpr/typeops.h" // for typesCompatible 63 63 #include "ResolvExpr/Resolver.h" // for findSingleExpression 64 #include "ResolvExpr/ResolveTypeof.h" // for resolveTypeof65 64 #include "SymTab/Autogen.h" // for SizeType 66 65 #include "SynTree/Attribute.h" // for noAttributes, Attribute … … 248 247 void previsit( StructInstType * inst ); 249 248 void previsit( UnionInstType * inst ); 250 };251 252 struct FixObjectType : public WithIndexer {253 /// resolves typeof type in object, function, and type declarations254 static void fix( std::list< Declaration * > & translationUnit );255 256 void previsit( ObjectDecl * );257 void previsit( FunctionDecl * );258 void previsit( TypeDecl * );259 249 }; 260 250 … … 322 312 Concurrency::implementThreadStarter( translationUnit ); 323 313 mutateAll( translationUnit, compoundliteral ); 324 FixObjectType::fix( translationUnit );325 314 ArrayLength::computeLength( translationUnit ); 326 315 acceptAll( translationUnit, finder ); // xxx - remove this pass soon … … 1249 1238 } 1250 1239 1251 void FixObjectType::fix( std::list< Declaration * > & translationUnit ) {1252 PassVisitor<FixObjectType> fixer;1253 acceptAll( translationUnit, fixer );1254 }1255 1256 void FixObjectType::previsit( ObjectDecl * objDecl ) {1257 Type *new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer );1258 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1259 objDecl->set_type( new_type );1260 }1261 1262 void FixObjectType::previsit( FunctionDecl * funcDecl ) {1263 Type *new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer );1264 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1265 funcDecl->set_type( new_type );1266 }1267 1268 void FixObjectType::previsit( TypeDecl *typeDecl ) {1269 if ( typeDecl->get_base() ) {1270 Type *new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer );1271 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1272 typeDecl->set_base( new_type );1273 } // if1274 }1275 1276 1240 void ArrayLength::computeLength( std::list< Declaration * > & translationUnit ) { 1277 1241 PassVisitor<ArrayLength> len; -
tests/.expect/gccExtensions.x64.txt
rcdbab55 refa8b6a 29 29 volatile signed int _X2v1Vi_2; 30 30 volatile signed int _X2v2Vi_2; 31 signed int _X2t1 i_2;32 signed int _X2t2 i_2;31 signed int _X2t1_2; 32 signed int _X2t2_2; 33 33 __extension__ const signed int _X2exKi_2; 34 34 struct S { -
tests/.expect/gccExtensions.x86.txt
rcdbab55 refa8b6a 29 29 volatile signed int _X2v1Vi_2; 30 30 volatile signed int _X2v2Vi_2; 31 signed int _X2t1 i_2;32 signed int _X2t2 i_2;31 signed int _X2t1_2; 32 signed int _X2t2_2; 33 33 __extension__ const signed int _X2exKi_2; 34 34 struct S {
Note: See TracChangeset
for help on using the changeset viewer.