Changeset a362f97 for src/SynTree/Type.h


Ignore:
Timestamp:
Jan 27, 2017, 3:27:34 PM (9 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:
c0aa336
Parents:
6acb935 (diff), 0a86a30 (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

    r6acb935 ra362f97  
    7474        virtual Type * getComponent( unsigned i ) { assertf( size() == 1 && i == 0, "Type::getComponent was called with size %d and index %d\n", size(), i ); return this; }
    7575
     76        virtual bool isComplete() const { return true; }
     77
    7678        virtual Type *clone() const = 0;
    7779        virtual void accept( Visitor &v ) = 0;
     
    9092
    9193        virtual unsigned size() const { return 0; };
     94        virtual bool isComplete() const { return false; }
    9295
    9396        virtual VoidType *clone() const { return new VoidType( *this ); }
     
    185188        void set_isStatic( bool newValue ) { isStatic = newValue; }
    186189
     190        virtual bool isComplete() const { return ! isVarLen; }
     191
    187192        virtual ArrayType *clone() const { return new ArrayType( *this ); }
    188193        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    258263        std::list<TypeDecl*> * get_baseParameters();
    259264
     265        virtual bool isComplete() const;
     266
    260267        /// Looks up the members of this struct named "name" and places them into "foundDecls".
    261268        /// Clones declarations into "foundDecls", caller responsible for freeing
     
    287294        std::list<TypeDecl*> * get_baseParameters();
    288295
     296        virtual bool isComplete() const;
     297
    289298        /// looks up the members of this union named "name" and places them into "foundDecls"
    290299        /// Clones declarations into "foundDecls", caller responsible for freeing
     
    310319        EnumInstType( const EnumInstType &other ) : Parent( other ) {}
    311320
     321        // xxx - enum inst does not currently contain a pointer to base, this should be fixed.
     322        // virtual bool isComplete() const { return baseEnum()->hasBody(); }
     323
    312324        virtual EnumInstType *clone() const { return new EnumInstType( *this ); }
    313325        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    325337
    326338        std::list< Declaration* >& get_members() { return members; }
     339
     340        virtual bool isComplete() const;
    327341
    328342        virtual TraitInstType *clone() const { return new TraitInstType( *this ); }
     
    349363        bool get_isFtype() const { return isFtype; }
    350364        void set_isFtype( bool newValue ) { isFtype = newValue; }
     365
     366        virtual bool isComplete() const;
    351367
    352368        virtual TypeInstType *clone() const { return new TypeInstType( *this ); }
     
    382398        }
    383399
     400        // virtual bool isComplete() const { return true; } // xxx - not sure if this is right, might need to recursively check complete-ness
     401
    384402        virtual TupleType *clone() const { return new TupleType( *this ); }
    385403        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    398416        Expression *get_expr() const { return expr; }
    399417        void set_expr( Expression *newValue ) { expr = newValue; }
     418
     419        virtual bool isComplete() const { assert( false ); return false; }
    400420
    401421        virtual TypeofType *clone() const { return new TypeofType( *this ); }
     
    423443        void set_isType( bool newValue ) { isType = newValue; }
    424444
     445        virtual bool isComplete() const { assert( false ); } // xxx - not sure what to do here
     446
    425447        virtual AttrType *clone() const { return new AttrType( *this ); }
    426448        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    439461        VarArgsType();
    440462        VarArgsType( Type::Qualifiers tq );
     463
     464        virtual bool isComplete() const{ return true; } // xxx - is this right?
    441465
    442466        virtual VarArgsType *clone() const { return new VarArgsType( *this ); }
Note: See TracChangeset for help on using the changeset viewer.