Changeset 1931bb01 for src/SymTab


Ignore:
Timestamp:
Jul 12, 2022, 3:21:18 PM (22 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
b9f8274
Parents:
9c6443e
Message:

Converted 'Validate A' to the new AST. There some utility changes as well.

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/FixFunction.cc

    r9c6443e r1931bb01  
    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

    r9c6443e r1931bb01  
    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
Note: See TracChangeset for help on using the changeset viewer.