Changeset 90152a4 for src/SynTree/Type.h


Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (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' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    rf9feab8 r90152a4  
    178178        virtual bool isComplete() const { return true; }
    179179
    180         virtual AggregateDecl * getAggr() {     assertf( false, "Non-aggregate type: %s", toString( this ).c_str() ); }
     180        virtual AggregateDecl * getAggr() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); }
     181
     182        virtual TypeSubstitution genericSubstitution() const;
    181183
    182184        virtual Type *clone() const = 0;
     
    229231                SignedInt128,
    230232                UnsignedInt128,
     233                Float80,
     234                Float128,
    231235                NUMBER_OF_BASIC_TYPES
    232236        } kind;
     
    311315};
    312316
     317class QualifiedType : public Type {
     318public:
     319        Type * parent;
     320        Type * child;
     321
     322        QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child );
     323        QualifiedType( const QualifiedType & tq );
     324        virtual ~QualifiedType();
     325
     326        virtual QualifiedType *clone() const override { return new QualifiedType( *this ); }
     327        virtual void accept( Visitor & v ) override { v.visit( this ); }
     328        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     329        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     330};
     331
    313332class ReferenceType : public Type {
    314333public:
     
    328347        // the number of values are disallowed.
    329348        virtual unsigned size() const override { return base->size(); }
     349
     350        virtual TypeSubstitution genericSubstitution() const override;
    330351
    331352        virtual ReferenceType *clone() const override { return new ReferenceType( *this ); }
     
    356377        bool isTtype() const;
    357378
     379        bool isUnprototyped() const { return isVarArgs && parameters.size() == 0; }
     380
    358381        virtual FunctionType *clone() const override { return new FunctionType( *this ); }
    359382        virtual void accept( Visitor & v ) override { v.visit( this ); }
     
    404427        /// Accesses generic parameters of base struct (NULL if none such)
    405428        std::list<TypeDecl*> * get_baseParameters();
     429        const std::list<TypeDecl*> * get_baseParameters() const;
    406430
    407431        virtual bool isComplete() const override;
    408432
    409         virtual AggregateDecl * getAggr() override;
     433        virtual AggregateDecl * getAggr() const override;
     434
     435        virtual TypeSubstitution genericSubstitution() const override;
    410436
    411437        /// Looks up the members of this struct named "name" and places them into "foundDecls".
     
    437463
    438464        /// Accesses generic parameters of base union (NULL if none such)
    439         std::list< TypeDecl * > * get_baseParameters();
     465        std::list<TypeDecl*> * get_baseParameters();
     466        const std::list<TypeDecl*> * get_baseParameters() const;
    440467
    441468        virtual bool isComplete() const override;
    442469
    443         virtual AggregateDecl * getAggr() override;
     470        virtual AggregateDecl * getAggr() const override;
     471
     472        virtual TypeSubstitution genericSubstitution() const override;
    444473
    445474        /// looks up the members of this union named "name" and places them into "foundDecls"
     
    471500
    472501        virtual bool isComplete() const override;
     502
     503        virtual AggregateDecl * getAggr() const override;
    473504
    474505        virtual EnumInstType *clone() const override { return new EnumInstType( *this ); }
     
    651682};
    652683
     684class GlobalScopeType : public Type {
     685  public:
     686        GlobalScopeType();
     687
     688        virtual GlobalScopeType *clone() const override { return new GlobalScopeType( *this ); }
     689        virtual void accept( Visitor & v ) override { v.visit( this ); }
     690        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     691        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     692};
     693
    653694// Local Variables: //
    654695// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.