Changeset a9a259c for src/Parser/TypeData.cc
- Timestamp:
- Feb 25, 2016, 4:34:09 PM (8 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:
- c14cff1
- Parents:
- ae42f2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
rae42f2a ra9a259c 437 437 if ( (*i)->get_kind() == TypeDecl::Any ) { 438 438 // add assertion parameters to `type' tyvars 439 // add : T * ?=?(T *, T)439 // add assignment operator: T * ?=?(T *, T) 440 440 FunctionType *assignType = new FunctionType( Type::Qualifiers(), false ); 441 441 assignType->get_parameters().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), (*i)->get_name(), *i ) ), 0 ) ); … … 444 444 (*i)->get_assertions().push_front( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, assignType, 0, false, false ) ); 445 445 446 // add : void ?{}(T *)446 // add default ctor: void ?{}(T *) 447 447 FunctionType *ctorType = new FunctionType( Type::Qualifiers(), false ); 448 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 449 (*i)->get_assertions().push_front( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, ctorType, 0, false, false ) ); 450 450 451 // add: void ^?{}(T *) 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 *) 452 458 FunctionType *dtorType = new FunctionType( Type::Qualifiers(), false ); 453 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 ) );
Note: See TracChangeset
for help on using the changeset viewer.