- Timestamp:
- Oct 13, 2023, 7:13:21 PM (2 years ago)
- Branches:
- master
- Children:
- a97b9ed, bab2917
- Parents:
- 85034ed (diff), 0bf0b978 (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
- Files:
-
- 5 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r85034ed r8cbe732 269 269 node->location, 270 270 Type::StorageClasses( node->storage.val ), 271 271 get<Type>().accept1( node->base ), 272 272 LinkageSpec::Spec( node->linkage.val ) 273 273 ); … … 567 567 } 568 568 569 569 const ast::WhenClause * visit( const ast::WhenClause * node ) override final { 570 570 // There is no old-AST WhenClause, so this should never be called. 571 571 assert( !node ); … … 604 604 } 605 605 606 607 606 const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final { 607 // There is no old-AST WaitUntilStmt, so this should never be called. 608 608 assert( !node ); 609 609 return nullptr; … … 648 648 ); 649 649 return stmtPostamble( stmt, node ); 650 } 651 652 const ast::Stmt * visit( const ast::CorunStmt * node ) override final { 653 // There is no old-AST CorunStmt, so this should never be called. 654 assert( !node ); 655 return nullptr; 650 656 } 651 657 … … 853 859 // New workd: one public type: node->result, plus node->underlyer only to support roundtrip conversion 854 860 // preserving underlyer because the correct type for string literals is complicated to construct, 855 861 // and distinguishing a string from other literals using the type is hard to do accurately 856 862 // Both worlds: the outer, expression-level type can change during resolution 857 863 // for a string, that's char[k] before-resolve and char * after … … 859 865 // for a string, that's char[k] always 860 866 // Both worlds: the "rep" field of a constant is the C source file fragment that compiles to the desired value 861 867 // for a string, that includes outer quotes, backslashes, et al cases from the Literals test 862 868 ConstantExpr *rslt = new ConstantExpr(Constant( 863 869 get<Type>().accept1(node->underlyer), … … 1518 1524 return strict_dynamic_cast< ast::Decl * >( node ); 1519 1525 } 1520 1526 1521 1527 ConverterOldToNew() = default; 1522 1528 ConverterOldToNew(const ConverterOldToNew &) = delete; … … 1581 1587 ast::Label make_label(const Label* old) { 1582 1588 CodeLocation const & location = 1583 1589 ( old->labelled ) ? old->labelled->location : CodeLocation(); 1584 1590 return ast::Label( 1585 1591 location, … … 2240 2246 // TypeSubstitution shouldn't exist yet in old. 2241 2247 ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) { 2242 2243 2248 if (!old) return nullptr; 2244 2249 if (old->empty()) return nullptr; … … 2285 2290 ast::Expr * visitBaseExpr_SkipResultType( const Expression * old, ast::Expr * nw) { 2286 2291 2287 nw->env 2292 nw->env = convertTypeSubstitution(old->env); 2288 2293 2289 2294 nw->extension = old->extension; … … 2856 2861 2857 2862 virtual void visit( const EnumInstType * old ) override final { 2858 ast::EnumInstType * ty; 2863 ast::EnumInstType * ty; 2859 2864 if ( old->baseEnum ) { 2860 2865 ty = new ast::EnumInstType{ -
src/AST/Fwd.hpp
r85034ed r8cbe732 67 67 class ImplicitCtorDtorStmt; 68 68 class MutexStmt; 69 class CorunStmt; 69 70 70 71 class Expr; -
src/AST/Node.cpp
r85034ed r8cbe732 192 192 template class ast::ptr_base< ast::MutexStmt, ast::Node::ref_type::weak >; 193 193 template class ast::ptr_base< ast::MutexStmt, ast::Node::ref_type::strong >; 194 template class ast::ptr_base< ast::CorunStmt, ast::Node::ref_type::weak >; 195 template class ast::ptr_base< ast::CorunStmt, ast::Node::ref_type::strong >; 194 196 template class ast::ptr_base< ast::Expr, ast::Node::ref_type::weak >; 195 197 template class ast::ptr_base< ast::Expr, ast::Node::ref_type::strong >; -
src/AST/Pass.hpp
r85034ed r8cbe732 162 162 const ast::FinallyClause * visit( const ast::FinallyClause * ) override final; 163 163 const ast::Stmt * visit( const ast::SuspendStmt * ) override final; 164 164 const ast::WhenClause * visit( const ast::WhenClause * ) override final; 165 165 const ast::Stmt * visit( const ast::WaitForStmt * ) override final; 166 166 const ast::WaitForClause * visit( const ast::WaitForClause * ) override final; 167 167 const ast::Stmt * visit( const ast::WaitUntilStmt * ) override final; 168 168 const ast::Decl * visit( const ast::WithStmt * ) override final; 169 169 const ast::NullStmt * visit( const ast::NullStmt * ) override final; … … 171 171 const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) override final; 172 172 const ast::Stmt * visit( const ast::MutexStmt * ) override final; 173 const ast::Stmt * visit( const ast::CorunStmt * ) override final; 173 174 const ast::Expr * visit( const ast::ApplicationExpr * ) override final; 174 175 const ast::Expr * visit( const ast::UntypedExpr * ) override final; -
src/AST/Pass.impl.hpp
r85034ed r8cbe732 1121 1121 1122 1122 //-------------------------------------------------------------------------- 1123 // CorunStmt 1124 template< typename core_t > 1125 const ast::Stmt * ast::Pass< core_t >::visit( const ast::CorunStmt * node ) { 1126 VISIT_START( node ); 1127 1128 if ( __visit_children() ) { 1129 maybe_accept( node, &CorunStmt::stmt ); 1130 } 1131 1132 VISIT_END( Stmt, node ); 1133 } 1134 1135 //-------------------------------------------------------------------------- 1123 1136 // ApplicationExpr 1124 1137 template< typename core_t > -
src/AST/Print.cpp
r85034ed r8cbe732 209 209 } 210 210 211 211 void print( const ast::WaitStmt * node ) { 212 212 if ( node->timeout_time ) { 213 213 os << indent-1 << "timeout of:" << endl; … … 860 860 } 861 861 862 862 virtual const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final { 863 863 os << "Waituntil Statement" << endl; 864 864 indent += 2; … … 866 866 clause->accept( *this ); 867 867 } 868 print(node); // calls print( const ast::WaitStmt * node ) 868 // calls print( const ast::WaitStmt * node ) 869 print(node); 869 870 return node; 870 871 } … … 913 914 printAll( node->mutexObjs ); 914 915 --indent; 916 os << indent << "... with Statement: "; 917 ++indent; 918 safe_print( node->stmt ); 919 --indent; 920 os << endl; 921 922 return node; 923 } 924 925 virtual const ast::Stmt * visit( const ast::CorunStmt * node ) override final { 926 os << "Corun Statement" << endl; 915 927 os << indent << "... with Statement: "; 916 928 ++indent; -
src/AST/Stmt.hpp
r85034ed r8cbe732 532 532 }; 533 533 534 // Corun Statement 535 class CorunStmt final : public Stmt { 536 public: 537 ptr<Stmt> stmt; 538 539 CorunStmt( const CodeLocation & loc, const Stmt * stmt, const std::vector<Label> && labels = {} ) 540 : Stmt(loc, std::move(labels)), stmt(stmt) {} 541 542 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } 543 private: 544 CorunStmt * clone() const override { return new CorunStmt{ *this }; } 545 MUTATE_FRIEND 546 }; 547 534 548 } // namespace ast 535 549 -
src/AST/Visitor.hpp
r85034ed r8cbe732 59 59 virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) = 0; 60 60 virtual const ast::Stmt * visit( const ast::MutexStmt * ) = 0; 61 virtual const ast::Stmt * visit( const ast::CorunStmt * ) = 0; 61 62 virtual const ast::Expr * visit( const ast::ApplicationExpr * ) = 0; 62 63 virtual const ast::Expr * visit( const ast::UntypedExpr * ) = 0; -
src/CodeGen/CodeGenerator.cc
r85034ed r8cbe732 1157 1157 1158 1158 void CodeGenerator::postvisit( WithStmt * with ) { 1159 if ( ! options.genC ) {1160 output << "with ( "; 1161 genCommaList( with->exprs.begin(), with->exprs.end() );1162 output << " ) ";1163 }1159 assertf( ! options.genC, "WithStmts should not reach code generation." ); 1160 1161 output << "with ( "; 1162 genCommaList( with->exprs.begin(), with->exprs.end() ); 1163 output << " ) "; 1164 1164 with->stmt->accept( *visitor ); 1165 1165 } -
src/CodeGen/LinkOnce.cc
r85034ed r8cbe732 10 10 // Created On : Thur May 13 10:10:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thur May 13 14:39:00 202113 // Update Count : 012 // Last Modified On : Wed Oct 4 10:52:00 2023 13 // Update Count : 1 14 14 // 15 15 … … 18 18 #include <algorithm> 19 19 20 #include "AST/Attribute.hpp" 21 #include "AST/Decl.hpp" 22 #include "AST/Expr.hpp" 23 #include "AST/Pass.hpp" 20 24 #include "Common/PassVisitor.h" // for PassVisitor, WithShortCircuiting 21 25 22 26 namespace CodeGen { 23 27 24 static bool is_cfa_linkonce( Attribute const * attr ) { 28 namespace { 29 30 bool is_cfa_linkonce_old( Attribute const * attr ) { 25 31 return std::string("cfa_linkonce") == attr->name; 26 32 } 27 33 28 static bool is_section_attribute( Attribute const * attr ) {34 bool is_section_attribute_old( Attribute const * attr ) { 29 35 return std::string("section") == attr->name; 30 36 } … … 39 45 std::list< Attribute * > & attributes = decl->attributes; 40 46 // See if we can find the element: 41 auto found = std::find_if(attributes.begin(), attributes.end(), is_cfa_linkonce );47 auto found = std::find_if(attributes.begin(), attributes.end(), is_cfa_linkonce_old ); 42 48 if ( attributes.end() != found ) { 43 49 // Remove any other sections: 44 attributes.remove_if( is_section_attribute );50 attributes.remove_if( is_section_attribute_old ); 45 51 // Iterator to the cfa_linkonce attribute should still be valid. 46 52 Attribute * attribute = *found; … … 63 69 }; 64 70 71 bool is_cfa_linkonce( ast::Attribute const * attr ) { 72 return "cfa_linkonce" == attr->name; 73 } 74 75 bool is_section_attribute( ast::Attribute const * attr ) { 76 return "section" == attr->name; 77 } 78 79 struct LinkOnceCore : public ast::WithShortCircuiting { 80 void previsit( ast::Decl const * ) { 81 visit_children = false; 82 } 83 84 ast::DeclWithType const * postvisit( ast::DeclWithType const * decl ) { 85 // Check to see if we have to mutate, because should be uncommon. 86 { 87 auto & attributes = decl->attributes; 88 auto found = std::find_if( attributes.begin(), attributes.end(), 89 is_cfa_linkonce ); 90 if ( attributes.end() == found ) return decl; 91 } 92 auto mutDecl = mutate( decl ); 93 auto & attributes = mutDecl->attributes; 94 95 // Remove all conflicting section attributes. 96 erase_if( attributes, is_section_attribute ); 97 98 // Get the attribute, and overwrite it as a section attribute. 99 auto found = std::find_if( attributes.begin(), attributes.end(), 100 is_cfa_linkonce ); 101 assert( attributes.end() != found ); 102 ast::Attribute * attribute = found->get_and_mutate(); 103 assert( attribute->params.empty() ); 104 assert( !decl->mangleName.empty() ); 105 106 attribute->name = "section"; 107 attribute->params.push_back( 108 ast::ConstantExpr::from_string( mutDecl->location, 109 ".gnu.linkonce." + decl->mangleName 110 ) 111 ); 112 113 // Unconditionnaly add "visibility(default)" to anything with 114 // .gnu.linkonce visibility is a mess otherwise. 115 attributes.push_back( new ast::Attribute( "visibility", { 116 ast::ConstantExpr::from_string( mutDecl->location, "default" ) 117 } ) ); 118 return mutDecl; 119 } 120 }; 121 122 } // namespace 123 65 124 void translateLinkOnce( std::list< Declaration *> & translationUnit ) { 66 125 PassVisitor<LinkOnceVisitorCore> translator; … … 68 127 } 69 128 129 void translateLinkOnce( ast::TranslationUnit & translationUnit ) { 130 ast::Pass<LinkOnceCore>::run( translationUnit ); 70 131 } 132 133 } // namespace CodeGen -
src/CodeGen/LinkOnce.h
r85034ed r8cbe732 10 10 // Created On : Thur May 13 10:06:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thur May 13 14:38:00 202113 // Update Count : 012 // Last Modified On : Wed Oct 4 10:52:00 2023 13 // Update Count : 1 14 14 // 15 15 … … 23 23 24 24 class Declaration; 25 namespace ast { 26 class TranslationUnit; 27 } 25 28 26 29 namespace CodeGen { 27 30 28 31 void translateLinkOnce( std::list< Declaration *> & translationUnit ); 32 void translateLinkOnce( ast::TranslationUnit & translationUnit ); 29 33 /* Convert the cfa_linkonce attribute on top level declaration into 30 34 * a special section declaration (.gnu.linkonce) so that it may be defined -
src/Common/CodeLocationTools.cpp
r85034ed r8cbe732 137 137 macro(ImplicitCtorDtorStmt, Stmt) \ 138 138 macro(MutexStmt, Stmt) \ 139 macro(CorunStmt, Stmt) \ 139 140 macro(ApplicationExpr, Expr) \ 140 141 macro(UntypedExpr, Expr) \ -
src/Concurrency/module.mk
r85034ed r8cbe732 18 18 Concurrency/Actors.cpp \ 19 19 Concurrency/Actors.hpp \ 20 Concurrency/Corun.cpp \ 21 Concurrency/Corun.hpp \ 20 22 Concurrency/KeywordsNew.cpp \ 21 23 Concurrency/Keywords.cc \ -
src/GenPoly/Box.h
r85034ed r8cbe732 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Box.h -- 7 // Box.h -- Implement polymorphic function calls and types. 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:23:52 201713 // Update Count : 611 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Oct 6 13:37:00 2022 13 // Update Count : 7 14 14 // 15 15 … … 19 19 20 20 class Declaration; 21 namespace ast { 22 class TranslationUnit; 23 } 21 24 22 25 namespace GenPoly { 23 26 /// boxes polymorphic function calls 24 27 void box( std::list< Declaration* >& translationUnit ); 28 void box( ast::TranslationUnit & translationUnit ); 25 29 } // namespace GenPoly 26 30 -
src/GenPoly/InstantiateGeneric.h
r85034ed r8cbe732 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // InstantiateGeneric.h -- 7 // InstantiateGeneric.h -- Create concrete instances of generic types. 8 8 // 9 9 // Author : Aaron B. Moss … … 24 24 25 25 namespace GenPoly { 26 /// Replaces all generic types that have static layout with concrete 27 /// instantiations. Types with concrete values for otype parameters will be 28 /// template-expanded, while dtype and ftype parameters will be replaced by 29 /// the appropriate void type. 26 30 27 void instantiateGeneric( std::list< Declaration* > &translationUnit ); 31 28 void instantiateGeneric( ast::TranslationUnit & translationUnit ); 29 /// Replaces all generic types that have static layout with concrete 30 /// instantiations. Sized types are replaced with the concrete argument types 31 /// while unsized types are erased to a void type. 32 /// This pass can cause designators to ignore the pretty print option. 33 32 34 } // namespace GenPoly 33 35 -
src/GenPoly/InstantiateGenericNew.cpp
r85034ed r8cbe732 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // InstantiateGenericNew.cpp -- 7 // InstantiateGenericNew.cpp -- Create concrete instances of generic types. 8 8 // 9 9 // Author : Andrew Beach … … 335 335 ast::Expr const * FixDtypeStatic::postvisit( ast::MemberExpr const * expr ) { 336 336 ast::ptr<ast::Type> const & type = expr->aggregate->result; 337 if ( !isGenericType( type ) ) { 338 return expr; 339 } else if ( auto inst = type.as<ast::StructInstType>() ) { 340 return fixMemberExpr( inst, expr ); 337 if ( auto inst = type.as<ast::StructInstType>() ) { 338 if ( !inst->params.empty() ) return fixMemberExpr( inst, expr ); 341 339 } else if ( auto inst = type.as<ast::UnionInstType>() ) { 342 return fixMemberExpr( inst, expr );340 if ( !inst->params.empty() ) return fixMemberExpr( inst, expr ); 343 341 } 344 342 return expr; … … 451 449 ast::Expr const * postvisit( ast::MemberExpr const * expr ); 452 450 ast::Expr const * postvisit( ast::Expr const * expr ); 453 void previsit( ast::ParseNode const * node ); 454 451 ast::Designation const * postvisit( ast::Designation const * ); 452 453 void previsit( ast::ParseNode const * node ) { 454 GuardValue( location ) = &node->location; 455 } 455 456 void previsit( ast::FunctionType const * ) { 456 457 GuardValue( inFunctionType ) = true; … … 628 629 } 629 630 630 void GenericInstantiator::previsit( ast::ParseNode const * node ) { 631 GuardValue( location ) = &node->location; 631 // This attempts to figure out what the final name of the field will be. 632 // Pretty printing can cause this to become incorrect. 633 std::string getPrintName( ast::DeclWithType const * decl ) { 634 return ( decl->linkage.is_mangled ) 635 ? decl->scopedMangleName() : decl->name; 636 } 637 638 ast::Designation const * GenericInstantiator::postvisit( 639 ast::Designation const * designation ) { 640 // Disconnect designator names from their fields. 641 // It is now incorrect to point at the generic definition where the used 642 // type now is replaced with a concrete instance. Ideally, new variable 643 // expressions would point at fields in the concrete instances, but that 644 // is work and that information should not be needed this late in 645 // compilation. 646 647 // Modify all designations, even if not needed. 648 auto mutNode = mutate( designation ); 649 for ( ast::ptr<ast::Expr> & designator : mutNode->designators ) { 650 if ( auto var = designator.as<ast::VariableExpr>() ) { 651 designator = new ast::NameExpr( 652 var->location, getPrintName( var->var ) ); 653 } 654 } 655 return mutNode; 632 656 } 633 657 -
src/GenPoly/module.mk
r85034ed r8cbe732 22 22 23 23 SRC += $(SRC_GENPOLY) \ 24 GenPoly/BoxNew.cpp \ 24 25 GenPoly/Box.cc \ 25 26 GenPoly/Box.h \ -
src/Parser/StatementNode.cc
r85034ed r8cbe732 498 498 } // build_mutex 499 499 500 ast::Stmt * build_corun( const CodeLocation & location, StatementNode * stmt ) { 501 ast::Stmt * body = maybeMoveBuild( stmt ); 502 return new ast::CorunStmt( location, body ); 503 } // build_corun 504 500 505 // Local Variables: // 501 506 // tab-width: 4 // -
src/Parser/StatementNode.h
r85034ed r8cbe732 105 105 ast::Stmt * build_with( const CodeLocation &, ExpressionNode * exprs, StatementNode * stmt ); 106 106 ast::Stmt * build_mutex( const CodeLocation &, ExpressionNode * exprs, StatementNode * stmt ); 107 ast::Stmt * build_corun( const CodeLocation &, StatementNode * stmt ); -
src/Parser/lex.ll
r85034ed r8cbe732 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Fri Jun 9 10:04:00202313 * Update Count : 77 012 * Last Modified On : Tue Oct 3 17:10:57 2023 13 * Update Count : 773 14 14 */ 15 15 … … 217 217 218 218 /* keywords */ 219 alignas { KEYWORD_RETURN(ALIGNAS); } // CFA 219 220 _Alignas { KEYWORD_RETURN(ALIGNAS); } // C11 221 alignof { KEYWORD_RETURN(ALIGNOF); } // CFA 220 222 _Alignof { KEYWORD_RETURN(ALIGNOF); } // C11 221 223 __alignof { KEYWORD_RETURN(ALIGNOF); } // GCC … … 239 241 choose { KEYWORD_RETURN(CHOOSE); } // CFA 240 242 coerce { KEYWORD_RETURN(COERCE); } // CFA 243 corun { KEYWORD_RETURN(CORUN); } // CFA 244 cofor { KEYWORD_RETURN(COFOR); } // CFA 241 245 _Complex { KEYWORD_RETURN(COMPLEX); } // C99 242 246 __complex { KEYWORD_RETURN(COMPLEX); } // GCC … … 319 323 static { KEYWORD_RETURN(STATIC); } 320 324 _Static_assert { KEYWORD_RETURN(STATICASSERT); } // C11 321 _static_assert { KEYWORD_RETURN(STATICASSERT); } // C23325 static_assert { KEYWORD_RETURN(STATICASSERT); } // C23 322 326 struct { KEYWORD_RETURN(STRUCT); } 323 327 suspend { KEYWORD_RETURN(SUSPEND); } // CFA … … 326 330 __thread { KEYWORD_RETURN(THREADLOCALGCC); } // GCC 327 331 _Thread_local { KEYWORD_RETURN(THREADLOCALC11); } // C11 332 thread_local { KEYWORD_RETURN(THREADLOCALC11); } // C23 328 333 throw { KEYWORD_RETURN(THROW); } // CFA 329 334 throwResume { KEYWORD_RETURN(THROWRESUME); } // CFA -
src/Parser/parser.yy
r85034ed r8cbe732 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 4 18:28:12 202313 // Update Count : 639 312 // Last Modified On : Tue Oct 3 17:14:12 2023 13 // Update Count : 6396 14 14 // 15 15 … … 350 350 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 351 351 %token CHOOSE FALLTHRU FALLTHROUGH WITH WHEN WAITFOR WAITUNTIL // CFA 352 %token CORUN COFOR 352 353 %token DISABLE ENABLE TRY THROW THROWRESUME AT // CFA 353 354 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) … … 422 423 %type<stmt> with_statement 423 424 %type<expr> with_clause_opt 425 %type<stmt> corun_statement cofor_statement 424 426 %type<stmt> exception_statement 425 427 %type<clause> handler_clause finally_clause … … 1140 1142 | waitfor_statement 1141 1143 | waituntil_statement 1144 | corun_statement 1145 | cofor_statement 1142 1146 | exception_statement 1143 1147 | enable_disable_statement … … 1713 1717 wor_waituntil_clause %prec THEN 1714 1718 { $$ = new StatementNode( build_waituntil_stmt( yylloc, $1 ) ); } 1719 ; 1720 1721 corun_statement: 1722 CORUN statement 1723 { $$ = new StatementNode( build_corun( yylloc, $2 ) ); } 1724 ; 1725 1726 cofor_statement: 1727 COFOR '(' for_control_expression_list ')' statement 1728 { SemanticError( yylloc, "cofor statement is currently unimplemented." ); $$ = nullptr; } 1715 1729 ; 1716 1730 -
src/ResolvExpr/module.mk
r85034ed r8cbe732 72 72 ResolvExpr/AlternativePrinter.h \ 73 73 ResolvExpr/CandidatePrinter.cpp \ 74 ResolvExpr/CandidatePrinter.hpp 74 ResolvExpr/CandidatePrinter.hpp \ 75 ResolvExpr/EraseWith.cpp \ 76 ResolvExpr/EraseWith.hpp 75 77 76 78 SRCDEMANGLE += $(SRC_RESOLVEXPR) -
src/Validate/NoIdSymbolTable.hpp
r85034ed r8cbe732 20 20 namespace Validate { 21 21 22 // A SymbolTable that only has the operations used in the Translate Dimension 23 // pass. More importantly, it doesn't have some methods that should no be 22 // A SymbolTable that only tracks names relevant to Validate passes. 23 // It tracks type names but not identifier names. 24 // Some of the canonicalization that occurs before the resolver 25 // affects how identifier name errors get reported to the user. 26 // The Validate phase needs to chase type names, 27 // but it is too early to try tracking identifier names. 28 // Identifier skipping is acheived by omitting methods that should not be 24 29 // called by the Pass template (lookupId and addId). 25 30 class NoIdSymbolTable { 26 31 ast::SymbolTable base; 27 32 public: 33 // All names that are tracked (now) are eligible for collision validation (now). 34 // (Names that are only tracked later get their collision validation then.) 35 NoIdSymbolTable() : base(ast::SymbolTable::ValidateOnAdd) {} 36 28 37 # define FORWARD_X( func, types_and_names, just_names ) \ 29 38 inline auto func types_and_names -> decltype( base.func just_names ) { \ -
src/main.cc
r85034ed r8cbe732 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 10 21:12:17202313 // Update Count : 68 212 // Last Modified On : Thu Sep 28 22:28:45 2023 13 // Update Count : 687 14 14 // 15 15 … … 46 46 #include "Common/utility.h" // for deleteAll, filter, printAll 47 47 #include "Concurrency/Actors.hpp" // for implementActors 48 #include "Concurrency/Corun.hpp" // for implementCorun 48 49 #include "Concurrency/Keywords.h" // for implementMutex, implement... 49 50 #include "Concurrency/Waitfor.h" // for generateWaitfor … … 62 63 #include "Parser/RunParser.hpp" // for buildList, dumpParseTree,... 63 64 #include "ResolvExpr/CandidatePrinter.hpp" // for printCandidates 65 #include "ResolvExpr/EraseWith.hpp" // for eraseWith 64 66 #include "ResolvExpr/Resolver.h" // for resolve 65 67 #include "SynTree/LinkageSpec.h" // for Spec, Cforall, Intrinsic … … 344 346 PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords, transUnit ); 345 347 PASS( "Fix Unique Ids", Validate::fixUniqueIds, transUnit ); 348 PASS( "Implement Corun", Concurrency::implementCorun, transUnit ); 346 349 PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls, transUnit ); 347 350 … … 396 399 397 400 PASS( "Fix Init", InitTweak::fix, transUnit, buildingLibrary() ); 401 PASS( "Erase With", ResolvExpr::eraseWith, transUnit ); 398 402 399 403 // fix ObjectDecl - replaces ConstructorInit nodes … … 419 423 420 424 PASS( "Convert L-Value", GenPoly::convertLvalue, transUnit ); 425 DUMP( bboxp, std::move( transUnit ) ); 426 PASS( "Box", GenPoly::box, transUnit ); 427 PASS( "Link-Once", CodeGen::translateLinkOnce, transUnit ); 421 428 422 429 translationUnit = convert( std::move( transUnit ) ); 423 424 DUMP( bboxp, translationUnit );425 PASS( "Box", GenPoly::box, translationUnit );426 427 PASS( "Link-Once", CodeGen::translateLinkOnce, translationUnit );428 430 429 431 // Code has been lowered to C, now we can start generation. … … 540 542 { "ascodegen", codegenp, true, "print AST as codegen rather than AST" }, 541 543 { "asterr", errorp, true, "print AST on error" }, 542 { "declstats", declstatsp, true, " code property statistics" },543 { "parse", yydebug, true, " yacc (parsing) debug information" },544 { "declstats", declstatsp, true, "print code property statistics" }, 545 { "parse", yydebug, true, "print yacc (parsing) debug information" }, 544 546 { "pretty", prettycodegenp, true, "prettyprint for ascodegen flag" }, 545 547 { "rproto", resolvprotop, true, "resolver-proto instance" }, 546 548 { "rsteps", resolvep, true, "print resolver steps" }, 547 // codedumps549 // AST dumps 548 550 { "ast", astp, true, "print AST after parsing" }, 549 { "ex decl", exdeclp, true, "print AST after translating exception decls" },551 { "excpdecl", exdeclp, true, "print AST after translating exception decls" }, 550 552 { "symevt", symtabp, true, "print AST after symbol table events" }, 551 { " altexpr", expraltp, true, "print alternatives for expressions" },552 { " astdecl", validp, true, "print AST after declaration validation pass" },553 { " resolver", bresolvep, true, "print AST before resolver step" },554 { " astexpr", exprp, true, "print AST after expression analysis" },553 { "expralt", expraltp, true, "print AST after expressions alternatives" }, 554 { "valdecl", validp, true, "print AST after declaration validation pass" }, 555 { "bresolver", bresolvep, true, "print AST before resolver step" }, 556 { "expranly", exprp, true, "print AST after expression analysis" }, 555 557 { "ctordtor", ctorinitp, true, "print AST after ctor/dtor are replaced" }, 556 558 { "tuple", tuplep, true, "print AST after tuple expansion" }, 557 { " astgen", genericsp, true, "print AST after instantiate generics" },558 { "b ox", bboxp, true, "print AST before box step" },559 { " codegen", bcodegenp, true, "print AST before code generation" },559 { "instgen", genericsp, true, "print AST after instantiate generics" }, 560 { "bbox", bboxp, true, "print AST before box pass" }, 561 { "bcodegen", bcodegenp, true, "print AST before code generation" }, 560 562 }; 561 563 enum { printoptsSize = sizeof( printopts ) / sizeof( printopts[0] ) };
Note:
See TracChangeset
for help on using the changeset viewer.