Changes in src/AST/Convert.cpp [60aaa51d:6355ba7]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r60aaa51d r6355ba7 154 154 auto&& attr = get<Attribute>().acceptL( node->attributes ); 155 155 if ( inCache( node ) ) { 156 if(node->name == "tmp") {157 std::cerr << (void*)node << "(new) in cache " << (void*)this->node << "(old)" << std::endl;158 }159 156 return nullptr; 160 157 } … … 169 166 Type::FuncSpecifiers( node->funcSpec.val ) 170 167 ); 171 if(node->name == "tmp") {172 std::cerr << (void*)node << "(new) created " << (void*)decl << "(old)" << std::endl;173 }174 168 return declWithTypePostamble( decl, node ); 175 169 } … … 736 730 expr->var = get<DeclarationWithType>().accept1(node->var); 737 731 Type * type = expr->var->get_type()->clone(); 732 if(FunctionType * ft = dynamic_cast<FunctionType*>(type)) { 733 if(node->result.as<ast::PointerType>()) { 734 type = new PointerType({}, ft); 735 } 736 } 737 738 738 type->set_lvalue( true ); 739 expr-> set_result( type );739 expr->result = type ; 740 740 this->node = expr; 741 741 return nullptr; … … 783 783 assert (!rslt->isType); 784 784 } 785 if (node->type) { 785 else { 786 assert(node->type); 786 787 rslt = new SizeofExpr( 787 788 get<Type>().accept1(node->type) … … 804 805 assert (!rslt->isType); 805 806 } 806 if (node->type) { 807 else { 808 assert(node->type); 807 809 rslt = new AlignofExpr( 808 810 get<Type>().accept1(node->type) … … 1414 1416 # define GET_ACCEPT_V(child, type) \ 1415 1417 getAcceptV< ast::type, decltype( old->child ) >( old->child ) 1416 1418 1417 1419 template<typename NewT, typename OldC> 1418 1420 std::deque< ast::ptr<NewT> > getAcceptD( OldC& old ) { … … 1462 1464 1463 1465 virtual void visit( ObjectDecl * old ) override final { 1464 if( old->name == "tmp" ) {1465 std::cerr << "building parameters for" << (void*)old << std::endl;1466 }1467 1466 auto&& type = GET_ACCEPT_1(type, Type); 1468 1467 auto&& init = GET_ACCEPT_1(init, Init); 1469 1468 auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr); 1470 1469 auto&& attr = GET_ACCEPT_V(attributes, Attribute); 1471 if( old->name == "tmp" ) {1472 std::cerr << "checking cache for " << (void*)old << std::endl;1473 }1474 1470 if ( inCache( old ) ) { 1475 if( old->name == "tmp" ) {1476 std::cerr << (void*)old << "(old) in cache " << (void*)this->node << "(new)" << std::endl;1477 }1478 1471 return; 1479 1472 } … … 1490 1483 ); 1491 1484 cache.emplace(old, decl); 1492 if( old->name == "tmp" ) {1493 std::cerr << (void*)old << "(old) added to cache with " << (void*)decl << "(new)" << std::endl;1494 }1495 1485 assert(cache.find( old ) != cache.end()); 1496 1486 decl->scopeLevel = old->scopeLevel; … … 1501 1491 1502 1492 this->node = decl; 1503 1504 if( old->name == "tmp" ) {1505 std::cerr << (void*)old << "(old) created " << (void*)this->node << "(new)" << std::endl;1506 }1507 1493 } 1508 1494 … … 2164 2150 ); 2165 2151 2166 visitBaseExpr ( old,2152 visitBaseExpr_SkipResultType( old, 2167 2153 expr 2168 2154 ); … … 2170 2156 expr->var = GET_ACCEPT_1(var, DeclWithType); 2171 2157 expr->result = expr->var->get_type(); 2158 if(const ast::FunctionType * ft = expr->result.as<ast::FunctionType>()) { 2159 if(dynamic_cast<PointerType *>(old->result)) { 2160 expr->result = new ast::PointerType(ft); 2161 } 2162 } 2172 2163 add_qualifiers( expr->result, ast::CV::Lvalue ); 2173 2164 this->node = expr;
Note:
See TracChangeset
for help on using the changeset viewer.