Changeset 8cbe732 for src/AST/Convert.cpp
- 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. - File:
-
- 1 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{
Note:
See TracChangeset
for help on using the changeset viewer.