Changes in src/AST/Convert.cpp [d88f8b3b:2c04369]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rd88f8b3b r2c04369 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 17:05:00 201913 // Update Count : 912 // 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 //================================================================================================ … … 43 40 } 44 41 }; 45 46 //================================================================================================47 namespace {48 49 // This is to preserve the SymTab::dereferenceOperator 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 53 }54 42 55 43 //================================================================================================ … … 166 154 LinkageSpec::Spec( node->linkage.val ), 167 155 get<FunctionType>().accept1( node->type ), 168 {},156 get<CompoundStmt>().accept1( node->stmts ), 169 157 get<Attribute>().acceptL( node->attributes ), 170 158 Type::FuncSpecifiers( node->funcSpec.val ) 171 159 ); 172 cache.emplace( node, decl );173 decl->statements = get<CompoundStmt>().accept1( node->stmts );174 160 decl->withExprs = get<Expression>().acceptL( node->withExprs ); 175 if ( dereferenceOperator == node ) {176 Validate::dereferenceOperator = decl;177 }178 161 return declWithTypePostamble( decl, node ); 179 162 } … … 888 871 ); 889 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 890 877 auto expr = visitBaseExpr( node, rslt ); 891 878 this->node = expr; … … 1438 1425 old->name, 1439 1426 GET_ACCEPT_1(type, FunctionType), 1440 {},1427 GET_ACCEPT_1(statements, CompoundStmt), 1441 1428 { old->storageClasses.val }, 1442 1429 { old->linkage.val }, … … 1445 1432 }; 1446 1433 cache.emplace( old, decl ); 1447 decl->stmts = GET_ACCEPT_1(statements, CompoundStmt);1448 1434 decl->scopeLevel = old->scopeLevel; 1449 1435 decl->mangleName = old->mangleName; … … 1453 1439 1454 1440 this->node = decl; 1455 1456 if ( Validate::dereferenceOperator == old ) {1457 dereferenceOperator = decl;1458 }1459 1441 } 1460 1442 … … 1502 1484 virtual void visit( EnumDecl * old ) override final { 1503 1485 if ( inCache( old ) ) return; 1504 auto decl = new ast:: EnumDecl(1486 auto decl = new ast::UnionDecl( 1505 1487 old->location, 1506 1488 old->name, … … 1522 1504 virtual void visit( TraitDecl * old ) override final { 1523 1505 if ( inCache( old ) ) return; 1524 auto decl = new ast:: TraitDecl(1506 auto decl = new ast::UnionDecl( 1525 1507 old->location, 1526 1508 old->name, … … 2283 2265 ); 2284 2266 2267 rslt->tempDecls = GET_ACCEPT_V(tempDecls, ObjectDecl); 2268 rslt->returnDecls = GET_ACCEPT_V(returnDecls, ObjectDecl); 2269 rslt->dtors = GET_ACCEPT_V(dtors, Expr); 2270 2285 2271 this->node = visitBaseExpr( old, rslt ); 2286 2272 }
Note:
See TracChangeset
for help on using the changeset viewer.