- Timestamp:
- Aug 8, 2017, 8:09:05 PM (7 years ago)
- 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:
- 1744e6d
- Parents:
- 533804b
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r533804b r46adb83 17 17 #include <iterator> 18 18 #include "SynTree/Visitor.h" 19 #include "SynTree/Attribute.h" 19 20 #include "SynTree/Type.h" 20 21 #include "SynTree/Statement.h" … … 275 276 // void ?{}(E *, E); 276 277 FunctionType *copyCtorType = genCopyType( refType->clone() ); 278 279 // add unused attribute to parameters of default constructor and destructor 280 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 281 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 277 282 278 283 // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)? … … 516 521 cloneAll( typeParams, assignType->get_forall() ); 517 522 523 // add unused attribute to parameters of default constructor and destructor 524 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 525 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) ); 526 518 527 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units 519 528 // because each unit generates copies of the default routines for each aggregate. -
src/tests/.expect/64/attributes.txt
r533804b r46adb83 310 310 __R__C13e__anonymous5_2, 311 311 }; 312 inline void ___constructor__F_R13e__anonymous5_intrinsic___2( enum __anonymous5 *___dst__R13e__anonymous5_2){312 inline void ___constructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ 313 313 } 314 314 inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 315 315 ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)); 316 316 } 317 inline void ___destructor__F_R13e__anonymous5_intrinsic___2( enum __anonymous5 *___dst__R13e__anonymous5_2){317 inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){ 318 318 } 319 319 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ -
src/tests/.expect/64/extension.txt
r533804b r46adb83 60 60 __extension__ int __c__i_1; 61 61 }; 62 static inline void ___constructor__F_R2uU_autogen___1( union U *___dst__R2uU_1){62 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 63 63 } 64 64 static inline void ___constructor__F_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){ 65 65 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 66 66 } 67 static inline void ___destructor__F_R2uU_autogen___1( union U *___dst__R2uU_1){67 static inline void ___destructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){ 68 68 } 69 69 static inline union U ___operator_assign__F2uU_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){ … … 73 73 return ((union U )___ret__2uU_1); 74 74 } 75 static inline void ___constructor__F_R2uUi_autogen___1( union U *___dst__R2uU_1, int __src__i_1){75 static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, int __src__i_1){ 76 76 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(int ))); 77 77 }
Note: See TracChangeset
for help on using the changeset viewer.