Changeset 1fbab5a for src/SymTab
- Timestamp:
- Mar 16, 2017, 4:50:08 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:
- 395fc37, 64ac636, ef42b143
- Parents:
- 2f26687a (diff), d6d747d (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. - Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r2f26687a r1fbab5a 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Mar 14 07:45:00201713 // Update Count : 5 412 // Last Modified On : Thu Mar 16 08:37:22 2017 13 // Update Count : 59 14 14 // 15 15 … … 125 125 FunctionType * genDefaultType( Type * paramType ) { 126 126 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 127 ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr );127 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr ); 128 128 ftype->get_parameters().push_back( dstParam ); 129 129 … … 134 134 FunctionType * genCopyType( Type * paramType ) { 135 135 FunctionType *ftype = genDefaultType( paramType ); 136 ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );136 ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 137 137 ftype->get_parameters().push_back( srcParam ); 138 138 return ftype; … … 142 142 FunctionType * genAssignType( Type * paramType ) { 143 143 FunctionType *ftype = genCopyType( paramType ); 144 ObjectDecl *returnVal = new ObjectDecl( "_ret", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );144 ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr ); 145 145 ftype->get_returnVals().push_back( returnVal ); 146 146 return ftype; … … 162 162 // because each unit generates copies of the default routines for each aggregate. 163 163 // DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static; 164 DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static );164 Type::StorageClasses scs = functionNesting > 0 ? Type::StorageClasses() : Type::StorageClasses( Type::Static ); 165 165 LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen; 166 166 FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt( noLabels ), 167 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) );167 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ); 168 168 decl->fixUniqueId(); 169 169 return decl; … … 460 460 continue; 461 461 } 462 memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) );462 memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), Type::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) ); 463 463 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 464 464 makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor, isDynamicLayout ); … … 540 540 for ( Declaration * member : aggregateDecl->get_members() ) { 541 541 if ( DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member ) ) { 542 ObjectDecl * srcParam = new ObjectDecl( "src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 );542 ObjectDecl * srcParam = new ObjectDecl( "src", Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ); 543 543 544 544 FunctionType * memCtorType = ctorType->clone(); … … 605 605 TypeInstType *typeInst = new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), false ); 606 606 typeInst->set_baseType( typeDecl ); 607 ObjectDecl *src = new ObjectDecl( "_src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, typeInst->clone(), nullptr );608 ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), typeInst->clone() ), nullptr );607 ObjectDecl *src = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, typeInst->clone(), nullptr ); 608 ObjectDecl *dst = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), typeInst->clone() ), nullptr ); 609 609 610 610 std::list< Statement * > stmts; … … 618 618 } // if 619 619 FunctionType *type = new FunctionType( Type::Qualifiers(), false ); 620 type->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, typeInst, 0 ) );620 type->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, typeInst, 0 ) ); 621 621 type->get_parameters().push_back( dst ); 622 622 type->get_parameters().push_back( src ); … … 717 717 if ( TypeInstType * ty = dynamic_cast< TypeInstType * >( t ) ) { 718 718 if ( ! done.count( ty->get_baseType() ) ) { 719 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), DeclarationNode::StorageClasses(), nullptr, TypeDecl::Any );719 TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), Type::StorageClasses(), nullptr, TypeDecl::Any ); 720 720 TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl ); 721 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr,722 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );723 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,724 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );725 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genCopyType( inst ), nullptr,726 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );727 newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,728 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) ) );721 newDecl->get_assertions().push_back( new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr, 722 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ) ); 723 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 724 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ) ); 725 newDecl->get_assertions().push_back( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, genCopyType( inst ), nullptr, 726 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ) ); 727 newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr, 728 std::list< Attribute * >(), Type::FuncSpecifiers( Type::Inline ) ) ); 729 729 typeParams.push_back( newDecl ); 730 730 done.insert( ty->get_baseType() ); -
src/SymTab/Autogen.h
r2f26687a r1fbab5a 10 10 // Created On : Sun May 17 21:53:34 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 6 23:33:01201713 // Update Count : 412 // Last Modified On : Thu Mar 16 07:51:39 2017 13 // Update Count : 8 14 14 // 15 15 … … 58 58 assert( type ); 59 59 Type * castType = type->clone(); 60 castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false); 60 // castType->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false); 61 castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 61 62 castType->set_isLvalue( true ); // xxx - might not need this 62 63 dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) ); … … 102 103 } 103 104 104 ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), new SingleInit( begin, std::list<Expression*>() ) );105 ObjectDecl *index = new ObjectDecl( indexName.newName(), Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), new SingleInit( begin, std::list<Expression*>() ) ); 105 106 106 107 UntypedExpr *cond = new UntypedExpr( cmp ); -
src/SymTab/Validate.cc
r2f26687a r1fbab5a 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Mar 7 07:51:36201713 // Update Count : 3 4912 // Last Modified On : Thu Mar 16 08:02:54 2017 13 // Update Count : 351 14 14 // 15 15 … … 208 208 209 209 class CompoundLiteral final : public GenPoly::DeclMutator { 210 DeclarationNode::StorageClasses storageClasses;210 Type::StorageClasses storageClasses; 211 211 212 212 using GenPoly::DeclMutator::mutate; … … 323 323 ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i ); 324 324 assert( obj ); 325 obj->set_type( new EnumInstType( Type::Qualifiers( true, false, false, false, false, false), enumDecl->get_name() ) );325 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl->get_name() ) ); 326 326 } // for 327 327 Parent::visit( enumDecl ); … … 754 754 type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ); 755 755 } // if 756 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), DeclarationNode::StorageClasses(), type ) );756 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type ) ); 757 757 typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel ); 758 758 } // if … … 857 857 TupleType * tupleType = safe_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) ); 858 858 // ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false. 859 ObjectDecl * newRet = new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );859 ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) ); 860 860 deleteAll( retVals ); 861 861 retVals.clear();
Note:
See TracChangeset
for help on using the changeset viewer.