Changes in src/AST/Decl.hpp [e0e9a0b:e67991f]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
re0e9a0b re67991f 87 87 virtual const Type * get_type() const = 0; 88 88 /// Set type of this declaration. May be verified by subclass 89 virtual void set_type( const Type *) = 0;89 virtual void set_type(Type *) = 0; 90 90 91 91 const DeclWithType * accept( Visitor & v ) const override = 0; … … 102 102 ptr<Expr> bitfieldWidth; 103 103 104 ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, 105 const Init * init = nullptr, Storage::Classes storage = {}, 106 Linkage::Spec linkage = Linkage::C, const Expr * bitWd = nullptr, 104 ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, 105 const Init * init = nullptr, Storage::Classes storage = {}, 106 Linkage::Spec linkage = Linkage::C, const Expr * bitWd = nullptr, 107 107 std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} ) 108 108 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ), … … 110 110 111 111 const Type* get_type() const override { return type; } 112 void set_type( constType * ty ) override { type = ty; }112 void set_type( Type * ty ) override { type = ty; } 113 113 114 114 const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); } … … 132 132 133 133 const Type * get_type() const override; 134 void set_type( const Type * t) override;134 void set_type(Type * t) override; 135 135 136 136 bool has_body() const { return stmts; } … … 149 149 std::vector<ptr<DeclWithType>> assertions; 150 150 151 NamedTypeDecl( 152 const CodeLocation & loc, const std::string & name, Storage::Classes storage, 153 const Type * b, Linkage::Spec spec = Linkage::Cforall ) 151 NamedTypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, 152 Type* b, Linkage::Spec spec = Linkage::Cforall ) 154 153 : Decl( loc, name, storage, spec ), base( b ), params(), assertions() {} 155 154 … … 186 185 }; 187 186 188 TypeDecl( 189 const CodeLocation & loc, const std::string & name, Storage::Classes storage, 190 const Type * b, TypeVar::Kind k, bool s, const Type * i = nullptr ) 187 TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b, 188 TypeVar::Kind k, bool s, Type* i = nullptr ) 191 189 : NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ), 192 190 init( i ) {} … … 323 321 }; 324 322 323 /// With statement `with (...) ...` 324 class WithStmt final : public Decl { 325 public: 326 std::vector<ptr<Expr>> exprs; 327 ptr<Stmt> stmt; 328 329 WithStmt( const CodeLocation & loc, std::vector<ptr<Expr>> && exprs, const Stmt * stmt ) 330 : Decl(loc, "", Storage::Auto, Linkage::Cforall), exprs(std::move(exprs)), stmt(stmt) {} 331 332 const Decl * accept( Visitor & v ) const override { return v.visit( this ); } 333 private: 334 WithStmt * clone() const override { return new WithStmt{ *this }; } 335 MUTATE_FRIEND 336 }; 337 325 338 class AsmDecl : public Decl { 326 339 public:
Note:
See TracChangeset
for help on using the changeset viewer.