Changeset bff227f for src/InitTweak
- Timestamp:
- Jul 21, 2017, 3:57:11 PM (8 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:
- 9191a8e
- Parents:
- 53a8e68
- Location:
- src/InitTweak
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/InitTweak/FixInit.cc ¶
r53a8e68 rbff227f 26 26 #include "FixGlobalInit.h" 27 27 #include "CodeGen/GenType.h" // for warning/error messages 28 #include "CodeGen/OperatorTable.h" 28 29 #include "Common/PassVisitor.h" 29 30 #include "GenPoly/DeclMutator.h" … … 363 364 FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) ); 364 365 assert( ftype ); 365 if ( isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) {366 if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) { 366 367 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 367 368 Type * t2 = ftype->get_parameters().back()->get_type(); … … 372 373 return appExpr; 373 374 } // if 374 } else if ( isDestructor( funcDecl->get_name() ) ) {375 } else if ( CodeGen::isDestructor( funcDecl->get_name() ) ) { 375 376 // correctness: never copy construct arguments to a destructor 376 377 return appExpr; … … 975 976 if ( ! funcDecl ) return false; 976 977 if ( ! funcDecl->get_statements() ) return false; 977 return isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() );978 return CodeGen::isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() ); 978 979 } 979 980 … … 992 993 993 994 function = funcDecl; 994 isCtor = isConstructor( function->get_name() );995 isCtor = CodeGen::isConstructor( function->get_name() ); 995 996 if ( checkWarnings( function ) ) { 996 997 FunctionType * type = function->get_functionType(); -
TabularUnified src/InitTweak/GenInit.cc ¶
r53a8e68 rbff227f 21 21 22 22 #include "Common/PassVisitor.h" 23 #include "CodeGen/OperatorTable.h" 23 24 24 25 #include "GenPoly/DeclMutator.h" … … 235 236 void CtorDtor::handleDWT( DeclarationWithType * dwt ) { 236 237 // if this function is a user-defined constructor or destructor, mark down the type as "managed" 237 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && isCtorDtor( dwt->get_name() ) ) {238 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) { 238 239 std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters(); 239 240 assert( ! params.empty() ); -
TabularUnified src/InitTweak/InitTweak.h ¶
r53a8e68 rbff227f 26 26 // helper functions for initialization 27 27 namespace InitTweak { 28 bool isConstructor( const std::string & );29 bool isDestructor( const std::string & );30 bool isAssignment( const std::string & );31 bool isCtorDtor( const std::string & );32 bool isCtorDtorAssign( const std::string & );33 34 28 FunctionDecl * isAssignment( Declaration * decl ); 35 29 FunctionDecl * isDestructor( Declaration * decl );
Note: See TracChangeset
for help on using the changeset viewer.