- Timestamp:
- Jun 6, 2019, 10:55:00 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 546e712
- Parents:
- dd857bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rdd857bb r2a54479 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 : Thu May 06 19:51:00 2019 13 // Update Count : 10 14 14 // 15 15 … … 49 49 // This is to preserve the FindSpecialDecls hack. It does not (and perhaps should not) 50 50 // allow us to use the same stratagy in the new ast. 51 ast::Type * sizeType = nullptr; 51 52 ast::FunctionDecl * dereferenceOperator = nullptr; 52 53 ast::StructDecl * dtorStruct = nullptr; … … 709 710 auto expr = visitBaseExpr( node, 710 711 new MemberExpr( 711 inCache(node->member) ? 712 dynamic_cast<DeclarationWithType *>(this->node) : 713 get<DeclarationWithType>().accept1(node->member), 712 get<DeclarationWithType>().accept1(node->member), 714 713 get<Expression>().accept1(node->aggregate) 715 714 ) … … 722 721 auto expr = visitBaseExpr( node, 723 722 new VariableExpr( 724 inCache(node->var) ? 725 dynamic_cast<DeclarationWithType *>(this->node) : 726 get<DeclarationWithType>().accept1(node->var) 723 get<DeclarationWithType>().accept1(node->var) 727 724 ) 728 725 ); … … 819 816 new OffsetofExpr( 820 817 get<Type>().accept1(node->type), 821 inCache(node->member) ? 822 dynamic_cast<DeclarationWithType *>(this->node) : 823 get<DeclarationWithType>().accept1(node->member) 818 get<DeclarationWithType>().accept1(node->member) 824 819 ) 825 820 ); … … 1082 1077 1083 1078 const ast::Type * visit( const ast::BasicType * node ) override final { 1084 this->node = new BasicType{ cv( node ), (BasicType::Kind)(unsigned)node->kind }; 1079 auto type = new BasicType{ cv( node ), (BasicType::Kind)(unsigned)node->kind }; 1080 // I believe this should always be a BasicType. 1081 if ( sizeType == node ) { 1082 Validate::SizeType = type; 1083 } 1084 this->node = type; 1085 1085 return nullptr; 1086 1086 } … … 2092 2092 new ast::MemberExpr( 2093 2093 old->location, 2094 inCache(old->member) ? 2095 dynamic_cast<ast::DeclWithType *>(this->node) : 2096 GET_ACCEPT_1(member, DeclWithType), 2094 GET_ACCEPT_1(member, DeclWithType), 2097 2095 GET_ACCEPT_1(aggregate, Expr) 2098 2096 ) … … 2104 2102 new ast::VariableExpr( 2105 2103 old->location, 2106 inCache(old->var) ? 2107 dynamic_cast<ast::DeclWithType *>(this->node) : 2108 GET_ACCEPT_1(var, DeclWithType) 2104 GET_ACCEPT_1(var, DeclWithType) 2109 2105 ) 2110 2106 ); … … 2234 2230 old->location, 2235 2231 GET_ACCEPT_1(type, Type), 2236 inCache(old->member) ? 2237 dynamic_cast<ast::DeclWithType *>(this->node) : 2238 GET_ACCEPT_1(member, DeclWithType) 2232 GET_ACCEPT_1(member, DeclWithType) 2239 2233 ) 2240 2234 ); … … 2472 2466 2473 2467 virtual void visit( BasicType * old ) override final { 2474 this->node = new ast::BasicType{ (ast::BasicType::Kind)(unsigned)old->kind, cv( old ) }; 2468 auto type = new ast::BasicType{ (ast::BasicType::Kind)(unsigned)old->kind, cv( old ) }; 2469 // I believe this should always be a BasicType. 2470 if ( Validate::SizeType == old ) { 2471 sizeType = type; 2472 } 2473 this->node = type; 2475 2474 } 2476 2475
Note: See TracChangeset
for help on using the changeset viewer.