Changeset 9a063c8


Ignore:
Timestamp:
Dec 9, 2016, 1:02:45 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
599b386, 5c6afcd
Parents:
6a16806
Message:

don't try to destruct return values from builtin functions

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r6a16806 r9a063c8  
    330330
    331331                        if ( VariableExpr * function = dynamic_cast< VariableExpr * > ( appExpr->get_function() ) ) {
    332                                 if ( function->get_var()->get_linkage() == LinkageSpec::Intrinsic ) {
     332                                if ( LinkageSpec::isBuiltin( function->get_var()->get_linkage() ) ) {
    333333                                        // optimization: don't need to copy construct in order to call intrinsic functions
    334334                                        return appExpr;
  • src/tests/.expect/32/extension.txt

    r6a16806 r9a063c8  
    5959};
    6060static inline union U ___operator_assign__F2uU_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
    61     void *_tmp_cp_ret0;
    62     ((void)((_tmp_cp_ret0=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))) , _tmp_cp_ret0));
    63     ((void)(_tmp_cp_ret0) /* ^?{} */);
     61    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    6462    return ((union U )___src__2uU_1);
    6563}
     
    6765}
    6866static inline void ___constructor__F_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
    69     void *_tmp_cp_ret1;
    70     ((void)((_tmp_cp_ret1=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))) , _tmp_cp_ret1));
    71     ((void)(_tmp_cp_ret1) /* ^?{} */);
     67    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    7268    return ((void)___src__2uU_1);
    7369}
     
    7571}
    7672static inline void ___constructor__F_P2uUi_autogen___1(union U *___dst__P2uU_1, int __src__i_1){
    77     void *_tmp_cp_ret2;
    78     ((void)((_tmp_cp_ret2=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int ))) , _tmp_cp_ret2));
    79     ((void)(_tmp_cp_ret2) /* ^?{} */);
     73    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));
    8074}
    8175__extension__ enum E {
     
    9791    __extension__ int __c__i_2;
    9892    ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
    99     int _tmp_cp_ret3;
    100     ((void)((_tmp_cp_ret3=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret3));
    101     ((void)(_tmp_cp_ret3) /* ^?{} */);
     93    int _tmp_cp_ret0;
     94    ((void)((_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret0));
     95    ((void)(_tmp_cp_ret0) /* ^?{} */);
    10296    ((void)__extension__ sizeof(3));
    10397    ((void)__extension__ (((int )(3!=((int )0))) || ((int )(4!=((int )0)))));
  • src/tests/.expect/64/extension.txt

    r6a16806 r9a063c8  
    5959};
    6060static inline union U ___operator_assign__F2uU_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
    61     void *_tmp_cp_ret0;
    62     ((void)((_tmp_cp_ret0=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))) , _tmp_cp_ret0));
    63     ((void)(_tmp_cp_ret0) /* ^?{} */);
     61    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    6462    return ((union U )___src__2uU_1);
    6563}
     
    6765}
    6866static inline void ___constructor__F_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
    69     void *_tmp_cp_ret1;
    70     ((void)((_tmp_cp_ret1=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))) , _tmp_cp_ret1));
    71     ((void)(_tmp_cp_ret1) /* ^?{} */);
     67    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    7268    return ((void)___src__2uU_1);
    7369}
     
    7571}
    7672static inline void ___constructor__F_P2uUi_autogen___1(union U *___dst__P2uU_1, int __src__i_1){
    77     void *_tmp_cp_ret2;
    78     ((void)((_tmp_cp_ret2=__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int ))) , _tmp_cp_ret2));
    79     ((void)(_tmp_cp_ret2) /* ^?{} */);
     73    ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));
    8074}
    8175__extension__ enum E {
     
    9791    __extension__ int __c__i_2;
    9892    ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
    99     int _tmp_cp_ret3;
    100     ((void)((_tmp_cp_ret3=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret3));
    101     ((void)(_tmp_cp_ret3) /* ^?{} */);
     93    int _tmp_cp_ret0;
     94    ((void)((_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret0));
     95    ((void)(_tmp_cp_ret0) /* ^?{} */);
    10296    ((void)__extension__ sizeof(3));
    10397    ((void)__extension__ (((int )(3!=((int )0))) || ((int )(4!=((int )0)))));
Note: See TracChangeset for help on using the changeset viewer.