Changeset bae0d35 for src


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
Files:
5 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        }
  • src/CodeTools/ResolvProtoDump.cc

    r82f4063 rbae0d35  
    746746                        // print child scopes
    747747                        ++indent;
    748                         for ( const PassVisitor<ProtoDump>& s : subs ) {
     748                        for ( const ProtoDump & s : subs ) {
    749749                                std::cout << tab << '{' << std::endl;
    750                                 s.pass.print( indent );
     750                                s.print( indent );
    751751                                std::cout << tab << '}' << std::endl;
    752752                        }
  • src/main.cc

    r82f4063 rbae0d35  
    160160#define SIGPARMS int sig __attribute__(( unused )), siginfo_t * sfp __attribute__(( unused )), ucontext_t * cxt __attribute__(( unused ))
    161161
    162 static void Signal( int sig, void (* handler)(SIGPARMS), int flags ) {
    163         struct sigaction act;
    164 
    165         act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
     162static void _Signal(struct sigaction & act, int sig, int flags ) {
    166163        act.sa_flags = flags;
    167164
     
    170167            _exit( EXIT_FAILURE );
    171168        } // if
     169}
     170
     171static void Signal( int sig, void (* handler)(SIGPARMS), int flags ) {
     172        struct sigaction act;
     173        act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler;
     174        _Signal(act, sig, flags);
     175} // Signal
     176
     177static void Signal( int sig, void (* handler)(int), int flags ) {
     178        struct sigaction act;
     179        act.sa_handler = handler;
     180        _Signal(act, sig, flags);
    172181} // Signal
    173182
     
    202211static void sigAbortHandler( SIGPARMS ) {
    203212        backtrace( 6 );                                                                         // skip first 6 stack frames
    204         Signal( SIGABRT, (void (*)(SIGPARMS))SIG_DFL, SA_SIGINFO );     // reset default signal handler
     213        Signal( SIGABRT, SIG_DFL, SA_SIGINFO ); // reset default signal handler
    205214        raise( SIGABRT );                                                                       // reraise SIGABRT
    206215} // sigAbortHandler
Note: See TracChangeset for help on using the changeset viewer.