Changeset 1346914 for src/AST/Node.hpp


Ignore:
Timestamp:
Jun 4, 2019, 5:53:39 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
67130fe, 93744b5
Parents:
9519aba
Message:

Fix Mangler port to new AST

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.hpp

    r9519aba r1346914  
    1818#include <cassert>
    1919#include <iosfwd>
     20
     21#include "Common/ErrorObjects.h"  // for SemanticErrorException
    2022
    2123namespace ast {
     
    100102}
    101103
     104/// Call a visitor on a collection of nodes, throwing any exceptions when completed
     105template< typename Container >
     106void accept_each( const Container & c, Visitor & v ) {
     107        SemanticErrorException errors;
     108        for ( const auto & i : c ) {
     109                try {
     110                        if ( i ) {
     111                                i->accept( v );
     112                        }
     113                } catch ( SemanticErrorException & e ) {
     114                        errors.append( e );
     115                }
     116        }
     117        if ( ! errors.isEmpty() ) {
     118                throw errors;
     119        }
     120}
     121
    102122/// Base class for the smart pointer types
    103123/// should never really be used.
Note: See TracChangeset for help on using the changeset viewer.