Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    r5ccb10d rbe9036d  
    1616#pragma once
    1717
    18 #include "BaseSyntaxNode.h"
    19 #include "Mutator.h"
    20 #include "SynTree.h"
    21 #include "Visitor.h"
    22 #include <strings.h>                                                                    // ffs
     18#include <strings.h>         // for ffs
     19#include <cassert>           // for assert, assertf
     20#include <list>              // for list, _List_iterator
     21#include <ostream>           // for ostream, operator<<, basic_ostream
     22#include <string>            // for string
     23
     24#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
     25#include "Common/utility.h"  // for operator+
     26#include "Mutator.h"         // for Mutator
     27#include "SynTree.h"         // for AST nodes
     28#include "Visitor.h"         // for Visitor
    2329
    2430class Type : public BaseSyntaxNode {
     
    465471        typedef ReferenceToType Parent;
    466472  public:
    467         // this member is filled in by the validate pass, which instantiates the members of the correponding
    468         // aggregate with the actual type parameters specified for this use of the context
    469         std::list< Declaration* > members;
    470 
    471         TraitInstType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes = std::list< Attribute * >()  ) : Parent( tq, name, attributes ) {}
     473        // this decl is not "owned" by the trait inst; it is merely a pointer to elsewhere in the tree,
     474        // where the trait used in this type is actually defined
     475        TraitDecl * baseTrait = nullptr;
     476
     477        TraitInstType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {}
     478        TraitInstType( const Type::Qualifiers & tq, TraitDecl * baseTrait, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    472479        TraitInstType( const TraitInstType & other );
    473480        ~TraitInstType();
    474 
    475         std::list< Declaration* >& get_members() { return members; }
    476481
    477482        virtual bool isComplete() const;
Note: See TracChangeset for help on using the changeset viewer.