Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r2b79a70 rac3362c  
    6262#include "ResolvExpr/typeops.h"        // for typesCompatible
    6363#include "ResolvExpr/Resolver.h"       // for findSingleExpression
    64 #include "ResolvExpr/ResolveTypeof.h"  // for resolveTypeof
    6564#include "SymTab/Autogen.h"            // for SizeType
    6665#include "SynTree/Attribute.h"         // for noAttributes, Attribute
     
    248247                void previsit( StructInstType * inst );
    249248                void previsit( UnionInstType * inst );
    250         };
    251 
    252         struct FixObjectType : public WithIndexer {
    253                 /// resolves typeof type in object, function, and type declarations
    254                 static void fix( std::list< Declaration * > & translationUnit );
    255 
    256                 void previsit( ObjectDecl * );
    257                 void previsit( FunctionDecl * );
    258                 void previsit( TypeDecl * );
    259249        };
    260250
     
    322312                Concurrency::implementThreadStarter( translationUnit );
    323313                mutateAll( translationUnit, compoundliteral );
    324                 FixObjectType::fix( translationUnit );
    325314                ArrayLength::computeLength( translationUnit );
    326315                acceptAll( translationUnit, finder ); // xxx - remove this pass soon
     
    12491238        }
    12501239
    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 type
    1259                 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 type
    1265                 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 type
    1272                         typeDecl->set_base( new_type );
    1273                 } // if
    1274         }
    1275 
    12761240        void ArrayLength::computeLength( std::list< Declaration * > & translationUnit ) {
    12771241                PassVisitor<ArrayLength> len;
Note: See TracChangeset for help on using the changeset viewer.