Changeset 9e2c1f0 for src/CodeGen


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r99ee64d r9e2c1f0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 27 11:59:36 2016
     12// Last Modified On : Fri May 06 16:01:00 2016
    1313// Update Count     : 255
    1414//
     
    7676        //*** Declarations
    7777        void CodeGenerator::visit( FunctionDecl *functionDecl ) {
     78                // generalize this
     79                FunctionDecl::Attribute attr = functionDecl->get_attribute();
     80                switch ( attr.type ) {
     81                        case FunctionDecl::Attribute::Constructor:
     82                                output << "__attribute__ ((constructor";
     83                                if ( attr.priority != FunctionDecl::Attribute::Default ) {
     84                                        output << "(" << attr.priority << ")";
     85                                }
     86                                output << ")) ";
     87                                break;
     88                        case FunctionDecl::Attribute::Destructor:
     89                                output << "__attribute__ ((destructor";
     90                                if ( attr.priority != FunctionDecl::Attribute::Default ) {
     91                                        output << "(" << attr.priority << ")";
     92                                }
     93                                output << ")) ";
     94                                break;
     95                        default:
     96                                break;
     97                }
    7898                handleStorageClass( functionDecl );
    7999                if ( functionDecl->get_isInline() ) {
Note: See TracChangeset for help on using the changeset viewer.