Changes in src/AST/Decl.hpp [54e41b3:8a5530c]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r54e41b3 r8a5530c 32 32 namespace ast { 33 33 34 class Attribute; 35 class Expr; 36 class Init; 37 class TypeDecl; 38 34 39 /// Base declaration class 35 40 class Decl : public ParseNode { … … 114 119 }; 115 120 121 /// Object declaration `int foo()` 116 122 class FunctionDecl : public DeclWithType { 117 123 public: … … 126 132 stmts( stmts ) {} 127 133 128 const Type * get_type() const override { return type.get(); }129 void set_type(Type * t) override { type = strict_dynamic_cast< FunctionType* >( t ); }134 const Type * get_type() const override; 135 void set_type(Type * t) override; 130 136 131 137 bool has_body() const { return stmts; } … … 144 150 public: 145 151 ptr<Type> base; 146 std::vector<ptr<TypeDecl>> param s;152 std::vector<ptr<TypeDecl>> parameters; 147 153 std::vector<ptr<DeclWithType>> assertions; 148 154 149 155 NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 150 156 Type* b, Linkage::Spec spec = Linkage::Cforall ) 151 : Decl( loc, name, storage, spec ), base( b ), param s(), assertions() {}157 : Decl( loc, name, storage, spec ), base( b ), parameters(), assertions() {} 152 158 153 159 /// Produces a name for the kind of alias … … 184 190 TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b, 185 191 TypeVar::Kind k, bool s, Type* i = nullptr ) 186 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ), 192 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ), 187 193 init( i ) {} 188 194 … … 225 231 public: 226 232 std::vector<ptr<Decl>> members; 227 std::vector<ptr<TypeDecl>> param s;233 std::vector<ptr<TypeDecl>> parameters; 228 234 std::vector<ptr<Attribute>> attributes; 229 235 bool body = false; … … 232 238 AggregateDecl( const CodeLocation& loc, const std::string& name, 233 239 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall ) 234 : Decl( loc, name, Storage::Classes{}, linkage ), members(), param s(),240 : Decl( loc, name, Storage::Classes{}, linkage ), members(), parameters(), 235 241 attributes( std::move(attrs) ) {} 236 242
Note:
See TracChangeset
for help on using the changeset viewer.