Ignore:
Timestamp:
Jul 12, 2022, 3:21:18 PM (2 years 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/EliminateTypedef.cpp

    r9c6443e r1931bb01  
    1010// Created On       : Wed Apr 20 16:37:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Apr 25 14:26:00 2022
    13 // Update Count     : 0
     12// Last Modified On : Mon Jul 11 16:30:00 2022
     13// Update Count     : 1
    1414//
    1515
     
    2828
    2929struct EliminateTypedefCore {
     30        // Remove typedefs from inside aggregates.
    3031        ast::StructDecl const * previsit( ast::StructDecl const * decl );
    3132        ast::UnionDecl const * previsit( ast::UnionDecl const * decl );
     33        // Remove typedefs from statement lists.
    3234        ast::CompoundStmt const * previsit( ast::CompoundStmt const * stmt );
     35        // Remove typedefs from control structure initializers.
     36        ast::IfStmt const * previsit( ast::IfStmt const * stmt );
     37        ast::ForStmt const * previsit( ast::ForStmt const * stmt );
     38        ast::WhileDoStmt const * previsit( ast::WhileDoStmt const * stmt );
    3339};
    3440
     
    6369}
    6470
     71ast::IfStmt const * EliminateTypedefCore::previsit( ast::IfStmt const * stmt ) {
     72        return field_erase_if( stmt, &ast::IfStmt::inits, isTypedefStmt );
     73}
     74
     75ast::ForStmt const * EliminateTypedefCore::previsit( ast::ForStmt const * stmt ) {
     76        return field_erase_if( stmt, &ast::ForStmt::inits, isTypedefStmt );
     77}
     78
     79ast::WhileDoStmt const * EliminateTypedefCore::previsit( ast::WhileDoStmt const * stmt ) {
     80        return field_erase_if( stmt, &ast::WhileDoStmt::inits, isTypedefStmt );
     81}
     82
    6583} // namespace
    6684
Note: See TracChangeset for help on using the changeset viewer.