Changeset 373d0b5 for src/SynTree


Ignore:
Timestamp:
Dec 1, 2017, 2:49:52 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
81644e0
Parents:
a378ca7
Message:

Refactor getAggr as a Type member function

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    ra378ca7 r373d0b5  
    7070bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; }
    7171
     72AggregateDecl * StructInstType::getAggr() { return baseStruct; }
     73
    7274void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
    7375        assert( baseStruct );
     
    101103
    102104bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; }
     105
     106AggregateDecl * UnionInstType::getAggr() { return baseUnion; }
    103107
    104108void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
  • src/SynTree/Type.h

    ra378ca7 r373d0b5  
    178178        virtual bool isComplete() const { return true; }
    179179
     180        virtual AggregateDecl * getAggr() {     assertf( false, "Non-aggregate type: %s", toString( this ).c_str() ); }
     181
    180182        virtual Type *clone() const = 0;
    181183        virtual void accept( Visitor & v ) = 0;
     
    405407        virtual bool isComplete() const override;
    406408
     409        virtual AggregateDecl * getAggr() override;
     410
    407411        /// Looks up the members of this struct named "name" and places them into "foundDecls".
    408412        /// Clones declarations into "foundDecls", caller responsible for freeing
     
    436440
    437441        virtual bool isComplete() const override;
     442
     443        virtual AggregateDecl * getAggr() override;
    438444
    439445        /// looks up the members of this union named "name" and places them into "foundDecls"
Note: See TracChangeset for help on using the changeset viewer.