Changes in src/AST/Convert.cpp [043a5b6:d76c588]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r043a5b6 rd76c588 10 10 // Created On : Thu May 09 15::37::05 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed May 29 11:05:00 201913 // Update Count : 812 // Last Modified On : Tue May 28 12:00:00 2019 13 // Update Count : 7 14 14 // 15 15 … … 25 25 #include "AST/TypeSubstitution.hpp" 26 26 27 #include "SymTab/Autogen.h"28 27 #include "SynTree/Attribute.h" 29 28 #include "SynTree/Declaration.h" 30 29 #include "SynTree/TypeSubstitution.h" 31 32 #include "Validate/FindSpecialDecls.h"33 30 34 31 //================================================================================================ … … 45 42 46 43 //================================================================================================ 47 namespace {48 49 // This is to preserve the FindSpecialDecls hack. It does not (and perhaps should not)50 // allow us to use the same stratagy in the new ast.51 ast::FunctionDecl * dereferenceOperator = nullptr;52 ast::StructDecl * dtorStruct = nullptr;53 ast::FunctionDecl * dtorStructDestroy = nullptr;54 55 }56 57 //================================================================================================58 44 class ConverterNewToOld : public ast::Visitor { 59 45 BaseSyntaxNode * node = nullptr; … … 77 63 std::list< T * > acceptL( const U & container ) { 78 64 std::list< T * > ret; 79 for ( auto ptr : container ) {65 for ( auto ptr : container ) { 80 66 ret.emplace_back( accept1( ptr ) ); 81 67 } … … 173 159 ); 174 160 decl->withExprs = get<Expression>().acceptL( node->withExprs ); 175 if ( dereferenceOperator == node ) {176 Validate::dereferenceOperator = decl;177 }178 if ( dtorStructDestroy == node ) {179 Validate::dtorStructDestroy = decl;180 }181 161 return declWithTypePostamble( decl, node ); 182 162 } … … 234 214 LinkageSpec::Spec( node->linkage.val ) 235 215 ); 236 237 if ( dtorStruct == node ) {238 Validate::dtorStruct = decl;239 }240 241 216 return aggregatePostamble( decl, node ); 242 217 } … … 896 871 ); 897 872 873 rslt->tempDecls = get<ObjectDecl>().acceptL(node->tempDecls); 874 rslt->returnDecls = get<ObjectDecl>().acceptL(node->returnDecls); 875 rslt->dtors = get<Expression>().acceptL(node->dtors); 876 898 877 auto expr = visitBaseExpr( node, rslt ); 899 878 this->node = expr; … … 1453 1432 }; 1454 1433 cache.emplace( old, decl ); 1434 decl->withExprs = GET_ACCEPT_V(withExprs, Expr); 1455 1435 decl->scopeLevel = old->scopeLevel; 1456 1436 decl->mangleName = old->mangleName; … … 1460 1440 1461 1441 this->node = decl; 1462 1463 if ( Validate::dereferenceOperator == old ) {1464 dereferenceOperator = decl;1465 }1466 1467 if ( Validate::dtorStructDestroy == old ) {1468 dtorStructDestroy = decl;1469 }1470 1442 } 1471 1443 … … 1489 1461 1490 1462 this->node = decl; 1491 1492 if ( Validate::dtorStruct == old ) {1493 dtorStruct = decl;1494 }1495 1463 } 1496 1464 … … 1517 1485 virtual void visit( EnumDecl * old ) override final { 1518 1486 if ( inCache( old ) ) return; 1519 auto decl = new ast:: EnumDecl(1487 auto decl = new ast::UnionDecl( 1520 1488 old->location, 1521 1489 old->name, … … 1537 1505 virtual void visit( TraitDecl * old ) override final { 1538 1506 if ( inCache( old ) ) return; 1539 auto decl = new ast:: TraitDecl(1507 auto decl = new ast::UnionDecl( 1540 1508 old->location, 1541 1509 old->name, … … 2298 2266 ); 2299 2267 2268 rslt->tempDecls = GET_ACCEPT_V(tempDecls, ObjectDecl); 2269 rslt->returnDecls = GET_ACCEPT_V(returnDecls, ObjectDecl); 2270 rslt->dtors = GET_ACCEPT_V(dtors, Expr); 2271 2300 2272 this->node = visitBaseExpr( old, rslt ); 2301 2273 }
Note: See TracChangeset
for help on using the changeset viewer.