Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (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 cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    rf9feab8 r90152a4  
    8484        Expression *asmName;
    8585        std::list< Attribute * > attributes;
     86        bool isDeleted = false;
    8687
    8788        DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
     
    151152        FunctionType *type;
    152153        CompoundStmt *statements;
     154        std::list< Expression * > withExprs;
    153155
    154156        FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
     
    200202        typedef NamedTypeDecl Parent;
    201203  public:
    202         enum Kind { Dtype, Ftype, Ttype };
     204        enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS };
    203205
    204206        Type * init;
     
    244246        typedef NamedTypeDecl Parent;
    245247  public:
    246         TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) : Parent( name, scs, type ) { set_linkage( spec ); }
     248        TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
     249                : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; }
     250
    247251        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    248252
     
    262266        bool body;
    263267        std::list< Attribute * > attributes;
     268        AggregateDecl * parent = nullptr;
    264269
    265270        AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
     
    319324        EnumDecl( const EnumDecl &other ) : Parent( other ) {}
    320325
     326        bool valueOf( Declaration * enumerator, long long int & value );
     327
    321328        virtual EnumDecl *clone() const override { return new EnumDecl( *this ); }
    322329        virtual void accept( Visitor &v ) override { v.visit( this ); }
    323330        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    324331  private:
     332        std::map< std::string, long long int > enumValues;
    325333        virtual std::string typeString() const override;
    326334};
     
    355363        virtual void accept( Visitor &v ) override { v.visit( this ); }
    356364        virtual AsmDecl *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     365        virtual void print( std::ostream &os, Indenter indent = {} ) const override;
     366        virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     367};
     368
     369class StaticAssertDecl : public Declaration {
     370public:
     371        Expression * condition;
     372        ConstantExpr * message;   // string literal
     373
     374        StaticAssertDecl( Expression * condition, ConstantExpr * message );
     375        StaticAssertDecl( const StaticAssertDecl & other );
     376        virtual ~StaticAssertDecl();
     377
     378        virtual StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); }
     379        virtual void accept( Visitor &v ) override { v.visit( this ); }
     380        virtual StaticAssertDecl * acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    357381        virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    358382        virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
Note: See TracChangeset for help on using the changeset viewer.