[2bb4a01] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
| 7 | // Decl.hpp -- |
---|
| 8 | // |
---|
| 9 | // Author : Aaron B. Moss |
---|
| 10 | // Created On : Thu May 9 10:00:00 2019 |
---|
| 11 | // Last Modified By : Aaron B. Moss |
---|
| 12 | // Last Modified On : Thu May 9 10:00:00 2019 |
---|
| 13 | // Update Count : 1 |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
[a300e4a] | 18 | #include <string> // for string, to_string |
---|
| 19 | #include <unordered_map> |
---|
[2bb4a01] | 20 | #include <vector> |
---|
| 21 | |
---|
[a300e4a] | 22 | #include "FunctionSpec.hpp" |
---|
[2bb4a01] | 23 | #include "Fwd.hpp" // for UniqueId |
---|
| 24 | #include "LinkageSpec.hpp" |
---|
| 25 | #include "Node.hpp" // for ptr, readonly |
---|
| 26 | #include "ParseNode.hpp" |
---|
| 27 | #include "StorageClasses.hpp" |
---|
[9e1d485] | 28 | #include "TypeVar.hpp" |
---|
[2bb4a01] | 29 | #include "Visitor.hpp" |
---|
[a300e4a] | 30 | #include "Parser/ParseNode.h" // for DeclarationNode::Aggregate |
---|
[2bb4a01] | 31 | |
---|
| 32 | namespace ast { |
---|
[a300e4a] | 33 | |
---|
[2bb4a01] | 34 | class Attribute; |
---|
| 35 | class Expr; |
---|
[77a3f41] | 36 | class Init; |
---|
[a300e4a] | 37 | class TypeDecl; |
---|
[2bb4a01] | 38 | |
---|
| 39 | /// Base declaration class |
---|
| 40 | class Decl : public ParseNode { |
---|
| 41 | public: |
---|
| 42 | std::string name; |
---|
| 43 | Storage::Classes storage; |
---|
| 44 | Linkage::Spec linkage; |
---|
| 45 | UniqueId uniqueId = 0; |
---|
| 46 | bool extension = false; |
---|
| 47 | |
---|
[14cebb7a] | 48 | Decl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, |
---|
[2bb4a01] | 49 | Linkage::Spec linkage ) |
---|
| 50 | : ParseNode( loc ), name( name ), storage( storage ), linkage( linkage ) {} |
---|
| 51 | |
---|
| 52 | Decl* set_extension( bool ex ) { extension = ex; return this; } |
---|
| 53 | |
---|
| 54 | /// Ensures this node has a unique ID |
---|
| 55 | void fixUniqueId(); |
---|
| 56 | /// Get canonical declaration for unique ID |
---|
| 57 | static readonly<Decl> fromId( UniqueId id ); |
---|
| 58 | |
---|
[23f99e1] | 59 | const Decl * accept( Visitor & v ) const override = 0; |
---|
[2bb4a01] | 60 | private: |
---|
[23f99e1] | 61 | Decl * clone() const override = 0; |
---|
[2bb4a01] | 62 | }; |
---|
| 63 | |
---|
| 64 | /// Typed declaration base class |
---|
| 65 | class DeclWithType : public Decl { |
---|
| 66 | public: |
---|
| 67 | /// Represents the type with all types and typedefs expanded. |
---|
| 68 | /// This field is generated by SymTab::Validate::Pass2 |
---|
| 69 | std::string mangleName; |
---|
[14cebb7a] | 70 | /// Stores the scope level at which the variable was declared. |
---|
[2bb4a01] | 71 | /// Used to access shadowed identifiers. |
---|
| 72 | int scopeLevel = 0; |
---|
| 73 | |
---|
| 74 | std::vector<ptr<Attribute>> attributes; |
---|
[a300e4a] | 75 | Function::Specs funcSpec; |
---|
[2bb4a01] | 76 | ptr<Expr> asmName; |
---|
| 77 | bool isDeleted = false; |
---|
| 78 | |
---|
[14cebb7a] | 79 | DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage, |
---|
[2bb4a01] | 80 | Linkage::Spec linkage, std::vector<ptr<Attribute>>&& attrs, Function::Specs fs ) |
---|
[14cebb7a] | 81 | : Decl( loc, name, storage, linkage ), mangleName(), attributes( std::move(attrs) ), |
---|
[a300e4a] | 82 | funcSpec(fs), asmName() {} |
---|
[14cebb7a] | 83 | |
---|
[a300e4a] | 84 | std::string scopedMangleName() const { return mangleName + "_" + std::to_string(scopeLevel); } |
---|
| 85 | |
---|
| 86 | /// Get type of this declaration. May be generated by subclass |
---|
[6d51bd7] | 87 | virtual const Type * get_type() const = 0; |
---|
[a300e4a] | 88 | /// Set type of this declaration. May be verified by subclass |
---|
[23f99e1] | 89 | virtual void set_type(Type *) = 0; |
---|
[a300e4a] | 90 | |
---|
[23f99e1] | 91 | const DeclWithType * accept( Visitor & v ) const override = 0; |
---|
[a300e4a] | 92 | private: |
---|
[23f99e1] | 93 | DeclWithType * clone() const override = 0; |
---|
[a300e4a] | 94 | }; |
---|
| 95 | |
---|
[77a3f41] | 96 | /// Object declaration `Foo foo = 42;` |
---|
| 97 | class ObjectDecl final : public DeclWithType { |
---|
| 98 | public: |
---|
| 99 | ptr<Type> type; |
---|
| 100 | ptr<Init> init; |
---|
| 101 | ptr<Expr> bitfieldWidth; |
---|
| 102 | |
---|
| 103 | ObjectDecl( const CodeLocation& loc, const std::string& name, Type* type, Init* init = nullptr, |
---|
[14cebb7a] | 104 | Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C, Expr* bitWd = nullptr, |
---|
[77a3f41] | 105 | std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {}) |
---|
[14cebb7a] | 106 | : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ), |
---|
[77a3f41] | 107 | init( init ), bitfieldWidth( bitWd ) {} |
---|
[14cebb7a] | 108 | |
---|
[77a3f41] | 109 | const Type* get_type() const override { return type; } |
---|
[23f99e1] | 110 | void set_type( Type * ty ) override { type = ty; } |
---|
[77a3f41] | 111 | |
---|
[23f99e1] | 112 | const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); } |
---|
[77a3f41] | 113 | private: |
---|
[23f99e1] | 114 | ObjectDecl * clone() const override { return new ObjectDecl{ *this }; } |
---|
| 115 | |
---|
| 116 | /// Must be copied in ALL derived classes |
---|
| 117 | template<typename node_t> |
---|
| 118 | friend auto mutate(const node_t * node); |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | class FunctionDecl : public DeclWithType { |
---|
| 122 | public: |
---|
| 123 | ptr<FunctionType> type; |
---|
| 124 | ptr<CompoundStmt> stmts; |
---|
| 125 | std::list< ptr<Expr> > withExprs; |
---|
| 126 | |
---|
| 127 | FunctionDecl( const CodeLocation & loc, const std::string &name, FunctionType * type, |
---|
| 128 | CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C, |
---|
| 129 | std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {}) |
---|
| 130 | : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ), |
---|
| 131 | stmts( stmts ) {} |
---|
| 132 | |
---|
| 133 | const Type * get_type() const override { return type.get(); } |
---|
| 134 | void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); } |
---|
| 135 | |
---|
| 136 | bool has_body() const { return stmts; } |
---|
| 137 | |
---|
| 138 | const DeclWithType * accept( Visitor &v ) const override { return v.visit( this ); } |
---|
| 139 | private: |
---|
| 140 | FunctionDecl * clone() const override { return new FunctionDecl( *this ); } |
---|
[6d51bd7] | 141 | |
---|
| 142 | /// Must be copied in ALL derived classes |
---|
| 143 | template<typename node_t> |
---|
| 144 | friend auto mutate(const node_t * node); |
---|
[77a3f41] | 145 | }; |
---|
| 146 | |
---|
[360b2e13] | 147 | /// Base class for named type aliases |
---|
| 148 | class NamedTypeDecl : public Decl { |
---|
| 149 | public: |
---|
| 150 | ptr<Type> base; |
---|
| 151 | std::vector<ptr<TypeDecl>> parameters; |
---|
| 152 | std::vector<ptr<DeclWithType>> assertions; |
---|
| 153 | |
---|
[e0115286] | 154 | NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, |
---|
[360b2e13] | 155 | Type* b, Linkage::Spec spec = Linkage::Cforall ) |
---|
| 156 | : Decl( loc, name, storage, spec ), base( b ), parameters(), assertions() {} |
---|
| 157 | |
---|
| 158 | /// Produces a name for the kind of alias |
---|
| 159 | virtual std::string typeString() const = 0; |
---|
| 160 | |
---|
| 161 | private: |
---|
| 162 | NamedTypeDecl* clone() const override = 0; |
---|
| 163 | }; |
---|
| 164 | |
---|
| 165 | /// Cforall type variable: `dtype T` |
---|
| 166 | class TypeDecl final : public NamedTypeDecl { |
---|
| 167 | public: |
---|
[9e1d485] | 168 | TypeVar::Kind kind; |
---|
[360b2e13] | 169 | bool sized; |
---|
| 170 | ptr<Type> init; |
---|
| 171 | |
---|
| 172 | /// Data extracted from a type decl |
---|
| 173 | struct Data { |
---|
[9e1d485] | 174 | TypeVar::Kind kind; |
---|
[360b2e13] | 175 | bool isComplete; |
---|
| 176 | |
---|
[9e1d485] | 177 | Data() : kind( (TypeVar::Kind)-1 ), isComplete( false ) {} |
---|
[360b2e13] | 178 | Data( TypeDecl* d ) : kind( d->kind ), isComplete( d->sized ) {} |
---|
[9e1d485] | 179 | Data( TypeVar::Kind k, bool c ) : kind( k ), isComplete( c ) {} |
---|
[e0115286] | 180 | Data( const Data& d1, const Data& d2 ) |
---|
[360b2e13] | 181 | : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {} |
---|
| 182 | |
---|
| 183 | bool operator== ( const Data& o ) const { |
---|
| 184 | return kind == o.kind && isComplete == o.isComplete; |
---|
| 185 | } |
---|
| 186 | bool operator!= ( const Data& o ) const { return !(*this == o); } |
---|
| 187 | }; |
---|
| 188 | |
---|
[e0115286] | 189 | TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b, |
---|
[9e1d485] | 190 | TypeVar::Kind k, bool s, Type* i = nullptr ) |
---|
| 191 | : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ), |
---|
| 192 | init( i ) {} |
---|
[360b2e13] | 193 | |
---|
| 194 | std::string typeString() const override; |
---|
| 195 | /// Produces a name for generated code |
---|
| 196 | std::string genTypeString() const; |
---|
| 197 | |
---|
[9e1d485] | 198 | /// convenience accessor to match Type::isComplete() |
---|
| 199 | bool isComplete() { return sized; } |
---|
| 200 | |
---|
[23f99e1] | 201 | const Decl * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[360b2e13] | 202 | private: |
---|
[23f99e1] | 203 | TypeDecl * clone() const override { return new TypeDecl{ *this }; } |
---|
| 204 | |
---|
| 205 | /// Must be copied in ALL derived classes |
---|
| 206 | template<typename node_t> |
---|
| 207 | friend auto mutate(const node_t * node); |
---|
[360b2e13] | 208 | }; |
---|
| 209 | |
---|
| 210 | /// C-style typedef `typedef Foo Bar` |
---|
| 211 | class TypedefDecl final : public NamedTypeDecl { |
---|
| 212 | public: |
---|
[e0115286] | 213 | TypedefDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, |
---|
[360b2e13] | 214 | Type* b, Linkage::Spec spec = Linkage::Cforall ) |
---|
| 215 | : NamedTypeDecl( loc, name, storage, b, spec ) {} |
---|
| 216 | |
---|
| 217 | std::string typeString() const override { return "typedef"; } |
---|
| 218 | |
---|
[23f99e1] | 219 | const Decl * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[360b2e13] | 220 | private: |
---|
[23f99e1] | 221 | TypedefDecl * clone() const override { return new TypedefDecl{ *this }; } |
---|
| 222 | |
---|
| 223 | /// Must be copied in ALL derived classes |
---|
| 224 | template<typename node_t> |
---|
| 225 | friend auto mutate(const node_t * node); |
---|
[360b2e13] | 226 | }; |
---|
| 227 | |
---|
[a300e4a] | 228 | /// Aggregate type declaration base class |
---|
| 229 | class AggregateDecl : public Decl { |
---|
| 230 | public: |
---|
| 231 | std::vector<ptr<Decl>> members; |
---|
| 232 | std::vector<ptr<TypeDecl>> parameters; |
---|
| 233 | std::vector<ptr<Attribute>> attributes; |
---|
| 234 | bool body = false; |
---|
| 235 | readonly<AggregateDecl> parent = {}; |
---|
| 236 | |
---|
[14cebb7a] | 237 | AggregateDecl( const CodeLocation& loc, const std::string& name, |
---|
[a300e4a] | 238 | std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) |
---|
[14cebb7a] | 239 | : Decl( loc, name, Storage::Classes{}, linkage ), members(), parameters(), |
---|
[a300e4a] | 240 | attributes( std::move(attrs) ) {} |
---|
[14cebb7a] | 241 | |
---|
[a300e4a] | 242 | AggregateDecl* set_body( bool b ) { body = b; return this; } |
---|
| 243 | |
---|
| 244 | protected: |
---|
| 245 | /// Produces a name for the kind of aggregate |
---|
| 246 | virtual std::string typeString() const = 0; |
---|
| 247 | }; |
---|
| 248 | |
---|
| 249 | /// struct declaration `struct Foo { ... };` |
---|
| 250 | class StructDecl final : public AggregateDecl { |
---|
| 251 | public: |
---|
| 252 | DeclarationNode::Aggregate kind; |
---|
| 253 | |
---|
[14cebb7a] | 254 | StructDecl( const CodeLocation& loc, const std::string& name, |
---|
| 255 | DeclarationNode::Aggregate kind = DeclarationNode::Struct, |
---|
[a300e4a] | 256 | std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) |
---|
| 257 | : AggregateDecl( loc, name, std::move(attrs), linkage ), kind( kind ) {} |
---|
| 258 | |
---|
| 259 | bool is_coroutine() { return kind == DeclarationNode::Coroutine; } |
---|
| 260 | bool is_monitor() { return kind == DeclarationNode::Monitor; } |
---|
| 261 | bool is_thread() { return kind == DeclarationNode::Thread; } |
---|
| 262 | |
---|
[23f99e1] | 263 | const Decl * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[a300e4a] | 264 | private: |
---|
[23f99e1] | 265 | StructDecl * clone() const override { return new StructDecl{ *this }; } |
---|
| 266 | |
---|
| 267 | /// Must be copied in ALL derived classes |
---|
| 268 | template<typename node_t> |
---|
| 269 | friend auto mutate(const node_t * node); |
---|
[a300e4a] | 270 | |
---|
| 271 | std::string typeString() const override { return "struct"; } |
---|
| 272 | }; |
---|
| 273 | |
---|
| 274 | /// union declaration `union Foo { ... };` |
---|
| 275 | class UnionDecl final : public AggregateDecl { |
---|
| 276 | public: |
---|
[14cebb7a] | 277 | UnionDecl( const CodeLocation& loc, const std::string& name, |
---|
[a300e4a] | 278 | std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) |
---|
| 279 | : AggregateDecl( loc, name, std::move(attrs), linkage ) {} |
---|
| 280 | |
---|
[23f99e1] | 281 | const Decl * accept( Visitor& v ) const override { return v.visit( this ); } |
---|
[a300e4a] | 282 | private: |
---|
[23f99e1] | 283 | UnionDecl * clone() const override { return new UnionDecl{ *this }; } |
---|
| 284 | |
---|
| 285 | /// Must be copied in ALL derived classes |
---|
| 286 | template<typename node_t> |
---|
| 287 | friend auto mutate(const node_t * node); |
---|
[a300e4a] | 288 | |
---|
| 289 | std::string typeString() const override { return "union"; } |
---|
| 290 | }; |
---|
| 291 | |
---|
| 292 | /// enum declaration `enum Foo { ... };` |
---|
| 293 | class EnumDecl final : public AggregateDecl { |
---|
| 294 | public: |
---|
[14cebb7a] | 295 | EnumDecl( const CodeLocation& loc, const std::string& name, |
---|
[a300e4a] | 296 | std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) |
---|
| 297 | : AggregateDecl( loc, name, std::move(attrs), linkage ), enumValues() {} |
---|
| 298 | |
---|
| 299 | /// gets the integer value for this enumerator, returning true iff value found |
---|
| 300 | bool valueOf( Decl* enumerator, long long& value ) const; |
---|
| 301 | |
---|
[23f99e1] | 302 | const Decl * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[a300e4a] | 303 | private: |
---|
[23f99e1] | 304 | EnumDecl * clone() const override { return new EnumDecl{ *this }; } |
---|
| 305 | |
---|
| 306 | /// Must be copied in ALL derived classes |
---|
| 307 | template<typename node_t> |
---|
| 308 | friend auto mutate(const node_t * node); |
---|
[a300e4a] | 309 | |
---|
| 310 | std::string typeString() const override { return "enum"; } |
---|
| 311 | |
---|
| 312 | /// Map from names to enumerator values; kept private for lazy initialization |
---|
| 313 | mutable std::unordered_map< std::string, long long > enumValues; |
---|
| 314 | }; |
---|
| 315 | |
---|
| 316 | /// trait declaration `trait Foo( ... ) { ... };` |
---|
| 317 | class TraitDecl final : public AggregateDecl { |
---|
| 318 | public: |
---|
[14cebb7a] | 319 | TraitDecl( const CodeLocation& loc, const std::string& name, |
---|
[a300e4a] | 320 | std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) |
---|
| 321 | : AggregateDecl( loc, name, std::move(attrs), linkage ) {} |
---|
| 322 | |
---|
[23f99e1] | 323 | const Decl * accept( Visitor & v ) const override { return v.visit( this ); } |
---|
[a300e4a] | 324 | private: |
---|
[23f99e1] | 325 | TraitDecl * clone() const override { return new TraitDecl{ *this }; } |
---|
| 326 | |
---|
| 327 | /// Must be copied in ALL derived classes |
---|
| 328 | template<typename node_t> |
---|
| 329 | friend auto mutate(const node_t * node); |
---|
[a300e4a] | 330 | |
---|
| 331 | std::string typeString() const override { return "trait"; } |
---|
[2bb4a01] | 332 | }; |
---|
| 333 | |
---|
[23f99e1] | 334 | class AsmDecl : public Decl { |
---|
| 335 | public: |
---|
| 336 | ptr<AsmStmt> stmt; |
---|
| 337 | |
---|
| 338 | AsmDecl( const CodeLocation & loc, AsmStmt *stmt ) |
---|
| 339 | : Decl( loc, "", {}, {} ), stmt(stmt) {} |
---|
| 340 | |
---|
| 341 | const AsmDecl * accept( Visitor &v ) const override { return v.visit( this ); } |
---|
| 342 | private: |
---|
| 343 | AsmDecl *clone() const override { return new AsmDecl( *this ); } |
---|
| 344 | |
---|
| 345 | /// Must be copied in ALL derived classes |
---|
| 346 | template<typename node_t> |
---|
| 347 | friend auto mutate(const node_t * node); |
---|
| 348 | }; |
---|
| 349 | |
---|
| 350 | class StaticAssertDecl : public Decl { |
---|
| 351 | public: |
---|
| 352 | ptr<Expr> condition; |
---|
| 353 | ptr<ConstantExpr> msg; // string literal |
---|
| 354 | |
---|
| 355 | StaticAssertDecl( const CodeLocation & loc, const Expr * condition, const ConstantExpr * msg ) |
---|
| 356 | : Decl( loc, "", {}, {} ), condition( condition ), msg( msg ) {} |
---|
| 357 | |
---|
| 358 | const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); } |
---|
| 359 | private: |
---|
| 360 | StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); } |
---|
| 361 | |
---|
| 362 | /// Must be copied in ALL derived classes |
---|
| 363 | template<typename node_t> |
---|
| 364 | friend auto mutate(const node_t * node); |
---|
| 365 | }; |
---|
[e0115286] | 366 | |
---|
| 367 | //================================================================================================= |
---|
| 368 | /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency |
---|
| 369 | /// remove only if there is a better solution |
---|
| 370 | /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with |
---|
| 371 | /// forward declarations |
---|
| 372 | inline void increment( const class Decl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 373 | inline void decrement( const class Decl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 374 | inline void increment( const class DeclWithType * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 375 | inline void decrement( const class DeclWithType * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 376 | inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 377 | inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
[23f99e1] | 378 | inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 379 | inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
[e0115286] | 380 | inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 381 | inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 382 | inline void increment( const class StructDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 383 | inline void decrement( const class StructDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 384 | inline void increment( const class UnionDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 385 | inline void decrement( const class UnionDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 386 | inline void increment( const class EnumDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 387 | inline void decrement( const class EnumDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 388 | inline void increment( const class TraitDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 389 | inline void decrement( const class TraitDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 390 | inline void increment( const class NamedTypeDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 391 | inline void decrement( const class NamedTypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 392 | inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 393 | inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 394 | inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 395 | inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
[23f99e1] | 396 | inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 397 | inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
| 398 | inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); } |
---|
| 399 | inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); } |
---|
[e0115286] | 400 | |
---|
[2bb4a01] | 401 | } |
---|
| 402 | |
---|
| 403 | // Local Variables: // |
---|
| 404 | // tab-width: 4 // |
---|
| 405 | // mode: c++ // |
---|
| 406 | // compile-command: "make install" // |
---|
| 407 | // End: // |
---|