Changeset 5b2f5bb for src/SynTree


Ignore:
Timestamp:
Mar 30, 2016, 3:48:55 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, 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:
e0323a2
Parents:
4cc4286
Message:

choose destructor at at object declaration (CtorInit?), overhaul and simplification of resolver code for CtorInit?

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Initializer.cc

    r4cc4286 r5b2f5bb  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jan 13 15:31:45 2016
     12// Last Modified On : Wed Mar 30 13:58:32 2016
    1313// Update Count     : 28
    1414//
     
    1616#include "Initializer.h"
    1717#include "Expression.h"
     18#include "Statement.h"
    1819#include "Common/utility.h"
    1920
     
    8182
    8283
    83 ConstructorInit::ConstructorInit( Expression * ctor, Initializer * init ) : Initializer( true ), ctor( ctor ), init( init ) {}
     84ConstructorInit::ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ) : Initializer( true ), ctor( ctor ), dtor( dtor ), init( init ) {}
    8485ConstructorInit::~ConstructorInit() {
    8586        delete ctor;
     
    9899        } // if
    99100
     101        if ( dtor ) {
     102                os << " destructed with ";
     103                dtor->print( os, indent+2 );
     104        }
     105
    100106        if ( init ) {
    101107                os << " with fallback C-style initializer: ";
  • src/SynTree/Initializer.h

    r4cc4286 r5b2f5bb  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Feb 09 14:40:15 2016
     12// Last Modified On : Wed Mar 30 13:22:08 2016
    1313// Update Count     : 19
    1414//
     
    107107class ConstructorInit : public Initializer {
    108108  public:
    109         ConstructorInit( Expression * ctor, Initializer * init );
     109        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
    110110        virtual ~ConstructorInit();
    111111
    112         void set_ctor( Expression * newValue ) { ctor = newValue; }
    113         Expression * get_ctor() const { return ctor; }
     112        void set_ctor( Statement * newValue ) { ctor = newValue; }
     113        Statement * get_ctor() const { return ctor; }
     114        void set_dtor( Statement * newValue ) { dtor = newValue; }
     115        Statement * get_dtor() const { return dtor; }
    114116        void set_init( Initializer * newValue ) { init = newValue; }
    115117        Initializer * get_init() const { return init; }
     
    121123
    122124  private:
    123         Expression * ctor;
     125        Statement * ctor;
     126        Statement * dtor;
    124127        // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
    125128        // if an appropriate constructor definition is not found by the resolver
Note: See TracChangeset for help on using the changeset viewer.