Changeset bae0d35 for src/AST


Ignore:
Timestamp:
Jun 7, 2021, 2:09:12 PM (5 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
5a46e09
Parents:
82f4063 (diff), 53692b3 (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:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.proto.hpp

    r82f4063 rbae0d35  
    119119        template<typename core_t, typename node_t>
    120120        struct is_valid_previsit {
    121                 using ret_t = decltype( ((core_t*)nullptr)->previsit( (const node_t *)nullptr ) );
     121                using ret_t = decltype( std::declval<core_t*>()->previsit( std::declval<const node_t *>() ) );
    122122
    123123                static constexpr bool value = std::is_void< ret_t >::value ||
  • src/AST/Type.hpp

    r82f4063 rbae0d35  
    402402
    403403        // compact representation used for map lookups.
    404         struct TypeEnvKey { 
    405                 const TypeDecl * base;
    406                 int formal_usage;
    407                 int expr_id;
     404        struct TypeEnvKey {
     405                const TypeDecl * base = nullptr;
     406                int formal_usage = 0;
     407                int expr_id = 0;
    408408
    409409                TypeEnvKey() = default;
     
    440440        const Type * accept( Visitor & v ) const override { return v.visit( this ); }
    441441
    442         std::string typeString() const { 
    443                 if (formal_usage > 0) return std::string("_") + std::to_string(formal_usage) + "_" + std::to_string(expr_id) + "_" + name; 
     442        std::string typeString() const {
     443                if (formal_usage > 0) return std::string("_") + std::to_string(formal_usage) + "_" + std::to_string(expr_id) + "_" + name;
    444444                else return name;
    445445        }
     
    548548                        res = p * res + x.expr_id;
    549549                        return res;
    550                 } 
     550                }
    551551        };
    552552}
  • src/AST/TypeEnvironment.cpp

    r82f4063 rbae0d35  
    115115
    116116void TypeEnvironment::add( const TypeSubstitution & sub ) {
    117         for ( const auto p : sub ) {
     117        for ( const auto & p : sub ) {
    118118                add( EqvClass{ p.first, p.second } );
    119119        }
Note: See TracChangeset for help on using the changeset viewer.