Changeset a7c90d4 for src/GenPoly
- Timestamp:
- Mar 7, 2017, 8:33:43 AM (8 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:
- 64cb860, c3396e0
- Parents:
- 7fe2498
- Location:
- src/GenPoly
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/GenPoly/Box.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:57:15201713 // Update Count : 3 1012 // Last Modified On : Mon Mar 6 23:45:59 2017 13 // Update Count : 330 14 14 // 15 15 … … 289 289 TypeInstType paramType( Type::Qualifiers(), (*param)->get_name(), *param ); 290 290 std::string paramName = mangleType( ¶mType ); 291 layoutFnType->get_parameters().push_back( new ObjectDecl( sizeofName( paramName ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );292 layoutFnType->get_parameters().push_back( new ObjectDecl( alignofName( paramName ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );291 layoutFnType->get_parameters().push_back( new ObjectDecl( sizeofName( paramName ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) ); 292 layoutFnType->get_parameters().push_back( new ObjectDecl( alignofName( paramName ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) ); 293 293 } 294 294 } … … 298 298 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units 299 299 // because each unit generates copies of the default routines for each aggregate. 300 FunctionDecl *layoutDecl = new FunctionDecl( 301 layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), 302 std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ); 300 FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ), 301 functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), 302 LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), 303 std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ); 303 304 layoutDecl->fixUniqueId(); 304 305 return layoutDecl; … … 367 368 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 368 369 369 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );370 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 ); 370 371 layoutFnType->get_parameters().push_back( sizeParam ); 371 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );372 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 372 373 layoutFnType->get_parameters().push_back( alignParam ); 373 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );374 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 374 375 layoutFnType->get_parameters().push_back( offsetParam ); 375 376 addOtypeParams( layoutFnType, otypeParams ); … … 428 429 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 429 430 430 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );431 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 ); 431 432 layoutFnType->get_parameters().push_back( sizeParam ); 432 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );433 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 433 434 layoutFnType->get_parameters().push_back( alignParam ); 434 435 addOtypeParams( layoutFnType, otypeParams ); … … 536 537 if ( adapters.find( mangleName ) == adapters.end() ) { 537 538 std::string adapterName = makeAdapterName( mangleName ); 538 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode:: NoStorageClass, LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) );539 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) ); 539 540 } // if 540 541 } // for … … 655 656 656 657 ObjectDecl *Pass1::makeTemporary( Type *type ) { 657 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, type, 0 );658 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, 0 ); 658 659 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 659 660 return newObj; … … 764 765 Type * newType = param->clone(); 765 766 if ( env ) env->apply( newType ); 766 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, newType, 0 );767 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, newType, 0 ); 767 768 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right??? 768 769 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); … … 830 831 makeRetParm( adapter ); 831 832 } // if 832 adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );833 adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) ); 833 834 return adapter; 834 835 } … … 911 912 adapterBody->get_kids().push_back( bodyStmt ); 912 913 std::string adapterName = makeAdapterName( mangleName ); 913 return new FunctionDecl( adapterName, DeclarationNode:: NoStorageClass, LinkageSpec::C, adapterType, adapterBody );914 return new FunctionDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, adapterType, adapterBody ); 914 915 } 915 916 … … 1272 1273 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 1273 1274 std::string adapterName = makeAdapterName( mangleName ); 1274 paramList.push_front( new ObjectDecl( adapterName, DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );1275 paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) ); 1275 1276 adaptersDone.insert( adaptersDone.begin(), mangleName ); 1276 1277 } … … 1378 1379 std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin(); 1379 1380 std::list< DeclarationWithType *> inferredParams; 1380 ObjectDecl newObj( "", DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );1381 ObjectDecl newPtr( "", DeclarationNode:: NoStorageClass, LinkageSpec::C, 0,1381 ObjectDecl newObj( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 ); 1382 ObjectDecl newPtr( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, 1382 1383 new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 ); 1383 1384 for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) { … … 1633 1634 1634 1635 ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) { 1635 ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, type, init );1636 ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, init ); 1636 1637 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 1637 1638 return newObj; … … 1817 1818 memberDecl = origMember->clone(); 1818 1819 } else { 1819 memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, offsetType->clone(), 0 );1820 memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 ); 1820 1821 } 1821 1822 inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) ); -
TabularUnified src/GenPoly/Specialize.cc ¶
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:54:45201713 // Update Count : 2812 // Last Modified On : Mon Mar 6 23:13:00 2017 13 // Update Count : 30 14 14 // 15 15 … … 155 155 } // if 156 156 // create new thunk with same signature as formal type (C linkage, empty body) 157 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode:: NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( noLabels ) );157 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, newType, new CompoundStmt( noLabels ) ); 158 158 thunkFunc->fixUniqueId(); 159 159
Note: See TracChangeset
for help on using the changeset viewer.