Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    rab57786 r4f147cc  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug 21 11:53:59 2016
    13 // Update Count     : 546
     12// Last Modified On : Thu Aug 18 23:48:37 2016
     13// Update Count     : 542
    1414//
    1515
     
    280280        LinkageSpec::Spec get_linkage() const { return linkage; }
    281281        DeclarationNode *extractAggregate() const;
    282         ExpressionNode *get_enumeratorValue() const { return enumeratorValue; }
     282        bool has_enumeratorValue() const { return (bool)enumeratorValue; }
     283        ExpressionNode *consume_enumeratorValue() const { return const_cast<DeclarationNode*>(this)->enumeratorValue.release(); }
    283284
    284285        bool get_extension() const { return extension; }
     
    295296        std::list< std::string > attributes;
    296297        ExpressionNode *bitfieldWidth;
    297         ExpressionNode *enumeratorValue;
     298        std::unique_ptr<ExpressionNode> enumeratorValue;
    298299        InitializerNode *initializer;
    299300        bool hasEllipsis;
     
    306307
    307308Type *buildType( TypeData *type );
     309
     310static inline Type * maybeMoveBuildType( const DeclarationNode *orig ) {
     311        Type* ret = orig ? orig->buildType() : nullptr;
     312        delete orig;
     313        return ret;
     314}
    308315
    309316//##############################################################################
     
    352359Statement *build_while( ExpressionNode *ctl, StatementNode *stmt, bool kind = false );
    353360Statement *build_for( ForCtl *forctl, StatementNode *stmt );
    354 Statement *build_branch( BranchStmt::Type kind );
    355 Statement *build_branch( std::string *identifier, BranchStmt::Type kind );
     361Statement *build_branch( std::string identifier, BranchStmt::Type kind );
    356362Statement *build_computedgoto( ExpressionNode *ctl );
    357363Statement *build_return( ExpressionNode *ctl );
Note: See TracChangeset for help on using the changeset viewer.