Changeset e0115286 for src/AST/Decl.hpp
- Timestamp:
- May 10, 2019, 3:00:41 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:
- 2a5e8a6
- Parents:
- 1f93c2c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r1f93c2c re0115286 122 122 std::vector<ptr<DeclWithType>> assertions; 123 123 124 NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 124 NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 125 125 Type* b, Linkage::Spec spec = Linkage::Cforall ) 126 126 : Decl( loc, name, storage, spec ), base( b ), parameters(), assertions() {} … … 149 149 Data( TypeDecl* d ) : kind( d->kind ), isComplete( d->sized ) {} 150 150 Data( Kind k, bool c ) : kind( k ), isComplete( c ) {} 151 Data( const Data& d1, const Data& d2 ) 151 Data( const Data& d1, const Data& d2 ) 152 152 : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {} 153 153 … … 158 158 }; 159 159 160 TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b, 160 TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b, 161 161 Kind k, bool s, Type* i = nullptr ) 162 162 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == Ttype || s ), init( i ) {} … … 174 174 class TypedefDecl final : public NamedTypeDecl { 175 175 public: 176 TypedefDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 176 TypedefDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 177 177 Type* b, Linkage::Spec spec = Linkage::Cforall ) 178 178 : NamedTypeDecl( loc, name, storage, b, spec ) {} … … 275 275 }; 276 276 277 278 //================================================================================================= 279 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency 280 /// remove only if there is a better solution 281 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with 282 /// forward declarations 283 inline void increment( const class Decl * node, Node::ref_type ref ) { node->increment(ref); } 284 inline void decrement( const class Decl * node, Node::ref_type ref ) { node->decrement(ref); } 285 inline void increment( const class DeclWithType * node, Node::ref_type ref ) { node->increment(ref); } 286 inline void decrement( const class DeclWithType * node, Node::ref_type ref ) { node->decrement(ref); } 287 inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); } 288 inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); } 289 inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); } 290 inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); } 291 inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); } 292 inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); } 293 inline void increment( const class StructDecl * node, Node::ref_type ref ) { node->increment(ref); } 294 inline void decrement( const class StructDecl * node, Node::ref_type ref ) { node->decrement(ref); } 295 inline void increment( const class UnionDecl * node, Node::ref_type ref ) { node->increment(ref); } 296 inline void decrement( const class UnionDecl * node, Node::ref_type ref ) { node->decrement(ref); } 297 inline void increment( const class EnumDecl * node, Node::ref_type ref ) { node->increment(ref); } 298 inline void decrement( const class EnumDecl * node, Node::ref_type ref ) { node->decrement(ref); } 299 inline void increment( const class TraitDecl * node, Node::ref_type ref ) { node->increment(ref); } 300 inline void decrement( const class TraitDecl * node, Node::ref_type ref ) { node->decrement(ref); } 301 inline void increment( const class NamedTypeDecl * node, Node::ref_type ref ) { node->increment(ref); } 302 inline void decrement( const class NamedTypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } 303 inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); } 304 inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } 305 inline void increment( const class FtypeDecl * node, Node::ref_type ref ) { node->increment(ref); } 306 inline void decrement( const class FtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } 307 inline void increment( const class DtypeDecl * node, Node::ref_type ref ) { node->increment(ref); } 308 inline void decrement( const class DtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } 309 inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); } 310 inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); } 311 inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); } 312 inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); } 313 inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); } 314 inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); } 315 277 316 } 278 317
Note: See TracChangeset
for help on using the changeset viewer.