Ignore:
Timestamp:
Jul 4, 2017, 9:40:16 AM (8 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:
208e5be
Parents:
9c951e3 (diff), f7cb0bc (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' into references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r9c951e3 rb1e63ac5  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 16:05:08 2017
    13 // Update Count     : 121
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tus Jun 27 15:31:00 2017
     13// Update Count     : 122
    1414//
    1515
     
    194194        };
    195195
    196         TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind );
     196        TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr );
    197197        TypeDecl( const TypeDecl &other );
     198        virtual ~TypeDecl();
    198199
    199200        Kind get_kind() const { return kind; }
     201
     202        Type * get_init() const { return init; }
     203        TypeDecl * set_init( Type * newValue ) { init = newValue; return this; }
    200204
    201205        bool isComplete() const { return kind == Any || sized; }
     
    209213        virtual void accept( Visitor &v ) { v.visit( this ); }
    210214        virtual TypeDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     215        virtual void print( std::ostream &os, int indent = 0 ) const;
     216
    211217  private:
    212218        Kind kind;
     219        Type * init;
    213220        bool sized;
    214221};
     
    231238        typedef Declaration Parent;
    232239  public:
    233         AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() );
     240        AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
    234241        AggregateDecl( const AggregateDecl &other );
    235242        virtual ~AggregateDecl();
     
    259266        typedef AggregateDecl Parent;
    260267  public:
    261         StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ), kind( kind ) {}
     268        StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
    262269        StructDecl( const StructDecl &other ) : Parent( other ) {}
    263270
     
    277284        typedef AggregateDecl Parent;
    278285  public:
    279         UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
     286        UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    280287        UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    281288
     
    290297        typedef AggregateDecl Parent;
    291298  public:
    292         EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
     299        EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    293300        EnumDecl( const EnumDecl &other ) : Parent( other ) {}
    294301
Note: See TracChangeset for help on using the changeset viewer.