Changeset 15215f02 for src/AST


Ignore:
Timestamp:
Apr 22, 2024, 11:37:36 PM (21 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
13de4478
Parents:
0fe07be (diff), d7c0ad5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/AST
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    r0fe07be r15215f02  
    113113        static auto read( node_type const * node, Args&&... args ) {
    114114                Pass<core_t> visitor( std::forward<Args>( args )... );
    115                 auto const * temp = node->accept( visitor );
    116                 assert( temp == node );
    117                 return visitor.get_result();
    118         }
    119 
    120         // Versions of the above for older compilers.
    121         template< typename... Args >
    122         static void run( TranslationUnit & decls ) {
    123                 Pass<core_t> visitor;
    124                 accept_all( decls, visitor );
    125         }
    126 
    127         template< typename node_type, typename... Args >
    128         static auto read( node_type const * node ) {
    129                 Pass<core_t> visitor;
    130115                auto const * temp = node->accept( visitor );
    131116                assert( temp == node );
  • src/AST/Print.cpp

    r0fe07be r15215f02  
    15791579                preprint( node );
    15801580                os << "enum attr ";
    1581         if ( node->attr == ast::EnumAttribute::Label ) {
    1582             os << "Label ";
    1583         } else if ( node->attr == ast::EnumAttribute::Value ) {
    1584             os << "Value ";
    1585         } else {
    1586             os << "Posn ";
    1587         }
     1581                if ( node->attr == ast::EnumAttribute::Label ) {
     1582                        os << "Label ";
     1583                } else if ( node->attr == ast::EnumAttribute::Value ) {
     1584                        os << "Value ";
     1585                } else {
     1586                        os << "Posn ";
     1587                }
    15881588                (*(node->instance)).accept( *this );
    15891589                return node;
  • src/AST/Type.hpp

    r0fe07be r15215f02  
    3131// Must be included in *all* AST classes; should be #undef'd at the end of the file
    3232#define MUTATE_FRIEND \
    33     template<typename node_t> friend node_t * mutate(const node_t * node); \
     33        template<typename node_t> friend node_t * mutate(const node_t * node); \
    3434        template<typename node_t> friend node_t * shallowCopy(const node_t * node);
    3535
     
    322322public:
    323323        readonly<EnumInstType> instance;
    324     EnumAttribute attr;
     324        EnumAttribute attr;
    325325        const Type * accept( Visitor & v ) const override { return v.visit( this ); }
    326326        EnumAttrType( const EnumInstType * instance, EnumAttribute attr = EnumAttribute::Posn )
    327327                : instance(instance), attr(attr) {}
    328        
    329     bool match( const ast::EnumAttrType * other) const {
    330         return instance->base->name == other->instance->base->name && attr == other->attr;
    331     }
     328
     329        bool match( const ast::EnumAttrType * other) const {
     330                return instance->base->name == other->instance->base->name && attr == other->attr;
     331        }
    332332private:
    333333        EnumAttrType * clone() const override { return new EnumAttrType{ *this }; }
Note: See TracChangeset for help on using the changeset viewer.