Changeset f441c88 for src/Parser
- Timestamp:
- Nov 2, 2018, 4:14:33 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 5753b33, 8e04794
- Parents:
- c45b304
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
rc45b304 rf441c88 522 522 switch ( td->kind ) { 523 523 case TypeData::Unknown: 524 // fill in implicit int525 return new BasicType( buildQualifiers( td ), BasicType::SignedInt );524 // fill in implicit int 525 return new BasicType( buildQualifiers( td ), BasicType::SignedInt ); 526 526 case TypeData::Basic: 527 return buildBasicType( td );527 return buildBasicType( td ); 528 528 case TypeData::Pointer: 529 return buildPointer( td );529 return buildPointer( td ); 530 530 case TypeData::Array: 531 return buildArray( td );531 return buildArray( td ); 532 532 case TypeData::Reference: 533 return buildReference( td );533 return buildReference( td ); 534 534 case TypeData::Function: 535 return buildFunction( td );535 return buildFunction( td ); 536 536 case TypeData::AggregateInst: 537 return buildAggInst( td );537 return buildAggInst( td ); 538 538 case TypeData::EnumConstant: 539 // the name gets filled in later -- by SymTab::Validate540 return new EnumInstType( buildQualifiers( td ), "" );539 // the name gets filled in later -- by SymTab::Validate 540 return new EnumInstType( buildQualifiers( td ), "" ); 541 541 case TypeData::SymbolicInst: 542 return buildSymbolicInst( td );542 return buildSymbolicInst( td ); 543 543 case TypeData::Tuple: 544 return buildTuple( td );544 return buildTuple( td ); 545 545 case TypeData::Typeof: 546 546 case TypeData::Basetypeof: 547 return buildTypeof( td );547 return buildTypeof( td ); 548 548 case TypeData::Builtin: 549 if(td->builtintype == DeclarationNode::Zero) {550 return new ZeroType( noQualifiers );551 }552 else if(td->builtintype == DeclarationNode::One) {553 return new OneType( noQualifiers );554 }555 else {556 return new VarArgsType( buildQualifiers( td ) );557 }549 if (td->builtintype == DeclarationNode::Zero) { 550 return new ZeroType( noQualifiers ); 551 } 552 else if (td->builtintype == DeclarationNode::One) { 553 return new OneType( noQualifiers ); 554 } 555 else { 556 return new VarArgsType( buildQualifiers( td ) ); 557 } 558 558 case TypeData::GlobalScope: 559 return new GlobalScopeType();559 return new GlobalScopeType(); 560 560 case TypeData::Qualified: 561 return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) );561 return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) ); 562 562 case TypeData::Symbolic: 563 563 case TypeData::Enum: 564 564 case TypeData::Aggregate: 565 assert( false );565 assert( false ); 566 566 } // switch 567 567 … … 942 942 assert( td->typeexpr ); 943 943 // assert( td->typeexpr->expr ); 944 return new TypeofType( td->kind == TypeData::Basetypeof ? Type::Qualifiers{} : buildQualifiers( td ), td->typeexpr->build() ); 944 return new TypeofType{ 945 buildQualifiers( td ), td->typeexpr->build(), td->kind == TypeData::Basetypeof }; 945 946 } // buildTypeof 946 947
Note: See TracChangeset
for help on using the changeset viewer.