Changeset be8bd88 for src/GenPoly
- Timestamp:
- Mar 8, 2017, 3:22:50 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:
- 031a2c95, 0e7ea335
- Parents:
- 87c3bef (diff), 6363ad1 (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/GenPoly
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r87c3bef rbe8bd88 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 14:57:16201713 // Update Count : 29712 // 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 ), true, false ); 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 ) ); 302 304 layoutDecl->fixUniqueId(); 303 305 return layoutDecl; … … 366 368 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 367 369 368 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 ); 369 371 layoutFnType->get_parameters().push_back( sizeParam ); 370 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 ); 371 373 layoutFnType->get_parameters().push_back( alignParam ); 372 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 ); 373 375 layoutFnType->get_parameters().push_back( offsetParam ); 374 376 addOtypeParams( layoutFnType, otypeParams ); … … 427 429 PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType ); 428 430 429 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 ); 430 432 layoutFnType->get_parameters().push_back( sizeParam ); 431 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 ); 432 434 layoutFnType->get_parameters().push_back( alignParam ); 433 435 addOtypeParams( layoutFnType, otypeParams ); … … 535 537 if ( adapters.find( mangleName ) == adapters.end() ) { 536 538 std::string adapterName = makeAdapterName( mangleName ); 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 ) ) );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 ) ) ); 538 540 } // if 539 541 } // for … … 654 656 655 657 ObjectDecl *Pass1::makeTemporary( Type *type ) { 656 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 ); 657 659 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 658 660 return newObj; … … 763 765 Type * newType = param->clone(); 764 766 if ( env ) env->apply( newType ); 765 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 ); 766 768 newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right??? 767 769 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); … … 829 831 makeRetParm( adapter ); 830 832 } // if 831 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 ) ); 832 834 return adapter; 833 835 } … … 910 912 adapterBody->get_kids().push_back( bodyStmt ); 911 913 std::string adapterName = makeAdapterName( mangleName ); 912 return new FunctionDecl( adapterName, DeclarationNode:: NoStorageClass, LinkageSpec::C, adapterType, adapterBody, false, false);914 return new FunctionDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, adapterType, adapterBody ); 913 915 } 914 916 … … 1271 1273 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 1272 1274 std::string adapterName = makeAdapterName( mangleName ); 1273 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 ) ); 1274 1276 adaptersDone.insert( adaptersDone.begin(), mangleName ); 1275 1277 } … … 1377 1379 std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin(); 1378 1380 std::list< DeclarationWithType *> inferredParams; 1379 ObjectDecl newObj( "", DeclarationNode:: NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );1380 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, 1381 1383 new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 ); 1382 1384 for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) { … … 1632 1634 1633 1635 ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) { 1634 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 ); 1635 1637 stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) ); 1636 1638 return newObj; … … 1816 1818 memberDecl = origMember->clone(); 1817 1819 } else { 1818 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 ); 1819 1821 } 1820 1822 inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) ); -
src/GenPoly/Specialize.cc
r87c3bef rbe8bd88 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Apr 28 15:17:45 201613 // Update Count : 2411 // Last Modified By : Peter A. Buhr 12 // 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 ), false, false);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.