Changeset bfeb37a6
- Timestamp:
- Sep 13, 2023, 11:46:22 AM (16 months ago)
- Branches:
- master
- Children:
- efe420f3
- Parents:
- 1ed5e9e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Util.cpp
r1ed5e9e rbfeb37a6 104 104 } 105 105 assertf( false, "Member not found." ); 106 } 107 108 template<typename node_t> 109 void 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 } 106 115 } 107 116 … … 152 161 } 153 162 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 154 173 void previsit( const StructInstType * node ) { 155 174 previsit( (const Node *)node ); … … 181 200 /// referring to is in scope by the structural rules of code. 182 201 // 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. 183 204 struct InScopeCore : public ast::WithShortCircuiting { 184 205 ScopedSet<DeclWithType const *> typedDecls;
Note: See TracChangeset
for help on using the changeset viewer.