Changeset c194661 for src/SynTree


Ignore:
Timestamp:
Jun 20, 2018, 11:23:42 AM (7 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
0b3b2ae
Parents:
9a7a3b6
Message:

Reorganize QualifiedType node

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.cc

    r9a7a3b6 rc194661  
    106106
    107107
    108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ) : Type( tq, {} ), types( types ) {
     108QualifiedType::QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ) : Type( tq, {} ), parent( parent ), child( child ) {
    109109}
    110110
    111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ) {
    112         cloneAll( other.types, types );
     111QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ), parent( maybeClone( other.parent ) ), child( maybeClone( other.child ) ) {
    113112}
    114113
    115114QualifiedType::~QualifiedType() {
    116         deleteAll( types );
     115        delete parent;
     116        delete child;
    117117}
    118118
    119119void QualifiedType::print( std::ostream & os, Indenter indent ) const {
    120120        os << "Qualified Type: " << endl;
    121         printAll( types, os, indent+1 );
     121        os << indent+1;
     122        parent->print( os, indent+1 );
     123        os << endl << indent+1;
     124        child->print( os, indent+1 );
     125        os << endl;
    122126        Type::print( os, indent+1 );
    123127}
  • src/SynTree/Type.h

    r9a7a3b6 rc194661  
    317317class QualifiedType : public Type {
    318318public:
    319         std::list<Type *> types;
    320 
    321         QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types );
     319        Type * parent;
     320        Type * child;
     321
     322        QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child );
    322323        QualifiedType( const QualifiedType & tq );
    323324        virtual ~QualifiedType();
Note: See TracChangeset for help on using the changeset viewer.