Changeset bff227f for src/SymTab
- Timestamp:
- Jul 21, 2017, 3:57:11 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:
- 9191a8e
- Parents:
- 53a8e68
- Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r53a8e68 rbff227f 21 21 #include "SynTree/TypeSubstitution.h" 22 22 #include "Common/utility.h" 23 #include "CodeGen/OperatorTable.h" 23 24 #include "AddVisit.h" 24 25 #include "MakeLibCfa.h" … … 223 224 FunctionType * ftype = data.genType( refType ); 224 225 225 if(concurrent_type && InitTweak::isDestructor( data.fname )) {226 if(concurrent_type && CodeGen::isDestructor( data.fname )) { 226 227 ftype->get_parameters().front()->get_type()->set_mutex( true ); 227 228 } … … 407 408 408 409 // field ctors are only generated if default constructor and copy constructor are both generated 409 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return InitTweak::isConstructor( dcl->get_name() ); } );410 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } ); 410 411 411 412 if ( functionNesting == 0 ) { … … 422 423 // generate appropriate calls to member ctor, assignment 423 424 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor 424 if ( ! InitTweak::isDestructor( dcl->get_name() ) ) {425 if ( ! CodeGen::isDestructor( dcl->get_name() ) ) { 425 426 makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl, isDynamicLayout ); 426 427 } else { 427 428 makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, isDynamicLayout, false ); 428 429 } 429 if ( InitTweak::isAssignment( dcl->get_name() ) ) {430 if ( CodeGen::isAssignment( dcl->get_name() ) ) { 430 431 // assignment needs to return a value 431 432 FunctionType * assignType = dcl->get_functionType(); … … 486 487 487 488 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); 488 if ( InitTweak::isAssignment( funcDecl->get_name() ) ) {489 if ( CodeGen::isAssignment( funcDecl->get_name() ) ) { 489 490 // also generate return statement in assignment 490 491 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); -
src/SymTab/Indexer.cc
r53a8e68 rbff227f 26 26 27 27 #include "Common/utility.h" 28 29 #include "CodeGen/OperatorTable.h" 28 30 29 31 #include "ResolvExpr/typeops.h" … … 112 114 void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const { 113 115 // only need to perform this step for constructors, destructors, and assignment functions 114 if ( ! InitTweak::isCtorDtorAssign( id ) ) return;116 if ( ! CodeGen::isCtorDtorAssign( id ) ) return; 115 117 116 118 // helpful data structure … … 140 142 decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } ); 141 143 existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc; 142 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && InitTweak::isConstructor( function->get_name() ) );144 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) ); 143 145 existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor); 144 146 existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc); -
src/SymTab/Validate.cc
r53a8e68 rbff227f 43 43 44 44 #include "CodeGen/CodeGenerator.h" 45 #include "CodeGen/OperatorTable.h" 45 46 46 47 #include "Common/PassVisitor.h" … … 52 53 53 54 #include "GenPoly/DeclMutator.h" 54 55 #include "InitTweak/InitTweak.h"56 55 57 56 #include "AddVisit.h" … … 827 826 std::list< DeclarationWithType * > ¶ms = funcType->get_parameters(); 828 827 829 if ( InitTweak::isCtorDtorAssign( funcDecl->get_name() ) ) {828 if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc. 830 829 if ( params.size() == 0 ) { 831 830 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl ); … … 835 834 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl ); 836 835 } 837 if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {836 if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { 838 837 throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl ); 839 838 }
Note: See TracChangeset
for help on using the changeset viewer.