Changeset 66f8528 for src/Parser/TypeData.cc
- Timestamp:
- Dec 15, 2016, 5:16:42 PM (9 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:
- 43385ca, f7ff3fb
- Parents:
- 5802a4f (diff), 596f987b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
r5802a4f r66f8528 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Sep 24 11:14:26201613 // Update Count : 4 1512 // Last Modified On : Tue Dec 13 13:40:33 2016 13 // Update Count : 420 14 14 // 15 15 … … 215 215 break; 216 216 case Builtin: 217 assert( false );218 // newtype->builtin = builtin;217 assert( builtintype == DeclarationNode::Zero || builtintype == DeclarationNode::One ); 218 newtype->builtintype = builtintype; 219 219 break; 220 220 } // switch … … 444 444 return buildTypeof( td ); 445 445 case TypeData::Builtin: 446 return new VarArgsType( buildQualifiers( td ) ); 446 if(td->builtintype == DeclarationNode::Zero) { 447 return new ZeroType( emptyQualifiers ); 448 } 449 else if(td->builtintype == DeclarationNode::One) { 450 return new OneType( emptyQualifiers ); 451 } 452 else { 453 return new VarArgsType( buildQualifiers( td ) ); 454 } 447 455 case TypeData::Symbolic: 448 456 case TypeData::Enum: … … 574 582 const_cast<TypeData *>(td)->basictype = DeclarationNode::Int; 575 583 goto Integral; 584 default: 585 assert(false); 586 return nullptr; 576 587 } // switch 577 588 … … 710 721 } // buildTypeof 711 722 712 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, Initializer * init ) {723 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init ) { 713 724 if ( td->kind == TypeData::Function ) { 714 725 FunctionDecl * decl; … … 732 743 } // for 733 744 buildList( td->function.oldDeclList, decl->get_oldDecls() ); 734 return decl ;745 return decl->set_asmName( asmName ); 735 746 } else if ( td->kind == TypeData::Aggregate ) { 736 747 return buildAggregate( td ); … … 740 751 return buildSymbolic( td, name, sc ); 741 752 } else { 742 return new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn);753 return (new ObjectDecl( name, sc, linkage, bitfieldWidth, typebuild( td ), init, list< Attribute * >(), isInline, isNoreturn ))->set_asmName( asmName ); 743 754 } // if 744 755 return nullptr; … … 758 769 break; 759 770 default: 760 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall ) ) );771 ft->get_returnVals().push_back( dynamic_cast< DeclarationWithType* >( buildDecl( td->base, "", DeclarationNode::NoStorageClass, nullptr, false, false, LinkageSpec::Cforall, nullptr ) ) ); 761 772 } // switch 762 773 } else {
Note:
See TracChangeset
for help on using the changeset viewer.