Changes in src/AST/AssertAcyclic.cpp [be8518f:7cc0344]
- File:
-
- 1 edited
-
src/AST/AssertAcyclic.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/AssertAcyclic.cpp
rbe8518f r7cc0344 10 10 // Created On : Thu Jun 06 15:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 07 14:32:00 201913 // Update Count : 112 // Last Modified On : Thu Jun 06 15:00:00 2019 13 // Update Count : 0 14 14 // 15 15 … … 20 20 namespace { 21 21 22 class NoStrongCyclesCore {22 class NoStrongCyclesCore : public ast::WithGuards { 23 23 std::vector<const ast::Node *> parents; 24 24 public: 25 void previsit ( const ast::Node * node ) {26 for (auto & p arent: parents) {27 assert(p arent!= node);25 void previsit ( const ast::Node * node ) { 26 for (auto & p : parents) { 27 assert(p != node); 28 28 } 29 29 parents.push_back(node); 30 } 31 void postvisit( const ast::Node * ) { 32 parents.pop_back(); 30 GuardAction( [this]() { parents.pop_back(); } ); 33 31 } 34 32 }; … … 38 36 namespace ast { 39 37 40 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > &translationUnit ) {38 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > translationUnit ) { 41 39 Pass<NoStrongCyclesCore> visitor; 42 40 for ( auto & decl : translationUnit ) {
Note:
See TracChangeset
for help on using the changeset viewer.