Changeset 0bd46fd
- Timestamp:
- Sep 21, 2022, 10:52:51 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 7f6a7c9, e01eb4a
- Parents:
- 20737104
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r20737104 r0bd46fd 277 277 std::list< Declaration* > &memb = enumDecl->get_members(); 278 278 if (enumDecl->base && ! memb.empty()) { 279 unsigned long long last_val = -1; // if the first enum value has no explicit initializer, 280 // as other 279 unsigned long long last_val = -1; // if the first enum value has no explicit initializer, 280 // as other 281 281 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { 282 282 ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i ); 283 283 assert( obj ); 284 output << "static const";285 output << genType(enumDecl->base, "", options) << " ";284 output << "static "; 285 output << genType(enumDecl->base, "", options) << " const "; 286 286 output << mangleName( obj ) << " "; 287 287 output << " = "; … … 914 914 } 915 915 916 // QualifiedNameExpr should not reach to CodeGen. 916 // QualifiedNameExpr should not reach to CodeGen. 917 917 // FixQualifiedName Convert QualifiedNameExpr to VariableExpr 918 918 void CodeGenerator::postvisit( QualifiedNameExpr * expr ) { -
src/ControlStruct/LabelGeneratorNew.cpp
r20737104 r0bd46fd 14 14 // 15 15 16 using namespace std;17 18 16 #include "LabelGeneratorNew.hpp" 19 17 … … 21 19 #include "AST/Label.hpp" 22 20 #include "AST/Stmt.hpp" 21 22 using namespace std; 23 23 using namespace ast; 24 24 -
src/ControlStruct/MultiLevelExit.cpp
r20737104 r0bd46fd 356 356 vec.emplace_back( nullptr ); 357 357 for ( size_t i = vec.size() - 1 ; 0 < i ; --i ) { 358 vec[ i ] = move( vec[ i - 1 ] );358 vec[ i ] = std::move( vec[ i - 1 ] ); 359 359 } 360 360 vec[ 0 ] = element; … … 511 511 512 512 void MultiLevelExitCore::previsit( const FinallyClause * ) { 513 GuardAction([this, old = move( enclosing_control_structures)](){ enclosing_control_structures =move(old); });513 GuardAction([this, old = std::move( enclosing_control_structures)](){ enclosing_control_structures = std::move(old); }); 514 514 enclosing_control_structures = vector<Entry>(); 515 515 GuardValue( inFinally ) = true; -
src/GenPoly/ScrubTyVars.cc
r20737104 r0bd46fd 201 201 202 202 switch ( typeVar->second.kind ) { 203 case ast::TypeDecl::Dtype:204 case ast::TypeDecl::Ttype:203 case ::TypeDecl::Dtype: 204 case ::TypeDecl::Ttype: 205 205 return new ast::PointerType( 206 206 new ast::VoidType( type->qualifiers ) ); 207 case ast::TypeDecl::Ftype:207 case ::TypeDecl::Ftype: 208 208 return new ast::PointerType( 209 209 new ast::FunctionType( ast::VariableArgs ) ); -
src/Parser/lex.ll
r20737104 r0bd46fd 24 24 25 25 //**************************** Includes and Defines **************************** 26 27 #ifdef __clang__ 28 #pragma GCC diagnostic ignored "-Wnull-conversion" 29 #endif 26 30 27 31 // trigger before each matching rule's action -
src/Parser/parser.yy
r20737104 r0bd46fd 58 58 59 59 // lex uses __null in a boolean context, it's fine. 60 # pragma GCC diagnostic ignored "-Wpragmas"60 #ifdef __clang__ 61 61 #pragma GCC diagnostic ignored "-Wparentheses-equality" 62 # pragma GCC diagnostic warning "-Wpragmas"62 #endif 63 63 64 64 extern DeclarationNode * parseTree; … … 2570 2570 { 2571 2571 $$ = DeclarationNode::newEnum( $5, $8, true, true, nullptr )->addQualifiers( $4 )->addQualifiers( $6 ); 2572 } 2572 } 2573 2573 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' 2574 2574 { … … 2585 2585 ENUM attribute_list_opt identifier 2586 2586 { typedefTable.makeTypedef( *$3 ); $$ = DeclarationNode::newEnum( $3, 0, false, false )->addQualifiers( $2 ); } 2587 | ENUM attribute_list_opt type_name 2587 | ENUM attribute_list_opt type_name 2588 2588 { typedefTable.makeTypedef( *$3->type->symbolic.name ); $$ = DeclarationNode::newEnum( $3->type->symbolic.name, 0, false, false )->addQualifiers( $2 ); } 2589 2589 ; -
src/ResolvExpr/AlternativeFinder.cc
r20737104 r0bd46fd 299 299 SemanticError( expr->location, stream.str() ); 300 300 } 301 alternatives = move(pruned);301 alternatives = std::move(pruned); 302 302 PRINT( 303 303 std::cerr << "there are " << oldsize << " alternatives before elimination" << std::endl; … … 573 573 unsigned tupleStart = 0, Cost cost = Cost::zero, unsigned nextExpl = 0, 574 574 unsigned explAlt = 0 ) 575 : parent(parent), expr(expr->clone()), cost(cost), env( move(env)), need(move(need)),576 have( move(have)), openVars(move(openVars)), nextArg(nextArg), tupleStart(tupleStart),575 : parent(parent), expr(expr->clone()), cost(cost), env(std::move(env)), need(std::move(need)), 576 have(std::move(have)), openVars(std::move(openVars)), nextArg(nextArg), tupleStart(tupleStart), 577 577 nextExpl(nextExpl), explAlt(explAlt) {} 578 578 … … 580 580 OpenVarSet&& openVars, unsigned nextArg, Cost added ) 581 581 : parent(o.parent), expr(o.expr ? o.expr->clone() : nullptr), cost(o.cost + added), 582 env( move(env)), need(move(need)), have(move(have)), openVars(move(openVars)),582 env(std::move(env)), need(std::move(need)), have(std::move(have)), openVars(std::move(openVars)), 583 583 nextArg(nextArg), tupleStart(o.tupleStart), nextExpl(0), explAlt(0) {} 584 584 … … 707 707 if ( unify( ttype, argType, newResult.env, newResult.need, newResult.have, 708 708 newResult.openVars, indexer ) ) { 709 finalResults.push_back( move(newResult) );709 finalResults.push_back( std::move(newResult) ); 710 710 } 711 711 … … 726 726 if ( expl.exprs.empty() ) { 727 727 results.emplace_back( 728 results[i], move(env), copy(results[i].need),729 copy(results[i].have), move(openVars), nextArg + 1, expl.cost );728 results[i], std::move(env), copy(results[i].need), 729 copy(results[i].have), std::move(openVars), nextArg + 1, expl.cost ); 730 730 731 731 continue; … … 734 734 // add new result 735 735 results.emplace_back( 736 i, expl.exprs.front().get(), move(env), copy(results[i].need),737 copy(results[i].have), move(openVars), nextArg + 1,736 i, expl.exprs.front().get(), std::move(env), copy(results[i].need), 737 copy(results[i].have), std::move(openVars), nextArg + 1, 738 738 nTuples, expl.cost, expl.exprs.size() == 1 ? 0 : 1, j ); 739 739 } … … 747 747 // splice final results onto results 748 748 for ( std::size_t i = 0; i < finalResults.size(); ++i ) { 749 results.push_back( move(finalResults[i]) );749 results.push_back( std::move(finalResults[i]) ); 750 750 } 751 751 return ! finalResults.empty(); … … 783 783 784 784 results.emplace_back( 785 i, expr, move(env), move(need), move(have),move(openVars), nextArg,785 i, expr, std::move(env), std::move(need), std::move(have), std::move(openVars), nextArg, 786 786 nTuples, Cost::zero, nextExpl, results[i].explAlt ); 787 787 } … … 801 801 indexer ) ) { 802 802 results.emplace_back( 803 i, new DefaultArgExpr( cnstExpr ), move(env), move(need),move(have),804 move(openVars), nextArg, nTuples );803 i, new DefaultArgExpr( cnstExpr ), std::move(env), std::move(need), std::move(have), 804 std::move(openVars), nextArg, nTuples ); 805 805 } 806 806 } … … 824 824 if ( expl.exprs.empty() ) { 825 825 results.emplace_back( 826 results[i], move(env), move(need), move(have),move(openVars),826 results[i], std::move(env), std::move(need), std::move(have), std::move(openVars), 827 827 nextArg + 1, expl.cost ); 828 828 … … 846 846 // add new result 847 847 results.emplace_back( 848 i, expr, move(env), move(need), move(have),move(openVars), nextArg + 1,848 i, expr, std::move(env), std::move(need), std::move(have), std::move(openVars), nextArg + 1, 849 849 nTuples, expl.cost, expl.exprs.size() == 1 ? 0 : 1, j ); 850 850 } … … 962 962 if ( expl.exprs.empty() ) { 963 963 results.emplace_back( 964 results[i], move(env), copy(results[i].need),965 copy(results[i].have), move(openVars), nextArg + 1, expl.cost );964 results[i], std::move(env), copy(results[i].need), 965 copy(results[i].have), std::move(openVars), nextArg + 1, expl.cost ); 966 966 967 967 continue; … … 970 970 // add new result 971 971 results.emplace_back( 972 i, expl.exprs.front().get(), move(env), copy(results[i].need),973 copy(results[i].have), move(openVars), nextArg + 1, 0,972 i, expl.exprs.front().get(), std::move(env), copy(results[i].need), 973 copy(results[i].have), std::move(openVars), nextArg + 1, 0, 974 974 expl.cost, expl.exprs.size() == 1 ? 0 : 1, j ); 975 975 } … … 1067 1067 funcE.emplace_back( actual, indexer ); 1068 1068 } 1069 argExpansions.insert( argExpansions.begin(), move(funcE) );1069 argExpansions.insert( argExpansions.begin(), std::move(funcE) ); 1070 1070 1071 1071 for ( AltList::iterator funcOp = funcOpFinder.alternatives.begin(); … … 1116 1116 } // for 1117 1117 1118 candidates = move(alternatives);1118 candidates = std::move(alternatives); 1119 1119 1120 1120 // use a new list so that alternatives are not examined by addAnonConversions twice. -
src/ResolvExpr/Unify.cc
r20737104 r0bd46fd 727 727 }; 728 728 } 729 729 730 730 std::vector< ast::ptr< ast::Type > > flattenList( 731 731 const std::vector< ast::ptr< ast::Type > > & src, ast::TypeEnvironment & env … … 989 989 if ( isTuple && isTuple2 ) { 990 990 ++it; ++jt; // skip ttype parameters before break 991 } else if ( isTuple ) { 991 } else if ( isTuple ) { 992 992 // bundle remaining params into tuple 993 993 pty2 = tupleFromExprs( param2, jt, params2.end(), pty->qualifiers ); … … 1035 1035 private: 1036 1036 /// Creates a tuple type based on a list of Type 1037 1037 1038 1038 1039 1039 static bool unifyList( … … 1207 1207 } 1208 1208 1209 } else if ( common = commonType( t1, t2, env, need, have, open, widen, symtab)) {1209 } else if (( common = commonType( t1, t2, env, need, have, open, widen, symtab ))) { 1210 1210 // no exact unification, but common type 1211 1211 auto c = shallowCopy(common.get()); -
src/Validate/ReplaceTypedef.cpp
r20737104 r0bd46fd 193 193 } 194 194 195 void ReplaceTypedefCore::previsit( ast::FunctionDecl const * decl) {195 void ReplaceTypedefCore::previsit( ast::FunctionDecl const * ) { 196 196 GuardScope( typedefNames ); 197 197 GuardScope( typedeclNames ); … … 199 199 } 200 200 201 void ReplaceTypedefCore::previsit( ast::ObjectDecl const * decl) {201 void ReplaceTypedefCore::previsit( ast::ObjectDecl const * ) { 202 202 GuardScope( typedefNames ); 203 203 GuardScope( typedeclNames ); … … 241 241 } 242 242 243 void ReplaceTypedefCore::previsit( ast::CastExpr const * expr) {244 GuardScope( typedefNames ); 245 GuardScope( typedeclNames ); 246 } 247 248 void ReplaceTypedefCore::previsit( ast::CompoundStmt const * expr) {243 void ReplaceTypedefCore::previsit( ast::CastExpr const * ) { 244 GuardScope( typedefNames ); 245 GuardScope( typedeclNames ); 246 } 247 248 void ReplaceTypedefCore::previsit( ast::CompoundStmt const * ) { 249 249 GuardScope( typedefNames ); 250 250 GuardScope( typedeclNames ); … … 273 273 } 274 274 275 void ReplaceTypedefCore::previsit( ast::TraitDecl const * decl) {275 void ReplaceTypedefCore::previsit( ast::TraitDecl const * ) { 276 276 GuardScope( typedefNames ); 277 277 GuardScope( typedeclNames );
Note: See TracChangeset
for help on using the changeset viewer.