Changeset be8518f for src/AST/AssertAcyclic.cpp
- Timestamp:
- Jun 7, 2019, 3:14:07 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 05d55ff, 9856ca9
- Parents:
- ef75948
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/AssertAcyclic.cpp
ref75948 rbe8518f 10 10 // Created On : Thu Jun 06 15:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 06 15:00:00 201913 // Update Count : 012 // Last Modified On : Fri Jun 07 14:32:00 2019 13 // Update Count : 1 14 14 // 15 15 … … 20 20 namespace { 21 21 22 class NoStrongCyclesCore : public ast::WithGuards{22 class NoStrongCyclesCore { 23 23 std::vector<const ast::Node *> parents; 24 24 public: 25 void previsit 26 for (auto & p : parents) {27 assert(p != node);25 void previsit( const ast::Node * node ) { 26 for (auto & parent : parents) { 27 assert(parent != node); 28 28 } 29 29 parents.push_back(node); 30 GuardAction( [this]() { parents.pop_back(); } ); 30 } 31 void postvisit( const ast::Node * ) { 32 parents.pop_back(); 31 33 } 32 34 }; … … 36 38 namespace ast { 37 39 38 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > translationUnit ) {40 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > & translationUnit ) { 39 41 Pass<NoStrongCyclesCore> visitor; 40 42 for ( auto & decl : translationUnit ) {
Note: See TracChangeset
for help on using the changeset viewer.