Changes in src/AST/Util.cpp [b7c53a9d:0658672]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Util.cpp
rb7c53a9d r0658672 102 102 } 103 103 104 /// Check for Floating Nodes:105 /// Every node should be reachable from a root (the TranslationUnit) via a106 /// chain of structural references (tracked with ptr). This cannot check all107 /// of that, it just checks if a given node's field has a strong reference.108 template<typename node_t, typename field_t>109 void noFloatingNode( const node_t * node, field_t node_t::*field_ptr ) {110 const field_t & field = node->*field_ptr;111 if ( nullptr == field ) return;112 assertf( field->isManaged(), "Floating node found." );113 }114 115 104 struct InvariantCore { 116 105 // To save on the number of visits: this is a kind of composed core. … … 138 127 } 139 128 140 void previsit( const VariableExpr * node ) {141 previsit( (const ParseNode *)node );142 noFloatingNode( node, &VariableExpr::var );143 }144 145 129 void previsit( const MemberExpr * node ) { 146 130 previsit( (const ParseNode *)node ); 147 131 memberMatchesAggregate( node ); 148 }149 150 void previsit( const StructInstType * node ) {151 previsit( (const Node *)node );152 noFloatingNode( node, &StructInstType::base );153 }154 155 void previsit( const UnionInstType * node ) {156 previsit( (const Node *)node );157 noFloatingNode( node, &UnionInstType::base );158 }159 160 void previsit( const EnumInstType * node ) {161 previsit( (const Node *)node );162 noFloatingNode( node, &EnumInstType::base );163 }164 165 void previsit( const TypeInstType * node ) {166 previsit( (const Node *)node );167 noFloatingNode( node, &TypeInstType::base );168 132 } 169 133
Note:
See TracChangeset
for help on using the changeset viewer.