Changeset ef3d798
- Timestamp:
- Nov 30, 2017, 5:39:14 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c3f551b
- Parents:
- 1fbeebd
- git-author:
- Rob Schluntz <rschlunt@…> (11/30/17 17:38:11)
- git-committer:
- Rob Schluntz <rschlunt@…> (11/30/17 17:39:14)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r1fbeebd ref3d798 48 48 }; 49 49 50 class InitDepthChecker : public Visitor { 51 public: 50 struct InitDepthChecker : public WithGuards { 52 51 bool depthOkay = true; 53 52 Type * type; … … 61 60 maxDepth++; 62 61 } 63 v irtual void visit( ListInit * listInit) {62 void previsit( ListInit * ) { 64 63 curDepth++; 64 GuardAction( [this]() { curDepth--; } ); 65 65 if ( curDepth > maxDepth ) depthOkay = false; 66 Visitor::visit( listInit );67 curDepth--;68 66 } 69 67 }; … … 102 100 103 101 bool checkInitDepth( ObjectDecl * objDecl ) { 104 InitDepthChecker checker( objDecl->get_type());105 maybeAccept( objDecl-> get_init(), checker );106 return checker. depthOkay;102 PassVisitor<InitDepthChecker> checker( objDecl->type ); 103 maybeAccept( objDecl->init, checker ); 104 return checker.pass.depthOkay; 107 105 } 108 106
Note: See TracChangeset
for help on using the changeset viewer.