Changes in src/GenPoly/Box.cc [a7c90d4:3a5131ed]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
ra7c90d4 r3a5131ed 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 6 23:45:59201713 // Update Count : 33012 // Last Modified On : Thu Feb 16 14:57:16 2017 13 // Update Count : 297 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:: 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 ) );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 ) ); 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( 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 ) ); 300 FunctionDecl *layoutDecl = new FunctionDecl( 301 layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), true, false ); 304 302 layoutDecl->fixUniqueId(); 305 303 return layoutDecl; … … 368 366 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 369 367 370 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );368 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 ); 371 369 layoutFnType->get_parameters().push_back( sizeParam ); 372 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );370 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 373 371 layoutFnType->get_parameters().push_back( alignParam ); 374 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );372 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 375 373 layoutFnType->get_parameters().push_back( offsetParam ); 376 374 addOtypeParams( layoutFnType, otypeParams ); … … 429 427 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 430 428 431 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );429 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 ); 432 430 layoutFnType->get_parameters().push_back( sizeParam ); 433 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );431 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 ); 434 432 layoutFnType->get_parameters().push_back( alignParam ); 435 433 addOtypeParams( layoutFnType, otypeParams ); … … 537 535 if ( adapters.find( mangleName ) == adapters.end() ) { 538 536 std::string adapterName = makeAdapterName( mangleName ); 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 ) ) );537 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) ); 540 538 } // if 541 539 } // for … … 656 654 657 655 ObjectDecl *Pass1::makeTemporary( Type *type ) { 658 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, type, 0 );656 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, 0 ); 659 657 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 660 658 return newObj; … … 765 763 Type * newType = param->clone(); 766 764 if ( env ) env->apply( newType ); 767 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, newType, 0 );765 ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, newType, 0 ); 768 766 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right??? 769 767 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); … … 831 829 makeRetParm( adapter ); 832 830 } // if 833 adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );831 adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) ); 834 832 return adapter; 835 833 } … … 912 910 adapterBody->get_kids().push_back( bodyStmt ); 913 911 std::string adapterName = makeAdapterName( mangleName ); 914 return new FunctionDecl( adapterName, DeclarationNode:: StorageClasses(), LinkageSpec::C, adapterType, adapterBody);912 return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody, false, false ); 915 913 } 916 914 … … 1273 1271 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 1274 1272 std::string adapterName = makeAdapterName( mangleName ); 1275 paramList.push_front( new ObjectDecl( adapterName, DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );1273 paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) ); 1276 1274 adaptersDone.insert( adaptersDone.begin(), mangleName ); 1277 1275 } … … 1379 1377 std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin(); 1380 1378 std::list< DeclarationWithType *> inferredParams; 1381 ObjectDecl newObj( "", DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );1382 ObjectDecl newPtr( "", DeclarationNode:: StorageClasses(), LinkageSpec::C, 0,1379 ObjectDecl newObj( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 ); 1380 ObjectDecl newPtr( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, 1383 1381 new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 ); 1384 1382 for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) { … … 1634 1632 1635 1633 ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) { 1636 ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode:: StorageClasses(), LinkageSpec::C, 0, type, init );1634 ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, init ); 1637 1635 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 1638 1636 return newObj; … … 1818 1816 memberDecl = origMember->clone(); 1819 1817 } else { 1820 memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode:: StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 );1818 memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, offsetType->clone(), 0 ); 1821 1819 } 1822 1820 inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) );
Note:
See TracChangeset
for help on using the changeset viewer.