Changes in / [4ae2364:f474e91]
- Location:
- src
- Files:
-
- 6 edited
-
AST/Convert.cpp (modified) (5 diffs)
-
AST/Node.hpp (modified) (3 diffs)
-
AST/Type.hpp (modified) (1 diff)
-
AST/TypeSubstitution.cpp (modified) (2 diffs)
-
Validate/FindSpecialDecls.cc (modified) (1 diff)
-
include/cassert (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r4ae2364 rf474e91 47 47 namespace { 48 48 49 // This is to preserve the FindSpecialDeclshack. It does not (and perhaps should not)49 // This is to preserve the SymTab::dereferenceOperator hack. It does not (and perhaps should not) 50 50 // allow us to use the same stratagy in the new ast. 51 51 ast::FunctionDecl * dereferenceOperator = nullptr; 52 ast::StructDecl * dtorStruct = nullptr;53 ast::FunctionDecl * dtorStructDestroy = nullptr;54 52 55 53 } … … 178 176 Validate::dereferenceOperator = decl; 179 177 } 180 if ( dtorStructDestroy == node ) {181 Validate::dtorStructDestroy = decl;182 }183 178 return declWithTypePostamble( decl, node ); 184 179 } … … 236 231 LinkageSpec::Spec( node->linkage.val ) 237 232 ); 238 239 if ( dtorStruct == node ) {240 Validate::dtorStruct = decl;241 }242 243 233 return aggregatePostamble( decl, node ); 244 234 } … … 1468 1458 dereferenceOperator = decl; 1469 1459 } 1470 1471 if ( Validate::dtorStructDestroy == old ) {1472 dtorStructDestroy = decl;1473 }1474 1460 } 1475 1461 … … 1493 1479 1494 1480 this->node = decl; 1495 1496 if ( Validate::dtorStruct == old ) {1497 dtorStruct = decl;1498 }1499 1481 } 1500 1482 -
src/AST/Node.hpp
r4ae2364 rf474e91 10 10 // Created On : Wed May 8 10:27:04 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 3 13:26:00 201913 // Update Count : 512 // Last Modified On : Thu May 23 16:00:00 2019 13 // Update Count : 4 14 14 // 15 15 … … 107 107 ptr_base() : node(nullptr) {} 108 108 ptr_base( const node_t * n ) : node(n) { if( node ) _inc(node); } 109 ~ptr_base() { if( node ) { auto tmp = node; node = nullptr; _dec(tmp); }}109 ~ptr_base() { if( node ) _dec(node); } 110 110 111 111 ptr_base( const ptr_base & o ) : node(o.node) { … … 127 127 template<typename o_node_t> 128 128 ptr_base & operator=( const o_node_t * node ) { 129 assign( strict_dynamic_cast<const node_t *, nullptr>(node));129 assign( node ? strict_dynamic_cast<const node_t *>(node) : nullptr ); 130 130 return *this; 131 131 } -
src/AST/Type.hpp
r4ae2364 rf474e91 48 48 49 49 Type * set_const( bool v ) { qualifiers.is_const = v; return this; } 50 Type * set_volatile( bool v ) { qualifiers.is_volatile = v; return this; }51 50 Type * set_restrict( bool v ) { qualifiers.is_restrict = v; return this; } 52 51 Type * set_lvalue( bool v ) { qualifiers.is_lvalue = v; return this; } -
src/AST/TypeSubstitution.cpp
r4ae2364 rf474e91 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 3 13:26:00201713 // Update Count : 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 15:54:35 2017 13 // Update Count : 4 14 14 // 15 15 … … 26 26 } 27 27 28 TypeSubstitution::~TypeSubstitution() {} 28 TypeSubstitution::~TypeSubstitution() { 29 for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) { 30 delete( i->second ); 31 } 32 for ( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) { 33 delete( i->second ); 34 } 35 } 29 36 30 37 TypeSubstitution &TypeSubstitution::operator=( const TypeSubstitution &other ) { -
src/Validate/FindSpecialDecls.cc
r4ae2364 rf474e91 26 26 namespace Validate { 27 27 Type * SizeType = nullptr; 28 FunctionDecl * dereferenceOperator = nullptr;29 StructDecl * dtorStruct = nullptr;30 FunctionDecl * dtorStructDestroy = nullptr;28 FunctionDecl * dereferenceOperator = nullptr; 29 StructDecl * dtorStruct = nullptr; 30 FunctionDecl * dtorStructDestroy = nullptr; 31 31 32 32 namespace { -
src/include/cassert
r4ae2364 rf474e91 10 10 // Created On : Thu Aug 18 13:19:26 2016 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 3 13:11:00 201713 // Update Count : 1 812 // Last Modified On : Thu May 23 15:30:00 2017 13 // Update Count : 17 14 14 // 15 15 … … 43 43 #endif 44 44 45 template<typename T, typename U> 45 enum StrictAllowNull {NonNull, AllowNull}; 46 47 template<typename T, StrictAllowNull nullable = NonNull, typename U> 46 48 static inline T strict_dynamic_cast( const U & src ) { 49 if (nullable == AllowNull && src == nullptr) { 50 return nullptr; 51 } 47 52 assert(src); 48 53 T ret = dynamic_cast<T>(src); 49 54 assertf(ret, "%s", toString(src).c_str()); 50 55 return ret; 51 }52 53 template<typename T, decltype(nullptr) null, typename U>54 static inline T strict_dynamic_cast( const U & src ) {55 return src ? strict_dynamic_cast<T, U>( src ) : nullptr;56 56 } 57 57
Note:
See TracChangeset
for help on using the changeset viewer.