Changeset 9e2c1f0 for src/InitTweak


Ignore:
Timestamp:
May 6, 2016, 4:28:50 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:
ec79847
Parents:
99ee64d (diff), 03e5d14 (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 'global-init' into ctor and add global destroy function to call destructors on global objects

Conflicts:

src/CodeGen/CodeGenerator.cc
src/InitTweak/module.mk
src/Makefile.in
src/SynTree/Declaration.h
src/SynTree/FunctionDecl.cc
src/main.cc

Location:
src/InitTweak
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/InitTweak/GenInit.cc

    r99ee64d r9e2c1f0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 28 12:26:47 2016
     12// Last Modified On : Fri May 06 16:11:15 2016
    1313// Update Count     : 166
    1414//
     
    129129        }
    130130
     131        bool tryConstruct( ObjectDecl * objDecl ) {
     132                // xxx - handle designations
     133                return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
     134                        (objDecl->get_init() == NULL ||
     135                        ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ));
     136        }
    131137        namespace {
    132                 bool tryConstruct( ObjectDecl * objDecl ) {
    133                         // xxx - handle designations
    134                         return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
    135                                 (objDecl->get_init() == NULL ||
    136                                 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ));
    137                 }
    138138
    139139                Expression * makeCtorDtorExpr( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
     
    209209                                        objDecl->set_init( new ConstructorInit( ctorStmt, dtorStmt, objDecl->get_init() ) );
    210210                                }
    211                         } else {
    212                                 // xxx - find a way to construct/destruct globals
    213                                 // hack: implicit "static" initialization routine for each struct type? or something similar?
    214                                 // --ties into module system
    215                                 // this can be done by mangling main and replacing it with our own main which calls each
    216                                 // module initialization routine in some decided order (order given in link command?)
    217                                 // and finally calls mangled main
    218211                        }
    219212                }
  • TabularUnified src/InitTweak/GenInit.h

    r99ee64d r9e2c1f0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 28 12:22:09 2016
     12// Last Modified On : Fri May 06 16:18:22 2016
    1313// Update Count     : 3
    1414//
     
    2727        /// Adds return value temporaries and wraps Initializers in ConstructorInit nodes
    2828        void genInit( std::list< Declaration * > & translationUnit );
     29        /// True if the resolver should try to construct objDecl
     30        bool tryConstruct( ObjectDecl * objDecl );
    2931} // namespace
    3032
    31 #endif // GENPOLY_POLYMUTATOR_H
     33#endif // INITTWEAK_GENINIT_H
    3234
    3335// Local Variables: //
  • TabularUnified src/InitTweak/module.mk

    r99ee64d r9e2c1f0  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Rob Schluntz
    13 ## Last Modified On : Thu Apr 28 12:23:17 2016
     13## Last Modified On : Fri May 06 15:59:27 2016
    1414## Update Count     : 3
    1515###############################################################################
    1616
    1717SRC += InitTweak/GenInit.cc \
    18         InitTweak/FixInit.cc
     18        InitTweak/FixInit.cc \
     19        InitTweak/FixGlobalInit.cc
     20
Note: See TracChangeset for help on using the changeset viewer.