Changes in src/AST/Decl.hpp [427854b:e3bc51c]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r427854b re3bc51c 33 33 34 34 // Must be included in *all* AST classes; should be #undef'd at the end of the file 35 #define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node); 35 #define MUTATE_FRIEND \ 36 template<typename node_t> friend node_t * mutate(const node_t * node); \ 37 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 36 38 37 39 namespace ast { … … 88 90 virtual const Type * get_type() const = 0; 89 91 /// Set type of this declaration. May be verified by subclass 90 virtual void set_type( Type *) = 0;92 virtual void set_type( const Type * ) = 0; 91 93 92 94 const DeclWithType * accept( Visitor & v ) const override = 0; … … 111 113 112 114 const Type* get_type() const override { return type; } 113 void set_type( Type * ty ) override { type = ty; }115 void set_type( const Type * ty ) override { type = ty; } 114 116 115 117 const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); } … … 133 135 134 136 const Type * get_type() const override; 135 void set_type( Type * t) override;137 void set_type( const Type * t ) override; 136 138 137 139 bool has_body() const { return stmts; } … … 150 152 std::vector<ptr<DeclWithType>> assertions; 151 153 152 NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 153 Type* b, Linkage::Spec spec = Linkage::Cforall ) 154 NamedTypeDecl( 155 const CodeLocation & loc, const std::string & name, Storage::Classes storage, 156 const Type * b, Linkage::Spec spec = Linkage::Cforall ) 154 157 : Decl( loc, name, storage, spec ), base( b ), params(), assertions() {} 155 158 … … 186 189 }; 187 190 188 TypeDecl( const CodeLocation & loc, const std::string & name, Storage::Classes storage, Type * b, 189 Kind k, bool s, Type * i = nullptr ) 190 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == Ttype || s ), 191 init( i ) {} 191 TypeDecl( 192 const CodeLocation & loc, const std::string & name, Storage::Classes storage, 193 const Type * b, TypeDecl::Kind k, bool s, const Type * i = nullptr ) 194 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeDecl::Ttype || s ), 195 init( i ) {} 192 196 193 197 const char * typeString() const override;
Note:
See TracChangeset
for help on using the changeset viewer.