Ignore:
Timestamp:
Aug 19, 2016, 5:04:59 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
d30790f
Parents:
2037f82
Message:

fixed some more memory leaks and added safe_dynamic_cast to assert.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r2037f82 r4f147cc  
    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//##############################################################################
Note: See TracChangeset for help on using the changeset viewer.