Changeset d3e4d6c for src/SynTree/Type.h


Ignore:
Timestamp:
Aug 23, 2017, 6:22:07 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
87e08e24, cb811ac
Parents:
9f07232 (diff), bd37119 (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    r9f07232 rd3e4d6c  
    168168
    169169        /// return type without outer pointers and arrays
    170         Type *stripDeclarator();
     170        Type * stripDeclarator();
     171
     172        /// return type without outer references
     173        Type * stripReferences();
     174
     175        /// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types)
     176        virtual int referenceDepth() const;
    171177
    172178        virtual bool isComplete() const { return true; }
     
    262268        bool is_array() const { return isStatic || isVarLen || dimension; }
    263269
     270        virtual bool isComplete() const { return ! isVarLen; }
     271
    264272        virtual PointerType *clone() const { return new PointerType( *this ); }
    265273        virtual void accept( Visitor & v ) { v.visit( this ); }
     
    296304};
    297305
     306class ReferenceType : public Type {
     307public:
     308        Type *base;
     309
     310        ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
     311        ReferenceType( const ReferenceType & );
     312        virtual ~ReferenceType();
     313
     314        Type *get_base() { return base; }
     315        void set_base( Type *newValue ) { base = newValue; }
     316
     317        virtual int referenceDepth() const;
     318
     319        // Since reference types act like value types, their size is the size of the base.
     320        // This makes it simple to cast the empty tuple to a reference type, since casts that increase
     321        // the number of values are disallowed.
     322        virtual unsigned size() const { return base->size(); }
     323
     324        virtual ReferenceType *clone() const { return new ReferenceType( *this ); }
     325        virtual void accept( Visitor & v ) { v.visit( this ); }
     326        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     327        virtual void print( std::ostream & os, int indent = 0 ) const;
     328};
     329
    298330class FunctionType : public Type {
    299331  public:
Note: See TracChangeset for help on using the changeset viewer.