- Timestamp:
- Dec 12, 2024, 4:35:32 PM (6 days ago)
- Branches:
- master
- Children:
- 8ee211d
- Parents:
- f979f0ba
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cpp
rf979f0ba r35cc6d4 86 86 makeLayoutCType() 87 87 ) ); 88 params.emplace_back(new ast::ObjectDecl(88 auto alignParam = new ast::ObjectDecl( 89 89 sizedParam->location, 90 90 alignofName( paramName ), 91 91 makeLayoutCType() 92 ) ); 92 ); 93 alignParam->attributes.push_back( new ast::Attribute( "unused" ) ); 94 params.emplace_back( alignParam ); 93 95 } 94 96 } -
src/Validate/Autogen.cpp
rf979f0ba r35cc6d4 229 229 } 230 230 231 /// Changes the node inside a pointer so that it has the unused attribute. 232 void addUnusedAttribute( ast::ptr<ast::DeclWithType> & declPtr ) { 233 ast::DeclWithType * decl = declPtr.get_and_mutate(); 231 /// Changes the freshly-constructed (non-const) decl so that it has the unused attribute. 232 ast::ObjectDecl * addUnusedAttribute( ast::ObjectDecl * decl ) { 234 233 decl->attributes.push_back( new ast::Attribute( "unused" ) ); 234 return decl; 235 235 } 236 236 … … 373 373 374 374 ast::ObjectDecl * FuncGenerator::dstParam() const { 375 return new ast::ObjectDecl( getLocation(), "_dst", 376 new ast::ReferenceType( ast::deepCopy( type ) ) ); 375 return addUnusedAttribute( 376 new ast::ObjectDecl( getLocation(), "_dst", 377 new ast::ReferenceType( ast::deepCopy( type ) ) ) ); 377 378 } 378 379 379 380 ast::ObjectDecl * FuncGenerator::srcParam() const { 380 return new ast::ObjectDecl( getLocation(), "_src", 381 ast::deepCopy( type ) ); 381 return addUnusedAttribute( 382 new ast::ObjectDecl( getLocation(), "_src", 383 ast::deepCopy( type ) ) ); 382 384 } 383 385 … … 673 675 // Default constructor and destructor is empty. 674 676 functionDecl->stmts = new ast::CompoundStmt( location ); 675 // Add unused attribute to parameter to silence warnings.676 addUnusedAttribute( params.front() );677 677 } 678 678 } … … 747 747 // Default constructor and destructor is empty. 748 748 functionDecl->stmts = new ast::CompoundStmt( location ); 749 // Just add unused attribute to parameter to silence warnings.750 addUnusedAttribute( params.front() );751 749 } 752 750 } -
src/Validate/CompoundLiteral.cpp
rf979f0ba r35cc6d4 52 52 storageClasses 53 53 ); 54 // FIXME: A resolution of #280 could make the unused attribute unnecessary here 55 // (let test nowarn/unused decide) 56 temp->attributes.push_back( new ast::Attribute( "unused" ) ); 54 57 declsToAddBefore.push_back( temp ); 55 58 return new ast::VariableExpr( expr->location, temp ); -
src/Validate/ImplementEnumFunc.cpp
rf979f0ba r35cc6d4 240 240 return genProto( 241 241 "type_name", 242 {new ast::ObjectDecl(getLocation(), " _i", new ast::EnumInstType(decl))},242 {new ast::ObjectDecl(getLocation(), "", new ast::EnumInstType(decl))}, 243 243 {new ast::ObjectDecl( 244 244 getLocation(), "_ret",
Note: See TracChangeset
for help on using the changeset viewer.