Changes in src/AST/Decl.hpp [6d51bd7:e0115286]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r6d51bd7 re0115286 57 57 static readonly<Decl> fromId( UniqueId id ); 58 58 59 virtual const Decl * accept( Visitor & v ) constoverride = 0;60 private: 61 virtual Decl * clone() const override = 0;59 virtual Decl* accept( Visitor& v ) override = 0; 60 private: 61 virtual Decl* clone() const override = 0; 62 62 }; 63 63 … … 85 85 86 86 /// Get type of this declaration. May be generated by subclass 87 virtual const Type * get_type() const = 0;87 virtual const Type* get_type() const = 0; 88 88 /// Set type of this declaration. May be verified by subclass 89 89 virtual void set_type(Type*) = 0; 90 90 91 virtual const DeclWithType * accept( Visitor & v ) constoverride = 0;92 private: 93 virtual DeclWithType * clone() const override = 0;91 virtual DeclWithType* accept( Visitor& v ) override = 0; 92 private: 93 virtual DeclWithType* clone() const override = 0; 94 94 }; 95 95 … … 110 110 void set_type( Type* ty ) override { type = ty; } 111 111 112 virtual const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); } 113 private: 114 virtual 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); 112 DeclWithType* accept( Visitor& v ) override { return v.visit( this ); } 113 private: 114 ObjectDecl* clone() const override { return new ObjectDecl{ *this }; } 119 115 }; 120 116 … … 170 166 std::string genTypeString() const; 171 167 172 virtual const Decl * accept( Visitor & v ) constoverride { return v.visit( this ); }173 private: 174 virtual TypeDecl* clone() const override { return new TypeDecl{ *this }; }168 Decl* accept( Visitor& v ) override { return v.visit( this ); } 169 private: 170 TypeDecl* clone() const override { return new TypeDecl{ *this }; } 175 171 }; 176 172 … … 184 180 std::string typeString() const override { return "typedef"; } 185 181 186 virtual const Decl * accept( Visitor & v ) constoverride { return v.visit( this ); }187 private: 188 virtual TypedefDecl* clone() const override { return new TypedefDecl{ *this }; }182 Decl* accept( Visitor& v ) override { return v.visit( this ); } 183 private: 184 TypedefDecl* clone() const override { return new TypedefDecl{ *this }; } 189 185 }; 190 186 … … 224 220 bool is_thread() { return kind == DeclarationNode::Thread; } 225 221 226 virtual const Decl * accept( Visitor & v ) constoverride { return v.visit( this ); }227 private: 228 virtual StructDecl* clone() const override { return new StructDecl{ *this }; }222 Decl* accept( Visitor& v ) override { return v.visit( this ); } 223 private: 224 StructDecl* clone() const override { return new StructDecl{ *this }; } 229 225 230 226 std::string typeString() const override { return "struct"; } … … 238 234 : AggregateDecl( loc, name, std::move(attrs), linkage ) {} 239 235 240 virtual const Decl * accept( Visitor& v ) constoverride { return v.visit( this ); }241 private: 242 virtual UnionDecl* clone() const override { return new UnionDecl{ *this }; }236 Decl* accept( Visitor& v ) override { return v.visit( this ); } 237 private: 238 UnionDecl* clone() const override { return new UnionDecl{ *this }; } 243 239 244 240 std::string typeString() const override { return "union"; } … … 255 251 bool valueOf( Decl* enumerator, long long& value ) const; 256 252 257 virtual const Decl * accept( Visitor & v ) constoverride { return v.visit( this ); }258 private: 259 virtual EnumDecl* clone() const override { return new EnumDecl{ *this }; }253 Decl* accept( Visitor& v ) override { return v.visit( this ); } 254 private: 255 EnumDecl* clone() const override { return new EnumDecl{ *this }; } 260 256 261 257 std::string typeString() const override { return "enum"; } … … 272 268 : AggregateDecl( loc, name, std::move(attrs), linkage ) {} 273 269 274 virtual const Decl * accept( Visitor & v ) constoverride { return v.visit( this ); }275 private: 276 virtual TraitDecl* clone() const override { return new TraitDecl{ *this }; }270 Decl* accept( Visitor& v ) override { return v.visit( this ); } 271 private: 272 TraitDecl* clone() const override { return new TraitDecl{ *this }; } 277 273 278 274 std::string typeString() const override { return "trait"; } … … 291 287 inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); } 292 288 inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); } 293 //inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); }294 //inline void decrement( const class FunctionDecl * 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); } 295 291 inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); } 296 292 inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); } … … 307 303 inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); } 308 304 inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); } 309 //inline void increment( const class FtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }310 //inline void decrement( const class FtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }311 //inline void increment( const class DtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }312 //inline void decrement( const class DtypeDecl * 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); } 313 309 inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); } 314 310 inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); } 315 //inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); }316 //inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); }317 //inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); }318 //inline void decrement( const class StaticAssertDecl * 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); } 319 315 320 316 }
Note:
See TracChangeset
for help on using the changeset viewer.