Changeset c76bd34 for src/AST/Type.hpp
- Timestamp:
- Oct 7, 2020, 4:31:43 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 848439f
- Parents:
- ae2c27a (diff), 597c5d18 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/AST/Type.hpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.hpp
rae2c27a rc76bd34 302 302 class FunctionType final : public ParameterizedType { 303 303 public: 304 std::vector<ptr<DeclWithType>> returns; 305 std::vector<ptr<DeclWithType>> params; 304 // std::vector<ptr<DeclWithType>> returns; 305 // std::vector<ptr<DeclWithType>> params; 306 307 std::vector<ptr<Type>> returns; 308 std::vector<ptr<Type>> params; 306 309 307 310 /// Does the function accept a variable number of arguments following the arguments specified … … 329 332 330 333 /// base class for types that refer to types declared elsewhere (aggregates and typedefs) 331 class ReferenceToType : public ParameterizedType {334 class BaseInstType : public ParameterizedType { 332 335 protected: 333 336 /// Initializes forall and parameters based on substitutor 334 void initWithSub( const ReferenceToType & o, Pass< ForallSubstitutor > & sub );337 void initWithSub( const BaseInstType & o, Pass< ForallSubstitutor > & sub ); 335 338 public: 336 339 std::vector<ptr<Expr>> params; … … 338 341 bool hoistType = false; 339 342 340 ReferenceToType(343 BaseInstType( 341 344 const std::string& n, CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} ) 342 345 : ParameterizedType(q, std::move(as)), params(), name(n) {} 343 346 344 ReferenceToType( const ReferenceToType & o );347 BaseInstType( const BaseInstType & o ); 345 348 346 349 /// Gets aggregate declaration this type refers to … … 350 353 351 354 private: 352 virtual ReferenceToType * clone() const override = 0;355 virtual BaseInstType * clone() const override = 0; 353 356 MUTATE_FRIEND 354 357 }; … … 356 359 // Common implementation for the SUE instance types. Not to be used directly. 357 360 template<typename decl_t> 358 class SueInstType final : public ReferenceToType {361 class SueInstType final : public BaseInstType { 359 362 public: 360 363 using base_type = decl_t; … … 363 366 SueInstType( 364 367 const std::string& n, CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} ) 365 : ReferenceToType( n, q, std::move(as) ), base() {}368 : BaseInstType( n, q, std::move(as) ), base() {} 366 369 367 370 SueInstType( … … 388 391 389 392 /// An instance of a trait type. 390 class TraitInstType final : public ReferenceToType {393 class TraitInstType final : public BaseInstType { 391 394 public: 392 395 readonly<TraitDecl> base; … … 394 397 TraitInstType( 395 398 const std::string& n, CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} ) 396 : ReferenceToType( n, q, std::move(as) ), base() {}399 : BaseInstType( n, q, std::move(as) ), base() {} 397 400 398 401 TraitInstType( … … 411 414 412 415 /// instance of named type alias (typedef or variable) 413 class TypeInstType final : public ReferenceToType {416 class TypeInstType final : public BaseInstType { 414 417 public: 415 418 readonly<TypeDecl> base; … … 419 422 const std::string& n, const TypeDecl * b, CV::Qualifiers q = {}, 420 423 std::vector<ptr<Attribute>> && as = {} ) 421 : ReferenceToType( n, q, std::move(as) ), base( b ), kind( b->kind ) {}424 : BaseInstType( n, q, std::move(as) ), base( b ), kind( b->kind ) {} 422 425 TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {}, 423 426 std::vector<ptr<Attribute>> && as = {} ) 424 : ReferenceToType( n, q, std::move(as) ), base(), kind( k ) {}427 : BaseInstType( n, q, std::move(as) ), base(), kind( k ) {} 425 428 426 429 TypeInstType( const TypeInstType & o );
Note:
See TracChangeset
for help on using the changeset viewer.