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