Changes in src/AST/Convert.cpp [2c04369:d88f8b3b]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r2c04369 rd88f8b3b 10 10 // Created On : Thu May 09 15::37::05 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue May 28 12:00:00 201913 // Update Count : 712 // Last Modified On : Wed May 29 17:05:00 2019 13 // Update Count : 9 14 14 // 15 15 … … 25 25 #include "AST/TypeSubstitution.hpp" 26 26 27 #include "SymTab/Autogen.h" 27 28 #include "SynTree/Attribute.h" 28 29 #include "SynTree/Declaration.h" 29 30 #include "SynTree/TypeSubstitution.h" 31 32 #include "Validate/FindSpecialDecls.h" 30 33 31 34 //================================================================================================ … … 40 43 } 41 44 }; 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 } 42 54 43 55 //================================================================================================ … … 154 166 LinkageSpec::Spec( node->linkage.val ), 155 167 get<FunctionType>().accept1( node->type ), 156 get<CompoundStmt>().accept1( node->stmts ),168 {}, 157 169 get<Attribute>().acceptL( node->attributes ), 158 170 Type::FuncSpecifiers( node->funcSpec.val ) 159 171 ); 172 cache.emplace( node, decl ); 173 decl->statements = get<CompoundStmt>().accept1( node->stmts ); 160 174 decl->withExprs = get<Expression>().acceptL( node->withExprs ); 175 if ( dereferenceOperator == node ) { 176 Validate::dereferenceOperator = decl; 177 } 161 178 return declWithTypePostamble( decl, node ); 162 179 } … … 871 888 ); 872 889 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 877 890 auto expr = visitBaseExpr( node, rslt ); 878 891 this->node = expr; … … 1425 1438 old->name, 1426 1439 GET_ACCEPT_1(type, FunctionType), 1427 GET_ACCEPT_1(statements, CompoundStmt),1440 {}, 1428 1441 { old->storageClasses.val }, 1429 1442 { old->linkage.val }, … … 1432 1445 }; 1433 1446 cache.emplace( old, decl ); 1447 decl->stmts = GET_ACCEPT_1(statements, CompoundStmt); 1434 1448 decl->scopeLevel = old->scopeLevel; 1435 1449 decl->mangleName = old->mangleName; … … 1439 1453 1440 1454 this->node = decl; 1455 1456 if ( Validate::dereferenceOperator == old ) { 1457 dereferenceOperator = decl; 1458 } 1441 1459 } 1442 1460 … … 1484 1502 virtual void visit( EnumDecl * old ) override final { 1485 1503 if ( inCache( old ) ) return; 1486 auto decl = new ast:: UnionDecl(1504 auto decl = new ast::EnumDecl( 1487 1505 old->location, 1488 1506 old->name, … … 1504 1522 virtual void visit( TraitDecl * old ) override final { 1505 1523 if ( inCache( old ) ) return; 1506 auto decl = new ast:: UnionDecl(1524 auto decl = new ast::TraitDecl( 1507 1525 old->location, 1508 1526 old->name, … … 2265 2283 ); 2266 2284 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 2271 2285 this->node = visitBaseExpr( old, rslt ); 2272 2286 }
Note:
See TracChangeset
for help on using the changeset viewer.