Changes in / [ef5ef56:dff6452]
- Location:
- src
- Files:
-
- 5 edited
-
AST/Convert.cpp (modified) (16 diffs)
-
AST/Expr.cpp (modified) (1 diff)
-
AST/Node.hpp (modified) (1 diff)
-
Common/utility.h (modified) (1 diff)
-
include/cassert (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
ref5ef56 rdff6452 1342 1342 }; 1343 1343 1344 std::list< Declaration * > convert( conststd::list< ast::ptr< ast::Decl > > && translationUnit ) {1344 std::list< Declaration * > convert( std::list< ast::ptr< ast::Decl > > && translationUnit ) { 1345 1345 ConverterNewToOld c; 1346 1346 std::list< Declaration * > decls; 1347 1347 for(auto d : translationUnit) { 1348 1348 decls.emplace_back( c.decl( d ) ); 1349 delete d; 1349 1350 } 1350 1351 return decls; … … 1435 1436 { old->get_funcSpec().val } 1436 1437 ); 1437 cache.emplace( old, decl );1438 1438 decl->scopeLevel = old->scopeLevel; 1439 1439 decl->mangleName = old->mangleName; … … 1441 1441 decl->uniqueId = old->uniqueId; 1442 1442 decl->extension = old->extension; 1443 cache.emplace( old, decl ); 1443 1444 1444 1445 this->node = decl; … … 1457 1458 { old->get_funcSpec().val } 1458 1459 }; 1459 cache.emplace( old, decl );1460 1460 decl->scopeLevel = old->scopeLevel; 1461 1461 decl->mangleName = old->mangleName; … … 1463 1463 decl->uniqueId = old->uniqueId; 1464 1464 decl->extension = old->extension; 1465 cache.emplace( old, decl ); 1465 1466 1466 1467 this->node = decl; … … 1476 1477 { old->linkage.val } 1477 1478 ); 1478 cache.emplace( old, decl );1479 1479 decl->parent = GET_ACCEPT_1(parent, AggregateDecl); 1480 1480 decl->body = old->body; … … 1484 1484 decl->uniqueId = old->uniqueId; 1485 1485 decl->storage = { old->storageClasses.val }; 1486 cache.emplace( old, decl ); 1486 1487 1487 1488 this->node = decl; … … 1496 1497 { old->linkage.val } 1497 1498 ); 1498 cache.emplace( old, decl );1499 1499 decl->parent = GET_ACCEPT_1(parent, AggregateDecl); 1500 1500 decl->body = old->body; … … 1504 1504 decl->uniqueId = old->uniqueId; 1505 1505 decl->storage = { old->storageClasses.val }; 1506 cache.emplace( old, decl ); 1506 1507 1507 1508 this->node = decl; … … 1516 1517 { old->linkage.val } 1517 1518 ); 1518 cache.emplace( old, decl );1519 1519 decl->parent = GET_ACCEPT_1(parent, AggregateDecl); 1520 1520 decl->body = old->body; … … 1524 1524 decl->uniqueId = old->uniqueId; 1525 1525 decl->storage = { old->storageClasses.val }; 1526 cache.emplace( old, decl ); 1526 1527 1527 1528 this->node = decl; … … 1536 1537 { old->linkage.val } 1537 1538 ); 1538 cache.emplace( old, decl );1539 1539 decl->parent = GET_ACCEPT_1(parent, AggregateDecl); 1540 1540 decl->body = old->body; … … 1544 1544 decl->uniqueId = old->uniqueId; 1545 1545 decl->storage = { old->storageClasses.val }; 1546 cache.emplace( old, decl ); 1546 1547 1547 1548 this->node = decl; … … 1559 1560 GET_ACCEPT_1(init, Type) 1560 1561 }; 1561 cache.emplace( old, decl );1562 1562 decl->assertions = GET_ACCEPT_V(assertions, DeclWithType); 1563 1563 decl->params = GET_ACCEPT_V(parameters, TypeDecl); 1564 1564 decl->extension = old->extension; 1565 1565 decl->uniqueId = old->uniqueId; 1566 cache.emplace( old, decl ); 1566 1567 1567 1568 this->node = decl; … … 1911 1912 ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) { 1912 1913 1913 if (!old) return nullptr;1914 1915 1914 ast::TypeSubstitution *rslt = new ast::TypeSubstitution(); 1916 1915 … … 2704 2703 d->accept( c ); 2705 2704 decls.emplace_back( c.decl() ); 2706 }2707 deleteAll(translationUnit);2705 delete d; 2706 } 2708 2707 return decls; 2709 2708 } -
src/AST/Expr.cpp
ref5ef56 rdff6452 157 157 assert( aggregate->result ); 158 158 159 //assert(!"unimplemented; need TypeSubstitution, genericSubstitution");159 assert(!"unimplemented; need TypeSubstitution, genericSubstitution"); 160 160 } 161 161 -
src/AST/Node.hpp
ref5ef56 rdff6452 115 115 template<typename o_node_t> 116 116 ptr_base & operator=( const o_node_t * node ) { 117 assign( node ? strict_dynamic_cast<const node_t *>(node) : nullptr);117 assign(strict_dynamic_cast<const node_t *>(node)); 118 118 return *this; 119 119 } -
src/Common/utility.h
ref5ef56 rdff6452 74 74 75 75 template< typename Container > 76 void deleteAll( constContainer &container ) {77 for ( const auto &i : container) {78 delete i;76 void deleteAll( Container &container ) { 77 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 78 delete *i; 79 79 } // for 80 80 } -
src/include/cassert
ref5ef56 rdff6452 44 44 45 45 template<typename T, typename U> 46 static inline __attribute__((nonnull)) T strict_dynamic_cast( const U & src ) { 47 assert(src); 46 static inline T strict_dynamic_cast( const U & src ) { 48 47 T ret = dynamic_cast<T>(src); 49 48 assertf(ret, "%s", toString(src).c_str());
Note:
See TracChangeset
for help on using the changeset viewer.