Changeset f0ecf9b for src/Parser
- Timestamp:
- Nov 1, 2017, 5:40:05 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:
- fde89cf6
- Parents:
- b0837e4
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rb0837e4 rf0ecf9b 1031 1031 1032 1032 if ( variable.tyClass != NoTypeClass ) { 1033 static const TypeDecl::Kind kindMap[] = { TypeDecl::Any, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype }; 1034 assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." ); 1033 // otype is internally converted to dtype + otype parameters 1034 static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype }; 1035 assertf( sizeof(kindMap)/sizeof(kindMap[0]) == NoTypeClass, "DeclarationNode::build: kindMap is out of sync." ); 1035 1036 assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." ); 1036 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable. initializer ? variable.initializer->buildType() : nullptr );1037 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == Otype, variable.initializer ? variable.initializer->buildType() : nullptr ); 1037 1038 buildList( variable.assertions, ret->get_assertions() ); 1038 1039 return ret; -
src/Parser/TypeData.cc
rb0837e4 rf0ecf9b 406 406 void buildForall( const DeclarationNode * firstNode, ForallList &outputList ) { 407 407 buildList( firstNode, outputList ); 408 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i ) { 408 auto n = firstNode; 409 for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) { 409 410 TypeDecl * td = static_cast<TypeDecl *>(*i); 410 if ( td->get_kind() == TypeDecl::Any) {411 if ( n->variable.tyClass == DeclarationNode::Otype ) { 411 412 // add assertion parameters to `type' tyvars in reverse order 412 413 // add dtor: void ^?{}(T *) … … 798 799 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage ); 799 800 } else { 800 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl:: Any);801 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true ); 801 802 } // if 802 803 buildList( td->symbolic.params, ret->get_parameters() );
Note: See TracChangeset
for help on using the changeset viewer.