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