Changeset d60ccbf for src/SymTab/Indexer.cc
- Timestamp:
- Aug 12, 2015, 2:27:31 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- f32c7f4
- Parents:
- e45215c (diff), e869d663 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.cc
re45215c rd60ccbf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:37:33 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jun 5 08:05:17201513 // Update Count : 511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 05 13:52:42 2015 13 // Update Count : 10 14 14 // 15 15 … … 26 26 27 27 namespace SymTab { 28 template< typename Container, typename VisitorType > 29 inline void acceptAllNewScope( Container &container, VisitorType &visitor ) { 30 visitor.enterScope(); 31 acceptAll( container, visitor ); 32 visitor.leaveScope(); 33 } 34 28 35 Indexer::Indexer( bool useDebug ) : doDebug( useDebug ) {} 29 36 … … 31 38 32 39 void Indexer::visit( ObjectDecl *objectDecl ) { 40 enterScope(); 33 41 maybeAccept( objectDecl->get_type(), *this ); 42 leaveScope(); 34 43 maybeAccept( objectDecl->get_init(), *this ); 35 44 maybeAccept( objectDecl->get_bitfieldWidth(), *this ); … … 149 158 leaveScope(); 150 159 } 160 161 162 void Indexer::visit( ApplicationExpr *applicationExpr ) { 163 acceptAllNewScope( applicationExpr->get_results(), *this ); 164 maybeAccept( applicationExpr->get_function(), *this ); 165 acceptAll( applicationExpr->get_args(), *this ); 166 } 167 168 void Indexer::visit( UntypedExpr *untypedExpr ) { 169 acceptAllNewScope( untypedExpr->get_results(), *this ); 170 acceptAll( untypedExpr->get_args(), *this ); 171 } 172 173 void Indexer::visit( NameExpr *nameExpr ) { 174 acceptAllNewScope( nameExpr->get_results(), *this ); 175 } 176 177 void Indexer::visit( AddressExpr *addressExpr ) { 178 acceptAllNewScope( addressExpr->get_results(), *this ); 179 maybeAccept( addressExpr->get_arg(), *this ); 180 } 181 182 void Indexer::visit( LabelAddressExpr *labAddressExpr ) { 183 acceptAllNewScope( labAddressExpr->get_results(), *this ); 184 maybeAccept( labAddressExpr->get_arg(), *this ); 185 } 186 187 void Indexer::visit( CastExpr *castExpr ) { 188 acceptAllNewScope( castExpr->get_results(), *this ); 189 maybeAccept( castExpr->get_arg(), *this ); 190 } 191 192 void Indexer::visit( UntypedMemberExpr *memberExpr ) { 193 acceptAllNewScope( memberExpr->get_results(), *this ); 194 maybeAccept( memberExpr->get_aggregate(), *this ); 195 } 196 197 void Indexer::visit( MemberExpr *memberExpr ) { 198 acceptAllNewScope( memberExpr->get_results(), *this ); 199 maybeAccept( memberExpr->get_aggregate(), *this ); 200 } 201 202 void Indexer::visit( VariableExpr *variableExpr ) { 203 acceptAllNewScope( variableExpr->get_results(), *this ); 204 } 205 206 void Indexer::visit( ConstantExpr *constantExpr ) { 207 acceptAllNewScope( constantExpr->get_results(), *this ); 208 maybeAccept( constantExpr->get_constant(), *this ); 209 } 210 211 void Indexer::visit( SizeofExpr *sizeofExpr ) { 212 acceptAllNewScope( sizeofExpr->get_results(), *this ); 213 if ( sizeofExpr->get_isType() ) { 214 maybeAccept( sizeofExpr->get_type(), *this ); 215 } else { 216 maybeAccept( sizeofExpr->get_expr(), *this ); 217 } 218 } 219 220 void Indexer::visit( AttrExpr *attrExpr ) { 221 acceptAllNewScope( attrExpr->get_results(), *this ); 222 if ( attrExpr->get_isType() ) { 223 maybeAccept( attrExpr->get_type(), *this ); 224 } else { 225 maybeAccept( attrExpr->get_expr(), *this ); 226 } 227 } 228 229 void Indexer::visit( LogicalExpr *logicalExpr ) { 230 acceptAllNewScope( logicalExpr->get_results(), *this ); 231 maybeAccept( logicalExpr->get_arg1(), *this ); 232 maybeAccept( logicalExpr->get_arg2(), *this ); 233 } 234 235 void Indexer::visit( ConditionalExpr *conditionalExpr ) { 236 acceptAllNewScope( conditionalExpr->get_results(), *this ); 237 maybeAccept( conditionalExpr->get_arg1(), *this ); 238 maybeAccept( conditionalExpr->get_arg2(), *this ); 239 maybeAccept( conditionalExpr->get_arg3(), *this ); 240 } 241 242 void Indexer::visit( CommaExpr *commaExpr ) { 243 acceptAllNewScope( commaExpr->get_results(), *this ); 244 maybeAccept( commaExpr->get_arg1(), *this ); 245 maybeAccept( commaExpr->get_arg2(), *this ); 246 } 247 248 void Indexer::visit( TupleExpr *tupleExpr ) { 249 acceptAllNewScope( tupleExpr->get_results(), *this ); 250 acceptAll( tupleExpr->get_exprs(), *this ); 251 } 252 253 void Indexer::visit( SolvedTupleExpr *tupleExpr ) { 254 acceptAllNewScope( tupleExpr->get_results(), *this ); 255 acceptAll( tupleExpr->get_exprs(), *this ); 256 } 257 258 void Indexer::visit( TypeExpr *typeExpr ) { 259 acceptAllNewScope( typeExpr->get_results(), *this ); 260 maybeAccept( typeExpr->get_type(), *this ); 261 } 262 263 void Indexer::visit( AsmExpr *asmExpr ) { 264 maybeAccept( asmExpr->get_inout(), *this ); 265 maybeAccept( asmExpr->get_constraint(), *this ); 266 maybeAccept( asmExpr->get_operand(), *this ); 267 } 268 269 void Indexer::visit( UntypedValofExpr *valofExpr ) { 270 acceptAllNewScope( valofExpr->get_results(), *this ); 271 maybeAccept( valofExpr->get_body(), *this ); 272 } 273 151 274 152 275 void Indexer::visit( ContextInstType *contextInst ) {
Note:
See TracChangeset
for help on using the changeset viewer.