Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Util.cpp

    rb7c53a9d r0658672  
    102102}
    103103
    104 /// Check for Floating Nodes:
    105 /// Every node should be reachable from a root (the TranslationUnit) via a
    106 /// chain of structural references (tracked with ptr). This cannot check all
    107 /// 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 
    115104struct InvariantCore {
    116105        // To save on the number of visits: this is a kind of composed core.
     
    138127        }
    139128
    140         void previsit( const VariableExpr * node ) {
    141                 previsit( (const ParseNode *)node );
    142                 noFloatingNode( node, &VariableExpr::var );
    143         }
    144 
    145129        void previsit( const MemberExpr * node ) {
    146130                previsit( (const ParseNode *)node );
    147131                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 );
    168132        }
    169133
Note: See TracChangeset for help on using the changeset viewer.