Changeset 6cef439 for src/Parser/TypeData.cc
- Timestamp:
- Mar 6, 2024, 12:34:15 PM (4 months ago)
- Branches:
- master
- Children:
- b93c544, e72fc60
- Parents:
- 1df26c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
r1df26c3 r6cef439 478 478 } 479 479 480 481 480 TypeData * TypeData::getLastBase() { 482 481 TypeData * cur = this; … … 487 486 void TypeData::setLastBase( TypeData * newBase ) { 488 487 getLastBase()->base = newBase; 488 } 489 490 491 TypeData * build_type_qualifier( ast::CV::Qualifiers tq ) { 492 TypeData * type = new TypeData; 493 type->qualifiers = tq; 494 return type; 495 } 496 497 TypeData * build_basic_type( DeclarationNode::BasicType basic ) { 498 TypeData * type = new TypeData( TypeData::Basic ); 499 type->basictype = basic; 500 return type; 501 } 502 503 TypeData * build_complex_type( DeclarationNode::ComplexType complex ) { 504 TypeData * type = new TypeData( TypeData::Basic ); 505 type->complextype = complex; 506 return type; 507 } 508 509 TypeData * build_signedness( DeclarationNode::Signedness signedness ) { 510 TypeData * type = new TypeData( TypeData::Basic ); 511 type->signedness = signedness; 512 return type; 513 } 514 515 TypeData * build_builtin_type( DeclarationNode::BuiltinType bit ) { 516 TypeData * type = new TypeData( TypeData::Builtin ); 517 type->builtintype = bit; 518 return type; 519 } 520 521 TypeData * build_length( DeclarationNode::Length length ) { 522 TypeData * type = new TypeData( TypeData::Basic ); 523 type->length = length; 524 return type; 525 } 526 527 TypeData * build_forall( DeclarationNode * forall ) { 528 TypeData * type = new TypeData( TypeData::Unknown ); 529 type->forall = forall; 530 return type; 531 } 532 533 TypeData * build_global_scope() { 534 return new TypeData( TypeData::GlobalScope ); 535 } 536 537 TypeData * build_qualified_type( TypeData * parent, TypeData * child ) { 538 TypeData * type = new TypeData( TypeData::Qualified ); 539 type->qualified.parent = parent; 540 type->qualified.child = child; 541 return type; 542 } 543 544 TypeData * build_typedef( const std::string * name ) { 545 TypeData * type = new TypeData( TypeData::SymbolicInst ); 546 type->symbolic.name = name; 547 type->symbolic.isTypedef = true; 548 type->symbolic.actuals = nullptr; 549 return type; 550 } 551 552 TypeData * build_type_gen( const std::string * name, ExpressionNode * params ) { 553 TypeData * type = new TypeData( TypeData::SymbolicInst ); 554 type->symbolic.name = name; 555 type->symbolic.isTypedef = false; 556 type->symbolic.actuals = params; 557 return type; 558 } 559 560 TypeData * build_vtable_type( TypeData * base ) { 561 TypeData * type = new TypeData( TypeData::Vtable ); 562 type->base = base; 563 return type; 489 564 } 490 565 … … 627 702 return rtype; 628 703 } // if 704 } 705 706 TypeData * addType( TypeData * ltype, TypeData * rtype ) { 707 std::vector<ast::ptr<ast::Attribute>> attributes; 708 return addType( ltype, rtype, attributes ); 629 709 } 630 710
Note: See TracChangeset
for help on using the changeset viewer.