Changeset c76bd34 for src/AST/Type.hpp


Ignore:
Timestamp:
Oct 7, 2020, 4:31:43 PM (5 years ago)
Author:
Colby Alexander Parsons <caparsons@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Type.hpp

    rae2c27a rc76bd34  
    302302class FunctionType final : public ParameterizedType {
    303303public:
    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;
    306309
    307310        /// Does the function accept a variable number of arguments following the arguments specified
     
    329332
    330333/// base class for types that refer to types declared elsewhere (aggregates and typedefs)
    331 class ReferenceToType : public ParameterizedType {
     334class BaseInstType : public ParameterizedType {
    332335protected:
    333336        /// 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 );
    335338public:
    336339        std::vector<ptr<Expr>> params;
     
    338341        bool hoistType = false;
    339342
    340         ReferenceToType(
     343        BaseInstType(
    341344                const std::string& n, CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} )
    342345        : ParameterizedType(q, std::move(as)), params(), name(n) {}
    343346
    344         ReferenceToType( const ReferenceToType & o );
     347        BaseInstType( const BaseInstType & o );
    345348
    346349        /// Gets aggregate declaration this type refers to
     
    350353
    351354private:
    352         virtual ReferenceToType * clone() const override = 0;
     355        virtual BaseInstType * clone() const override = 0;
    353356        MUTATE_FRIEND
    354357};
     
    356359// Common implementation for the SUE instance types. Not to be used directly.
    357360template<typename decl_t>
    358 class SueInstType final : public ReferenceToType {
     361class SueInstType final : public BaseInstType {
    359362public:
    360363        using base_type = decl_t;
     
    363366        SueInstType(
    364367                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() {}
    366369
    367370        SueInstType(
     
    388391
    389392/// An instance of a trait type.
    390 class TraitInstType final : public ReferenceToType {
     393class TraitInstType final : public BaseInstType {
    391394public:
    392395        readonly<TraitDecl> base;
     
    394397        TraitInstType(
    395398                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() {}
    397400
    398401        TraitInstType(
     
    411414
    412415/// instance of named type alias (typedef or variable)
    413 class TypeInstType final : public ReferenceToType {
     416class TypeInstType final : public BaseInstType {
    414417public:
    415418        readonly<TypeDecl> base;
     
    419422                const std::string& n, const TypeDecl * b, CV::Qualifiers q = {},
    420423                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 ) {}
    422425        TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {},
    423426                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 ) {}
    425428
    426429        TypeInstType( const TypeInstType & o );
Note: See TracChangeset for help on using the changeset viewer.