Ignore:
Timestamp:
May 6, 2016, 4:28:50 PM (8 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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                }
Note: See TracChangeset for help on using the changeset viewer.