Changes in src/AST/Decl.hpp [e0115286:360b2e13]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
re0115286 r360b2e13 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 dependency280 /// remove only if there is a better solution281 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with282 /// forward declarations283 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 316 277 } 317 278
Note:
See TracChangeset
for help on using the changeset viewer.