Changeset 28f8f15 for src/AST/Decl.hpp


Ignore:
Timestamp:
Apr 27, 2023, 3:13:24 PM (3 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT
Children:
561354f
Parents:
b110bcc
Message:

Save progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    rb110bcc r28f8f15  
    248248class AggregateDecl : public Decl {
    249249public:
    250         enum Aggregate { Struct, Union, Enum, Exception, Trait, Generator, Coroutine, Monitor, Thread, NoAggregate };
     250        enum Aggregate { Struct, Union, Enum, Exception, Trait, Generator, Coroutine, Monitor, Thread, NoAggregate, ADT };
    251251        static const char * aggrString( Aggregate aggr );
    252252
     
    286286        bool is_monitor  () const { return kind == Monitor  ; }
    287287        bool is_thread   () const { return kind == Thread   ; }
     288        bool is_adt              () const { return kind == ADT          ; }
    288289
    289290        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     
    320321        enum class EnumHiding { Visible, Hide } hide;
    321322
     323        std::vector<ptr<StructDecl>> data_constructors;
     324        bool isData = false;
     325        ptr<UnionDecl> data_union;
     326        ptr<EnumDecl> tag;
     327        ptr<StructDecl> tag_union;
     328
    322329        EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false,
    323330                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall,
    324                 Type const * base = nullptr, EnumHiding hide = EnumHiding::Hide,
     331                Type const * base = nullptr, EnumHiding hide = EnumHiding::Visible,
    325332                std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
    326333        : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), hide(hide), enumValues(enumValues) {}
Note: See TracChangeset for help on using the changeset viewer.