Changeset efe420f3


Ignore:
Timestamp:
Sep 14, 2023, 7:42:11 AM (8 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
334e0cf2, a738c68
Parents:
f64cc42 (diff), bfeb37a6 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Util.cpp

    rf64cc42 refe420f3  
    104104        }
    105105        assertf( false, "Member not found." );
     106}
     107
     108template<typename node_t>
     109void oneOfExprOrType( const node_t * node ) {
     110        if ( node->expr ) {
     111                assertf( node->expr && !node->type, "Exactly one of expr or type should be set." );
     112        } else {
     113                assertf( !node->expr && node->type, "Exactly one of expr or type should be set." );
     114        }
    106115}
    107116
     
    152161        }
    153162
     163        void previsit( const SizeofExpr * node ) {
     164                previsit( (const ParseNode *)node );
     165                oneOfExprOrType( node );
     166        }
     167
     168        void previsit( const AlignofExpr * node ) {
     169                previsit( (const ParseNode *)node );
     170                oneOfExprOrType( node );
     171        }
     172
    154173        void previsit( const StructInstType * node ) {
    155174                previsit( (const Node *)node );
     
    181200/// referring to is in scope by the structural rules of code.
    182201// Any escapes marked with a bug should be removed once the bug is fixed.
     202// This is a separate pass because of it changes the visit pattern and
     203// must always be run on the entire translation unit.
    183204struct InScopeCore : public ast::WithShortCircuiting {
    184205        ScopedSet<DeclWithType const *> typedDecls;
Note: See TracChangeset for help on using the changeset viewer.