Changeset 800bae1


Ignore:
Timestamp:
Jun 17, 2019, 3:37:00 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
54b3fde, 6e55240
Parents:
89faa82 (diff), aba20d2 (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

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • configure

    r89faa82 r800bae1  
    796796with_cfa_name
    797797with_target_hosts
     798enable_gprofiler
    798799enable_dependency_tracking
    799800enable_shared
     
    14551456  --enable-silent-rules   less verbose build output (undo: "make V=1")
    14561457  --disable-silent-rules  verbose build output (undo: "make V=0")
     1458  --enable-gprofiler     whether or not to enable gprofiler tools (if available)
    14571459  --enable-dependency-tracking
    14581460                          do not reject slow dependency extractors
     
    32833285                \'--with-target-hosts=*) ;;
    32843286
     3287                # skip gprofiler for libcfa
     3288                \'--enable-gprofiler=*) ;;
     3289                \'--disable-gprofiler) ;;
     3290
    32853291                # append all other arguments to the sub configure arguments
    32863292                *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";;
     
    33843390else
    33853391  target_hosts=${default_target}
     3392fi
     3393
     3394
     3395# Check whether --enable-gprofiler was given.
     3396if test "${enable_gprofiler+set}" = set; then :
     3397  enableval=$enable_gprofiler; enable_gprofiler=$enableval
     3398else
     3399  enable_gprofiler=yes
    33863400fi
    33873401
     
    1670416718fi
    1670516719
    16706  if test "$HAVE_LIBPROFILER" -eq 1; then
     16720 if test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBPROFILER" -eq 1; then
    1670716721  WITH_LIBPROFILER_TRUE=
    1670816722  WITH_LIBPROFILER_FALSE='#'
     
    1675516769fi
    1675616770
    16757  if test "$HAVE_LIBTCMALLOC" -eq 1; then
     16771 if test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBTCMALLOC" -eq 1; then
    1675816772  WITH_LIBTCMALLOC_TRUE=
    1675916773  WITH_LIBTCMALLOC_FALSE='#'
  • configure.ac

    r89faa82 r800bae1  
    9494                # skip the target hosts
    9595                \'--with-target-hosts=*) ;;
     96
     97                # skip gprofiler for libcfa
     98                \'--enable-gprofiler=*) ;;
     99                \'--disable-gprofiler) ;;
    96100
    97101                # append all other arguments to the sub configure arguments
     
    125129        target_hosts=$withval, target_hosts=${default_target})
    126130
     131AC_ARG_ENABLE(gprofiler,
     132        [  --enable-gprofiler     whether or not to enable gprofiler tools (if available)],
     133        enable_gprofiler=$enableval, enable_gprofiler=yes)
     134
    127135AC_SUBST(TARGET_HOSTS, ${target_hosts})
    128136
     
    192200
    193201AC_CHECK_LIB([profiler], [ProfilingIsEnabledForAllThreads], [HAVE_LIBPROFILER=1], [HAVE_LIBPROFILER=0])
    194 AM_CONDITIONAL([WITH_LIBPROFILER], [test "$HAVE_LIBPROFILER" -eq 1])
     202AM_CONDITIONAL([WITH_LIBPROFILER], [test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBPROFILER" -eq 1])
    195203
    196204AC_CHECK_LIB([tcmalloc], [malloc], [HAVE_LIBTCMALLOC=1], [HAVE_LIBTCMALLOC=0])
    197 AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "$HAVE_LIBTCMALLOC" -eq 1])
     205AM_CONDITIONAL([WITH_LIBTCMALLOC], [test "x$enable_gprofiler" = "xyes" -a "$HAVE_LIBTCMALLOC" -eq 1])
    198206
    199207# Checks for header files.
  • src/AST/Convert.cpp

    r89faa82 r800bae1  
    576576                if ( srcInferred.mode == ast::Expr::InferUnion::Params ) {
    577577                        const ast::InferredParams &srcParams = srcInferred.inferParams();
    578                         for (auto srcParam : srcParams) {
    579                                 tgtInferParams[srcParam.first] = ParamEntry(
     578                        for (auto & srcParam : srcParams) {
     579                                auto res = tgtInferParams.emplace(srcParam.first, ParamEntry(
    580580                                        srcParam.second.decl,
    581581                                        get<Declaration>().accept1(srcParam.second.declptr),
     
    583583                                        get<Type>().accept1(srcParam.second.formalType),
    584584                                        get<Expression>().accept1(srcParam.second.expr)
    585                                 );
     585                                ));
     586                                assert(res.second);
    586587                        }
    587588                } else if ( srcInferred.mode == ast::Expr::InferUnion::Slots  ) {
     
    19821983                if ( !oldInferParams.empty() ) {
    19831984                        ast::InferredParams &tgt = newInferred.inferParams();
    1984                         for (auto old : oldInferParams) {
     1985                        for (auto & old : oldInferParams) {
    19851986                                tgt[old.first] = ast::ParamEntry(
    19861987                                        old.second.decl,
  • src/Common/Stats/Heap.cc

    r89faa82 r800bae1  
    2121#include <iostream>
    2222
    23 #if defined( NO_STATISTICS ) || defined( TCMALLOC )
    24         #define NO_HEAP_STATISTICS
     23#if defined(__has_feature)
     24        #if __has_feature(address_sanitizer)
     25                #define NO_HEAP_STATISTICS
     26        # endif
     27#endif
     28
     29#if defined( NO_STATISTICS ) || defined( TCMALLOC ) || defined(__SANITIZE_ADDRESS__)
     30        #if !defined(NO_HEAP_STATISTICS)
     31                #define NO_HEAP_STATISTICS
     32        #endif
    2533#endif
    2634
  • src/ResolvExpr/ResolveAssertions.cc

    r89faa82 r800bae1  
    325325                                        entry.second.expr = postmutate( entry.second.expr );
    326326                                        // xxx - look at entry.second.inferParams?
    327                                         expr->inferParams[ entry.first ] = entry.second;
     327                                        auto res = expr->inferParams.emplace( entry.first, entry.second );
     328                                        assert(res.second);
    328329                                }
    329330                        }
  • src/SynTree/ApplicationExpr.cc

    r89faa82 r800bae1  
    2828#include "Type.h"                // for Type, PointerType, FunctionType
    2929
     30ParamEntry::ParamEntry( UniqueId decl, Declaration * declptr, Type * actualType, Type * formalType, Expression* expr )
     31                : decl( decl ), declptr( declptr ), actualType( actualType ), formalType( formalType ), expr( expr ) {
     32        }
     33
    3034ParamEntry::ParamEntry( const ParamEntry &other ) :
    31                 decl( other.decl ), declptr( maybeClone( other.declptr ) ), actualType( maybeClone( other.actualType ) ), formalType( maybeClone( other.formalType ) ), expr( maybeClone( other.expr ) )/*, inferParams( new InferredParams( *other.inferParams ) )*/ {
    32 }
    33 
    34 ParamEntry &ParamEntry::operator=( const ParamEntry &other ) {
    35         if ( &other == this ) return *this;
    36         const_cast<UniqueId &>(decl) = other.decl;
    37         const_cast<Declaration * &>(declptr) = maybeClone( other.declptr );
    38         // xxx - this looks like a memory leak
    39         const_cast<Type * &>(actualType) = maybeClone( other.actualType );
    40         const_cast<Type * &>(formalType) = maybeClone( other.formalType );
    41         expr = maybeClone( other.expr );
    42         // *inferParams = *other.inferParams;
    43         return *this;
     35                decl( other.decl ), declptr( maybeClone( other.declptr ) ), actualType( maybeClone( other.actualType ) ), formalType( maybeClone( other.formalType ) ), expr( maybeClone( other.expr ) ) {
    4436}
    4537
     
    5244
    5345ParamEntry::ParamEntry( ParamEntry && other ) :
    54                 decl( other.decl ), declptr( other.declptr ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr )/*, inferParams( std::move( other.inferParams ) )*/ {
    55         const_cast<Declaration * &>(other.declptr) = nullptr;
    56         const_cast<Type * &>(other.actualType) = nullptr;
    57         const_cast<Type * &>(other.formalType) = nullptr;
    58         other.expr = nullptr;
     46                decl( other.decl ), declptr( other.declptr ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr ) {
     47        new (&other) ParamEntry();
    5948}
    6049
    6150ParamEntry & ParamEntry::operator=( ParamEntry && other ) {
    6251        if ( &other == this ) return *this;
    63         delete declptr;
    64         delete actualType;
    65         delete formalType;
    66         delete expr;
    67         const_cast<UniqueId &>(decl) = other.decl;
    68         const_cast<Declaration * &>(declptr) = other.declptr;
    69         const_cast<Type * &>(actualType) = other.actualType;
    70         const_cast<Type * &>(formalType) = other.formalType;
    71         expr = other.expr;
    72         const_cast<Declaration * &>(other.declptr) = nullptr;
    73         const_cast<Type * &>(other.actualType) = nullptr;
    74         const_cast<Type * &>(other.formalType) = nullptr;
    75         other.expr = nullptr;
    76         // inferParams = std::move( other.inferParams );
     52        this->~ParamEntry();
     53        new (this) ParamEntry(other.decl, other.declptr, other.actualType, other.formalType, other.expr);
     54        new (&other) ParamEntry();
     55
    7756        return *this;
    7857}
  • src/SynTree/Expression.h

    r89faa82 r800bae1  
    3939/// but subject to decay-to-pointer and type parameter renaming
    4040struct ParamEntry {
    41         ParamEntry(): decl( 0 ), declptr(nullptr), actualType( 0 ), formalType( 0 ), expr( 0 )/*, inferParams( new InferredParams )*/ {}
    42         ParamEntry( UniqueId decl, Declaration * declptr, Type * actualType, Type * formalType, Expression* expr )
    43                 : decl( decl ), declptr( declptr ), actualType( actualType ), formalType( formalType ), expr( expr )/*, inferParams( new InferredParams )*/ {
    44         }
     41        ParamEntry(): decl( 0 ), declptr( nullptr ), actualType( nullptr ), formalType( nullptr ), expr( nullptr ) {}
     42        ParamEntry( UniqueId decl, Declaration * declptr, Type * actualType, Type * formalType, Expression* expr );
    4543        ParamEntry( const ParamEntry & other );
    4644        ParamEntry( ParamEntry && other );
    4745        ~ParamEntry();
    48         ParamEntry & operator=( const ParamEntry & other );
    4946        ParamEntry & operator=( ParamEntry && other );
    5047
     
    5451        Type * const formalType;
    5552        Expression * expr;
    56         // std::unique_ptr< InferredParams > inferParams;
    5753};
    5854
Note: See TracChangeset for help on using the changeset viewer.