Changeset d4b37ab for src/SymTab


Ignore:
Timestamp:
Jul 13, 2022, 11:16:56 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
af75a87, d958834b
Parents:
25404c7 (diff), b9f8274 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/SymTab
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/FixFunction.cc

    r25404c7 rd4b37ab  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 16:19:49 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  6 23:36:59 2017
    13 // Update Count     : 6
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Jul 12 14:28:00 2022
     13// Update Count     : 7
    1414//
    1515
     
    122122                }
    123123
     124                void previsit( const ast::FunctionType * ) { visit_children = false; }
     125
     126                const ast::Type * postvisit( const ast::FunctionType * type ) {
     127                        return new ast::PointerType( type );
     128                }
     129
    124130                void previsit( const ast::VoidType * ) { isVoid = true; }
    125131
     
    145151}
    146152
     153const ast::Type * fixFunction( const ast::Type * type, bool & isVoid ) {
     154        ast::Pass< FixFunction_new > fixer;
     155        type = type->accept( fixer );
     156        isVoid |= fixer.core.isVoid;
     157        return type;
     158}
     159
    147160} // namespace SymTab
    148161
  • src/SymTab/FixFunction.h

    r25404c7 rd4b37ab  
    1010// Created On       : Sun May 17 17:02:08 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:45:55 2017
    13 // Update Count     : 4
     12// Last Modified On : Tue Jul 12 14:19:00 2022
     13// Update Count     : 5
    1414//
    1515
     
    2121namespace ast {
    2222        class DeclWithType;
     23        class Type;
    2324}
    2425
     
    3132        /// Sets isVoid to true if type is void
    3233        const ast::DeclWithType * fixFunction( const ast::DeclWithType * dwt, bool & isVoid );
     34        const ast::Type * fixFunction( const ast::Type * type, bool & isVoid );
    3335} // namespace SymTab
    3436
  • src/SymTab/Validate.cc

    r25404c7 rd4b37ab  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue May 17 14:36:00 2022
    13 // Update Count     : 366
     12// Last Modified On : Tue Jul 12 15:00:00 2022
     13// Update Count     : 367
    1414//
    1515
     
    294294        };
    295295
    296         void validate_A( std::list< Declaration * > & translationUnit ) {
     296        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    297297                PassVisitor<HoistTypeDecls> hoistDecls;
    298298                {
     
    305305                        decayEnumsAndPointers( translationUnit ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling
    306306                }
    307         }
    308 
    309         void validate_B( std::list< Declaration * > & translationUnit ) {
    310307                PassVisitor<FixQualifiedTypes> fixQual;
    311308                {
     
    317314                        EliminateTypedef::eliminateTypedef( translationUnit );
    318315                }
    319         }
    320 
    321         void validate_C( std::list< Declaration * > & translationUnit ) {
    322316                PassVisitor<ValidateGenericParameters> genericParams;
    323317                PassVisitor<ResolveEnumInitializers> rei( nullptr );
     
    343337                        });
    344338                }
    345         }
    346 
    347         void validate_D( std::list< Declaration * > & translationUnit ) {
    348339                {
    349340                        Stats::Heap::newPass("validate-D");
     
    362353                        });
    363354                }
    364         }
    365 
    366         void validate_E( std::list< Declaration * > & translationUnit ) {
    367355                PassVisitor<CompoundLiteral> compoundliteral;
    368356                {
     
    384372                        }
    385373                }
    386         }
    387 
    388         void validate_F( std::list< Declaration * > & translationUnit ) {
    389374                PassVisitor<LabelAddressFixer> labelAddrFixer;
    390375                {
     
    410395                        }
    411396                }
    412         }
    413 
    414         void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    415                 validate_A( translationUnit );
    416                 validate_B( translationUnit );
    417                 validate_C( translationUnit );
    418                 validate_D( translationUnit );
    419                 validate_E( translationUnit );
    420                 validate_F( translationUnit );
    421397        }
    422398
  • src/SymTab/Validate.h

    r25404c7 rd4b37ab  
    1111// Created On       : Sun May 17 21:53:34 2015
    1212// Last Modified By : Andrew Beach
    13 // Last Modified On : Tue May 17 14:35:00 2022
    14 // Update Count     : 5
     13// Last Modified On : Tue Jul 12 15:30:00 2022
     14// Update Count     : 6
    1515//
    1616
     
    1919#include <list>  // for list
    2020
    21 struct CodeLocation;
    22 class  Declaration;
    23 class  Type;
    24 
    25 namespace ast {
    26         class Type;
    27         class SymbolTable;
    28 }
     21class Declaration;
    2922
    3023namespace SymTab {
    31         class Indexer;
    32 
    3324        /// Normalizes struct and function declarations
    3425        void validate( std::list< Declaration * > &translationUnit, bool doDebug = false );
    35 
    36         // Sub-passes of validate.
    37         void validate_A( std::list< Declaration * > &translationUnit );
    38         void validate_B( std::list< Declaration * > &translationUnit );
    39         void validate_C( std::list< Declaration * > &translationUnit );
    40         void validate_D( std::list< Declaration * > &translationUnit );
    41         void validate_E( std::list< Declaration * > &translationUnit );
    42         void validate_F( std::list< Declaration * > &translationUnit );
    4326} // namespace SymTab
    4427
Note: See TracChangeset for help on using the changeset viewer.