Changes in src/AST/Decl.hpp [10a1225:9d6e7fa9]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r10a1225 r9d6e7fa9 232 232 AggregateDecl* set_body( bool b ) { body = b; return this; } 233 233 234 private:235 AggregateDecl * clone() const override = 0;236 MUTATE_FRIEND237 238 protected:239 234 /// Produces a name for the kind of aggregate 240 235 virtual std::string typeString() const = 0; 236 237 private: 238 AggregateDecl * clone() const override = 0; 239 MUTATE_FRIEND 241 240 }; 242 241 … … 256 255 257 256 const Decl * accept( Visitor & v ) const override { return v.visit( this ); } 257 258 std::string typeString() const override { return "struct"; } 259 258 260 private: 259 261 StructDecl * clone() const override { return new StructDecl{ *this }; } 260 262 MUTATE_FRIEND 261 262 std::string typeString() const override { return "struct"; }263 263 }; 264 264 … … 271 271 272 272 const Decl * accept( Visitor& v ) const override { return v.visit( this ); } 273 274 std::string typeString() const override { return "union"; } 275 273 276 private: 274 277 UnionDecl * clone() const override { return new UnionDecl{ *this }; } 275 278 MUTATE_FRIEND 276 277 std::string typeString() const override { return "union"; }278 279 }; 279 280 … … 286 287 287 288 /// gets the integer value for this enumerator, returning true iff value found 288 bool valueOf( Decl* enumerator, long long& value ) const; 289 290 const Decl * accept( Visitor & v ) const override { return v.visit( this ); } 289 bool valueOf( const Decl * enumerator, long long& value ) const; 290 291 const Decl * accept( Visitor & v ) const override { return v.visit( this ); } 292 293 std::string typeString() const override { return "enum"; } 294 291 295 private: 292 296 EnumDecl * clone() const override { return new EnumDecl{ *this }; } 293 297 MUTATE_FRIEND 294 295 std::string typeString() const override { return "enum"; }296 298 297 299 /// Map from names to enumerator values; kept private for lazy initialization … … 307 309 308 310 const Decl * accept( Visitor & v ) const override { return v.visit( this ); } 311 312 std::string typeString() const override { return "trait"; } 313 309 314 private: 310 315 TraitDecl * clone() const override { return new TraitDecl{ *this }; } 311 316 MUTATE_FRIEND 312 313 std::string typeString() const override { return "trait"; }314 317 }; 315 318 … … 329 332 class StaticAssertDecl : public Decl { 330 333 public: 331 ptr<Expr> cond ition;334 ptr<Expr> cond; 332 335 ptr<ConstantExpr> msg; // string literal 333 336 334 337 StaticAssertDecl( const CodeLocation & loc, const Expr * condition, const ConstantExpr * msg ) 335 : Decl( loc, "", {}, {} ), cond ition( condition ), msg( msg ) {}338 : Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {} 336 339 337 340 const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); }
Note:
See TracChangeset
for help on using the changeset viewer.