Changeset 6943f051
- Timestamp:
- Mar 18, 2016, 6:09:23 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4cc4286
- Parents:
- f5ef08c
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/OperatorTable.cc
rf5ef08c r6943f051 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // OperatorTable.cc -- 7 // OperatorTable.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 22 22 { "?[?]", "", "_operator_index", OT_INDEX }, 23 23 { "?{}", "", "_constructor", OT_CTOR }, 24 { "^?{}", "", "_destructor", OT_DTOR }, // ~?{}, -?{}, !?{}, $?{}, ??{}, ^?{}, ?destroy, ?delete24 { "^?{}", "", "_destructor", OT_DTOR }, 25 25 { "?()", "", "_operator_call", OT_CALL }, 26 26 { "?++", "++", "_operator_postincr", OT_POSTFIXASSIGN }, -
src/GenPoly/CopyParams.cc
rf5ef08c r6943f051 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CopyParams.cc -- 7 // CopyParams.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr11 // Last Modified By : Rob Schluntz 12 12 // Last Modified On : Tue May 19 07:33:31 2015 13 13 // Update Count : 1 … … 29 29 public: 30 30 CopyParams(); 31 31 32 32 virtual void visit( FunctionDecl *funcDecl ); 33 33 virtual void visit( AddressExpr *addrExpr ); … … 50 50 if ( funcDecl->get_statements() ) { 51 51 funcDecl->get_statements()->accept( *this ); 52 52 53 53 if ( ! modVars.empty() ) { 54 54 std::map< std::string, DeclarationWithType* > assignOps; … … 57 57 if ( (*tyVar)->get_kind() == TypeDecl::Any ) { 58 58 assert( !(*tyVar)->get_assertions().empty() ); 59 assert( (*tyVar)->get_assertions().front()->get_name() == "?=?" ); 59 60 assignOps[ (*tyVar)->get_name() ] = (*tyVar)->get_assertions().front(); 60 61 } // if -
src/Parser/TypeData.cc
rf5ef08c r6943f051 436 436 for ( std::list< TypeDecl* >::iterator i = outputList.begin(); i != outputList.end(); ++i ) { 437 437 if ( (*i)->get_kind() == TypeDecl::Any ) { 438 // add assertion parameters to `type' tyvars 438 // add assertion parameters to `type' tyvars in reverse order 439 // add dtor: void ^?{}(T *) 440 FunctionType *dtorType = new FunctionType( Type::Qualifiers(), false ); 441 dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 442 (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, 0, false, false ) ); 443 // add copy ctor: void ?{}(T *, T) 444 FunctionType *copyCtorType = new FunctionType( Type::Qualifiers(), false ); 445 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 446 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) ); 447 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, 0, false, false ) ); 448 449 // add default ctor: void ?{}(T *) 450 FunctionType *ctorType = new FunctionType( Type::Qualifiers(), false ); 451 ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); 452 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) ); 453 439 454 // add assignment operator: T * ?=?(T *, T) 440 455 FunctionType *assignType = new FunctionType( Type::Qualifiers(), false ); … … 443 458 assignType->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) ); 444 459 (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, 0, false, false ) ); 445 446 // add default ctor: void ?{}(T *)447 FunctionType *ctorType = new FunctionType( Type::Qualifiers(), false );448 ctorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );449 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) );450 451 // add copy ctor: void ?{}(T *, T)452 FunctionType *copyCtorType = new FunctionType( Type::Qualifiers(), false );453 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );454 copyCtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ), 0 ) );455 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, copyCtorType, 0, false, false ) );456 457 // add dtor: void ^?{}(T *)458 FunctionType *dtorType = new FunctionType( Type::Qualifiers(), false );459 dtorType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) );460 (*i)->get_assertions().push_front( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, dtorType, 0, false, false ) );461 460 } // if 462 461 } // for
Note: See TracChangeset
for help on using the changeset viewer.