Changeset cf3da24
- Timestamp:
- Oct 10, 2023, 11:42:38 AM (14 months ago)
- Branches:
- master
- Children:
- 4604bf5
- Parents:
- ee9ad40
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
ree9ad40 rcf3da24 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; … … 650 650 } 651 651 652 653 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 654 assert( !node ); 655 655 return nullptr; … … 859 859 // New workd: one public type: node->result, plus node->underlyer only to support roundtrip conversion 860 860 // preserving underlyer because the correct type for string literals is complicated to construct, 861 861 // and distinguishing a string from other literals using the type is hard to do accurately 862 862 // Both worlds: the outer, expression-level type can change during resolution 863 863 // for a string, that's char[k] before-resolve and char * after … … 865 865 // for a string, that's char[k] always 866 866 // Both worlds: the "rep" field of a constant is the C source file fragment that compiles to the desired value 867 867 // for a string, that includes outer quotes, backslashes, et al cases from the Literals test 868 868 ConstantExpr *rslt = new ConstantExpr(Constant( 869 869 get<Type>().accept1(node->underlyer), … … 1524 1524 return strict_dynamic_cast< ast::Decl * >( node ); 1525 1525 } 1526 1526 1527 1527 ConverterOldToNew() = default; 1528 1528 ConverterOldToNew(const ConverterOldToNew &) = delete; … … 1587 1587 ast::Label make_label(const Label* old) { 1588 1588 CodeLocation const & location = 1589 1589 ( old->labelled ) ? old->labelled->location : CodeLocation(); 1590 1590 return ast::Label( 1591 1591 location, … … 2246 2246 // TypeSubstitution shouldn't exist yet in old. 2247 2247 ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) { 2248 2249 2248 if (!old) return nullptr; 2250 2249 if (old->empty()) return nullptr; … … 2291 2290 ast::Expr * visitBaseExpr_SkipResultType( const Expression * old, ast::Expr * nw) { 2292 2291 2293 nw->env 2292 nw->env = convertTypeSubstitution(old->env); 2294 2293 2295 2294 nw->extension = old->extension; … … 2862 2861 2863 2862 virtual void visit( const EnumInstType * old ) override final { 2864 ast::EnumInstType * ty; 2863 ast::EnumInstType * ty; 2865 2864 if ( old->baseEnum ) { 2866 2865 ty = new ast::EnumInstType{ -
src/AST/Pass.hpp
ree9ad40 rcf3da24 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 173 const ast::Stmt * visit( const ast::CorunStmt * ) override final; 174 174 const ast::Expr * visit( const ast::ApplicationExpr * ) override final; 175 175 const ast::Expr * visit( const ast::UntypedExpr * ) override final; -
src/AST/Print.cpp
ree9ad40 rcf3da24 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 } … … 922 923 } 923 924 924 925 virtual const ast::Stmt * visit( const ast::CorunStmt * node ) override final { 925 926 os << "Corun Statement" << endl; 926 927 os << indent << "... with Statement: "; -
src/Concurrency/Corun.cpp
ree9ad40 rcf3da24 42 42 43 43 Stmt * postvisit( const CorunStmt * stmt ) { 44 if ( !runnerBlockDecl ) 44 if ( !runnerBlockDecl ) 45 45 SemanticError( stmt->location, "To use corun statements add #include <cofor.hfa>\n" ); 46 46 47 47 if ( !stmt->stmt ) 48 48 return nullptr; 49 49 50 50 const CodeLocation & loc = stmt->location; 51 51 const string fnName = CorunFnNamer.newName(); … … 76 76 // __CFA_corun_block_{ __CFA_corun_lambda_ }; 77 77 Stmt * threadStart = new ExprStmt( loc, 78 new UntypedExpr ( loc, 78 new UntypedExpr ( loc, 79 79 new NameExpr( loc, "?{}" ), 80 80 { -
src/Concurrency/Corun.hpp
ree9ad40 rcf3da24 16 16 #pragma once 17 17 18 19 class Declaration;20 18 namespace ast { 21 19 class TranslationUnit; -
src/main.cc
ree9ad40 rcf3da24 346 346 PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords, transUnit ); 347 347 PASS( "Fix Unique Ids", Validate::fixUniqueIds, transUnit ); 348 348 PASS( "Implement Corun", Concurrency::implementCorun, transUnit ); 349 349 PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls, transUnit ); 350 350
Note: See TracChangeset
for help on using the changeset viewer.