Changeset ef5ef56
- Timestamp:
- May 22, 2019, 5:21:44 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5902625, 893e106
- Parents:
- dff6452 (diff), 8abee136 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rdff6452 ref5ef56 1342 1342 }; 1343 1343 1344 std::list< Declaration * > convert( std::list< ast::ptr< ast::Decl > > && translationUnit ) {1344 std::list< Declaration * > convert( const 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;1350 1349 } 1351 1350 return decls; … … 1436 1435 { old->get_funcSpec().val } 1437 1436 ); 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 );1444 1443 1445 1444 this->node = decl; … … 1458 1457 { old->get_funcSpec().val } 1459 1458 }; 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 );1466 1465 1467 1466 this->node = decl; … … 1477 1476 { old->linkage.val } 1478 1477 ); 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 );1487 1486 1488 1487 this->node = decl; … … 1497 1496 { old->linkage.val } 1498 1497 ); 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 );1507 1506 1508 1507 this->node = decl; … … 1517 1516 { old->linkage.val } 1518 1517 ); 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 );1527 1526 1528 1527 this->node = decl; … … 1537 1536 { old->linkage.val } 1538 1537 ); 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 );1547 1546 1548 1547 this->node = decl; … … 1560 1559 GET_ACCEPT_1(init, Type) 1561 1560 }; 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 );1567 1566 1568 1567 this->node = decl; … … 1912 1911 ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) { 1913 1912 1913 if (!old) return nullptr; 1914 1914 1915 ast::TypeSubstitution *rslt = new ast::TypeSubstitution(); 1915 1916 … … 2703 2704 d->accept( c ); 2704 2705 decls.emplace_back( c.decl() ); 2705 delete d;2706 }2706 } 2707 deleteAll(translationUnit); 2707 2708 return decls; 2708 2709 } -
src/AST/Expr.cpp
rdff6452 ref5ef56 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
rdff6452 ref5ef56 115 115 template<typename o_node_t> 116 116 ptr_base & operator=( const o_node_t * node ) { 117 assign( strict_dynamic_cast<const node_t *>(node));117 assign( node ? strict_dynamic_cast<const node_t *>(node) : nullptr ); 118 118 return *this; 119 119 } -
src/Common/utility.h
rdff6452 ref5ef56 74 74 75 75 template< typename Container > 76 void deleteAll( Container &container ) {77 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i) {78 delete *i;76 void deleteAll( const Container &container ) { 77 for ( const auto &i : container ) { 78 delete i; 79 79 } // for 80 80 } -
src/include/cassert
rdff6452 ref5ef56 44 44 45 45 template<typename T, typename U> 46 static inline T strict_dynamic_cast( const U & src ) { 46 static inline __attribute__((nonnull)) T strict_dynamic_cast( const U & src ) { 47 assert(src); 47 48 T ret = dynamic_cast<T>(src); 48 49 assertf(ret, "%s", toString(src).c_str());
Note: See TracChangeset
for help on using the changeset viewer.