Changeset cda7889
- Timestamp:
- Jul 12, 2017, 4:47:31 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:
- 084fecc
- Parents:
- 0698aa1
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r0698aa1 rcda7889 296 296 Expression *build_unary_ptr( OperKinds op, ExpressionNode *expr_node ) { 297 297 std::list< Expression * > args; 298 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) );298 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx 299 299 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); 300 300 } … … 307 307 Expression *build_binary_ptr( OperKinds op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) { 308 308 std::list< Expression * > args; 309 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node1)) );309 args.push_back( maybeMoveBuild< Expression >(expr_node1) ); 310 310 args.push_back( maybeMoveBuild< Expression >(expr_node2) ); 311 311 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); -
src/Parser/TypeData.cc
r0698aa1 rcda7889 401 401 // add dtor: void ^?{}(T *) 402 402 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 403 dtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );403 dtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 404 404 td->get_assertions().push_front( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, dtorType, nullptr ) ); 405 405 406 406 // add copy ctor: void ?{}(T *, T) 407 407 FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false ); 408 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );408 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 409 409 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 410 410 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, copyCtorType, nullptr ) ); … … 412 412 // add default ctor: void ?{}(T *) 413 413 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 414 ctorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );414 ctorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 415 415 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, ctorType, nullptr ) ); 416 416 417 417 // add assignment operator: T * ?=?(T *, T) 418 418 FunctionType * assignType = new FunctionType( Type::Qualifiers(), false ); 419 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );419 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 420 420 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 421 421 assignType->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); -
src/Parser/parser.yy
r0698aa1 rcda7889 665 665 conditional_expression 666 666 | unary_expression assignment_operator assignment_expression 667 { $$ = new ExpressionNode( build_binary_ ptr( $2, $1, $3 ) ); }667 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 668 668 ; 669 669
Note: See TracChangeset
for help on using the changeset viewer.