Changes in / [d029162e:4acc87f]


Ignore:
Location:
src
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rd029162e r4acc87f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CodeGenerator.cc --
     7// CodeGenerator.cc -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 11:39:01 2016
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Mar  2 17:32:16 2016
    1313// Update Count     : 243
    1414//
     
    8484                output << genType( functionDecl->get_functionType(), mangleName( functionDecl ) );
    8585
    86                 // generalize this
    87                 switch ( functionDecl->get_attribute() ) {
    88                         case FunctionDecl::Constructor:
    89                                 output << " __attribute__ ((constructor))";
    90                                 break;
    91                         case FunctionDecl::Destructor:
    92                                 output << " __attribute__ ((destructor))";
    93                                 break;
    94                         default:
    95                                 break;
    96                 }
    97 
    9886                // how to get this to the Functype?
    9987                std::list< Declaration * > olds = functionDecl->get_oldDecls();
     
    11199                handleStorageClass( objectDecl );
    112100                output << genType( objectDecl->get_type(), mangleName( objectDecl ) );
    113 
     101       
    114102                if ( objectDecl->get_init() ) {
    115103                        output << " = ";
     
    125113                if ( aggDecl->get_name() != "" )
    126114                        output << aggDecl->get_name();
    127 
     115       
    128116                std::list< Declaration * > &memb = aggDecl->get_members();
    129117
     
    131119                        output << " {" << endl;
    132120
    133                         cur_indent += CodeGenerator::tabsize;
     121                        cur_indent += CodeGenerator::tabsize; 
    134122                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
    135                                 output << indent;
     123                                output << indent; 
    136124                                (*i)->accept( *this );
    137125                                output << ";" << endl;
    138126                        }
    139127
    140                         cur_indent -= CodeGenerator::tabsize;
     128                        cur_indent -= CodeGenerator::tabsize; 
    141129
    142130                        output << indent << "}";
     
    153141                handleAggregate( aggregateDecl );
    154142        }
    155 
     143 
    156144        void CodeGenerator::visit( EnumDecl *aggDecl ) {
    157145                output << "enum ";
     
    159147                if ( aggDecl->get_name() != "" )
    160148                        output << aggDecl->get_name();
    161 
     149       
    162150                std::list< Declaration* > &memb = aggDecl->get_members();
    163151
     
    165153                        output << " {" << endl;
    166154
    167                         cur_indent += CodeGenerator::tabsize;
     155                        cur_indent += CodeGenerator::tabsize; 
    168156                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
    169157                                ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
    170158                                assert( obj );
    171                                 output << indent << mangleName( obj );
     159                                output << indent << mangleName( obj ); 
    172160                                if ( obj->get_init() ) {
    173161                                        output << " = ";
     
    177165                        } // for
    178166
    179                         cur_indent -= CodeGenerator::tabsize;
     167                        cur_indent -= CodeGenerator::tabsize; 
    180168
    181169                        output << indent << "}";
    182170                } // if
    183171        }
    184 
     172 
    185173        void CodeGenerator::visit( TraitDecl *aggregateDecl ) {}
    186 
     174 
    187175        void CodeGenerator::visit( TypedefDecl *typeDecl ) {
    188176                output << "typedef ";
    189177                output << genType( typeDecl->get_base(), typeDecl->get_name() );
    190178        }
    191 
     179 
    192180        void CodeGenerator::visit( TypeDecl *typeDecl ) {
    193181                // really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes,
     
    229217        }
    230218
    231         void CodeGenerator::visit( Constant *constant ) {
     219        void CodeGenerator::visit( Constant *constant ) { 
    232220                output << constant->get_value() ;
    233221        }
     
    246234                                                assert( arg != applicationExpr->get_args().end() );
    247235                                                if ( AddressExpr *addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
    248 
     236               
    249237                                                        *arg = addrExpr->get_arg();
    250238                                                } else {
     
    255243                                                break;
    256244                                        }
    257 
     245             
    258246                                  default:
    259247                                        // do nothing
    260248                                        ;
    261249                                }
    262 
     250           
    263251                                switch ( opInfo.type ) {
    264252                                  case OT_INDEX:
     
    269257                                        output << "]";
    270258                                        break;
    271 
     259             
    272260                                  case OT_CALL:
    273261                                        // there are no intrinsic definitions of the function call operator
    274262                                        assert( false );
    275263                                        break;
    276 
     264             
    277265                                  case OT_PREFIX:
    278266                                  case OT_PREFIXASSIGN:
     
    283271                                        output << ")";
    284272                                        break;
    285 
     273             
    286274                                  case OT_POSTFIX:
    287275                                  case OT_POSTFIXASSIGN:
     
    300288                                        output << ")";
    301289                                        break;
    302 
     290             
    303291                                  case OT_CONSTANT:
    304292                                  case OT_LABELADDRESS:
     
    319307                } // if
    320308        }
    321 
     309 
    322310        void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
    323311                if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
     
    333321                                        output << "]";
    334322                                        break;
    335 
     323             
    336324                                  case OT_CALL:
    337325                                        assert( false );
    338326                                        break;
    339 
     327             
    340328                                  case OT_PREFIX:
    341329                                  case OT_PREFIXASSIGN:
     
    347335                                        output << ")";
    348336                                        break;
    349 
     337             
    350338                                  case OT_POSTFIX:
    351339                                  case OT_POSTFIXASSIGN:
     
    354342                                        output << opInfo.symbol;
    355343                                        break;
    356 
     344 
    357345                                  case OT_INFIX:
    358346                                  case OT_INFIXASSIGN:
     
    364352                                        output << ")";
    365353                                        break;
    366 
     354                                       
    367355                                  case OT_CONSTANT:
    368356                                        // there are no intrinsic definitions of 0 or 1 as functions
     
    382370                } // if
    383371        }
    384 
     372 
    385373        void CodeGenerator::visit( NameExpr *nameExpr ) {
    386374                OperatorInfo opInfo;
     
    392380                } // if
    393381        }
    394 
     382 
    395383        void CodeGenerator::visit( AddressExpr *addressExpr ) {
    396384                output << "(&";
     
    421409                output << ")";
    422410        }
    423 
     411 
    424412        void CodeGenerator::visit( UntypedMemberExpr *memberExpr ) {
    425413                assert( false );
    426414        }
    427 
     415 
    428416        void CodeGenerator::visit( MemberExpr *memberExpr ) {
    429417                memberExpr->get_aggregate()->accept( *this );
    430418                output << "." << mangleName( memberExpr->get_member() );
    431419        }
    432 
     420 
    433421        void CodeGenerator::visit( VariableExpr *variableExpr ) {
    434422                OperatorInfo opInfo;
     
    439427                } // if
    440428        }
    441 
     429 
    442430        void CodeGenerator::visit( ConstantExpr *constantExpr ) {
    443431                assert( constantExpr->get_constant() );
    444432                constantExpr->get_constant()->accept( *this );
    445433        }
    446 
     434 
    447435        void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
    448436                output << "sizeof(";
     
    481469                assert( false && "OffsetPackExpr should not reach code generation" );
    482470        }
    483 
     471 
    484472        void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
    485473                output << "(";
     
    493481                output << ")";
    494482        }
    495 
     483 
    496484        void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
    497485                output << "(";
     
    503491                output << ")";
    504492        }
    505 
     493 
    506494        void CodeGenerator::visit( CommaExpr *commaExpr ) {
    507495                output << "(";
     
    511499                output << ")";
    512500        }
    513 
     501 
    514502        void CodeGenerator::visit( TupleExpr *tupleExpr ) {}
    515 
     503 
    516504        void CodeGenerator::visit( TypeExpr *typeExpr ) {}
    517505
     
    544532                        }
    545533                }
    546                 cur_indent -= CodeGenerator::tabsize;
     534                cur_indent -= CodeGenerator::tabsize; 
    547535
    548536                output << indent << "}";
     
    550538
    551539        void CodeGenerator::visit( ExprStmt *exprStmt ) {
    552                 // I don't see why this check is necessary.
    553                 // If this starts to cause problems then put it back in,
     540                // I don't see why this check is necessary. 
     541                // If this starts to cause problems then put it back in, 
    554542                // with an explanation
    555543                assert( exprStmt );
     
    601589                switchStmt->get_condition()->accept( *this );
    602590                output << " ) ";
    603 
     591               
    604592                output << "{" << std::endl;
    605593                cur_indent += CodeGenerator::tabsize;
     
    621609                } // if
    622610                output << ":\n";
    623 
     611               
    624612                std::list<Statement *> sts = caseStmt->get_statements();
    625613
     
    638626                        if ( ! branchStmt->get_target().empty() )
    639627                                output << "goto " << branchStmt->get_target();
    640                         else {
     628                        else { 
    641629                                if ( branchStmt->get_computedTarget() != 0 ) {
    642630                                        output << "goto *";
     
    689677
    690678        void CodeGenerator::visit( ForStmt *forStmt ) {
    691                 // initialization is always hoisted, so don't
    692                 // bother doing anything with that
     679                // initialization is always hoisted, so don't 
     680                // bother doing anything with that 
    693681                output << "for (;";
    694682
     
    714702        void CodeGenerator::visit( DeclStmt *declStmt ) {
    715703                declStmt->get_decl()->accept( *this );
    716 
     704       
    717705                if ( doSemicolon( declStmt->get_decl() ) ) {
    718706                        output << ";";
  • src/InitTweak/module.mk

    rd029162e r4acc87f  
    1111## Created On       : Mon Jun  1 17:49:17 2015
    1212## Last Modified By : Rob Schluntz
    13 ## Last Modified On : Wed May 04 16:03:49 2016
     13## Last Modified On : Mon Jan 11 14:40:16 2016
    1414## Update Count     : 2
    1515###############################################################################
    1616
    17 SRC += InitTweak/RemoveInit.cc \
    18         InitTweak/FixGlobalInit.cc
     17SRC += InitTweak/RemoveInit.cc
    1918
  • src/Makefile.in

    rd029162e r4acc87f  
    124124        GenPoly/driver_cfa_cpp-DeclMutator.$(OBJEXT) \
    125125        InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT) \
    126         InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT) \
    127126        Parser/driver_cfa_cpp-parser.$(OBJEXT) \
    128127        Parser/driver_cfa_cpp-lex.$(OBJEXT) \
     
    347346        GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
    348347        GenPoly/DeclMutator.cc InitTweak/RemoveInit.cc \
    349         InitTweak/FixGlobalInit.cc Parser/parser.yy Parser/lex.ll \
    350         Parser/TypedefTable.cc Parser/ParseNode.cc \
    351         Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
    352         Parser/StatementNode.cc Parser/InitializerNode.cc \
    353         Parser/TypeData.cc Parser/LinkageSpec.cc \
    354         Parser/parseutility.cc Parser/Parser.cc \
     348        Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \
     349        Parser/ParseNode.cc Parser/DeclarationNode.cc \
     350        Parser/ExpressionNode.cc Parser/StatementNode.cc \
     351        Parser/InitializerNode.cc Parser/TypeData.cc \
     352        Parser/LinkageSpec.cc Parser/parseutility.cc Parser/Parser.cc \
    355353        ResolvExpr/AlternativeFinder.cc ResolvExpr/Alternative.cc \
    356354        ResolvExpr/Unify.cc ResolvExpr/PtrsAssignable.cc \
     
    564562        @: > InitTweak/$(DEPDIR)/$(am__dirstamp)
    565563InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT):  \
    566         InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)
    567 InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT):  \
    568564        InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)
    569565Parser/parser.h: Parser/parser.cc
     
    796792        -rm -f GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT)
    797793        -rm -f GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT)
    798         -rm -f InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT)
    799794        -rm -f InitTweak/driver_cfa_cpp-RemoveInit.$(OBJEXT)
    800795        -rm -f Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT)
     
    902897@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@
    903898@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@
    904 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po@am__quote@
    905899@AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-RemoveInit.Po@am__quote@
    906900@AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po@am__quote@
     
    13861380@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-RemoveInit.obj `if test -f 'InitTweak/RemoveInit.cc'; then $(CYGPATH_W) 'InitTweak/RemoveInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/RemoveInit.cc'; fi`
    13871381
    1388 InitTweak/driver_cfa_cpp-FixGlobalInit.o: InitTweak/FixGlobalInit.cc
    1389 @am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc
    1390 @am__fastdepCXX_TRUE@   $(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po
    1391 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.o' libtool=no @AMDEPBACKSLASH@
    1392 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1393 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc
    1394 
    1395 InitTweak/driver_cfa_cpp-FixGlobalInit.obj: InitTweak/FixGlobalInit.cc
    1396 @am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`
    1397 @am__fastdepCXX_TRUE@   $(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po
    1398 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.obj' libtool=no @AMDEPBACKSLASH@
    1399 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    1400 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`
    1401 
    14021382Parser/driver_cfa_cpp-parser.o: Parser/parser.cc
    14031383@am__fastdepCXX_TRUE@   $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parser.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo -c -o Parser/driver_cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc
  • src/SynTree/Declaration.h

    rd029162e r4acc87f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Declaration.h --
     7// Declaration.h -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 11:16:45 2016
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Mar  2 17:28:11 2016
    1313// Update Count     : 33
    1414//
     
    106106        typedef DeclarationWithType Parent;
    107107  public:
    108         // temporary - merge this into general GCC attributes
    109         enum Attribute {
    110                 NoAttribute, Constructor, Destructor,
    111         };
    112 
    113         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute = NoAttribute );
     108        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn );
    114109        FunctionDecl( const FunctionDecl &other );
    115110        virtual ~FunctionDecl();
     
    124119        std::list< std::string >& get_oldIdents() { return oldIdents; }
    125120        std::list< Declaration* >& get_oldDecls() { return oldDecls; }
    126         Attribute get_attribute() const { return attribute; }
    127         void set_attribute( Attribute newValue ) { attribute = newValue; }
    128121
    129122        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    137130        std::list< std::string > oldIdents;
    138131        std::list< Declaration* > oldDecls;
    139         Attribute attribute;
    140132};
    141133
  • src/SynTree/FunctionDecl.cc

    rd029162e r4acc87f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FunctionDecl.cc --
     7// FunctionDecl.cc -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 11:35:09 2016
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jul 13 18:11:44 2015
    1313// Update Count     : 19
    1414//
     
    2121#include "Common/utility.h"
    2222
    23 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute )
    24                 : Parent( name, sc, linkage ), type( type ), statements( statements ), attribute( attribute ) {
     23FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn )
     24                : Parent( name, sc, linkage ), type( type ), statements( statements ) {
    2525        set_isInline( isInline );
    2626        set_isNoreturn( isNoreturn );
     
    3232
    3333FunctionDecl::FunctionDecl( const FunctionDecl &other )
    34         : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), attribute( other.attribute ) {
     34        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
    3535}
    3636
     
    5252        using std::endl;
    5353        using std::string;
    54 
     54       
    5555        if ( get_name() != "" ) {
    5656                os << get_name() << ": ";
     
    6565                os << "_Noreturn ";
    6666        } // if
    67         switch ( attribute ) {
    68                 case Constructor:
    69                         os << "Global Constructor ";
    70                         break;
    71                 case Destructor:
    72                         os << "Global Destructor ";
    73                         break;
    74                 default:
    75                         break;
    76         }
    7767        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    7868                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     
    10494        using std::endl;
    10595        using std::string;
    106 
     96       
    10797        if ( get_name() != "" ) {
    10898                os << get_name() << ": ";
     
    114104                os << "_Noreturn ";
    115105        } // if
    116         switch ( attribute ) {
    117                 case Constructor:
    118                         os << " Global Constructor ";
    119                         break;
    120                 case Destructor:
    121                         os << " Global Destructor ";
    122                         break;
    123                 default:
    124                         break;
    125         }
    126106        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    127107                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
  • src/main.cc

    rd029162e r4acc87f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // main.cc --
     7// main.cc -- 
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 14:04:49 2016
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed May  4 23:32:59 2016
    1313// Update Count     : 203
    1414//
     
    4141#include "InitTweak/Mutate.h"
    4242#include "InitTweak/RemoveInit.h"
    43 #include "InitTweak/FixGlobalInit.h"
    4443//#include "Explain/GenProlog.h"
    4544//#include "Try/Visit.h"
     
    9998        int long_index;
    10099        std::list< Declaration * > translationUnit;
    101         const char *filename = NULL;
     100        const char *filename = NULL;;
    102101
    103102        opterr = 0;                                                                                     // prevent getopt from printing error messages
    104 
     103       
    105104        int c;
    106105        while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:F:", long_opts, &long_index )) != -1 ) {
     
    181180                        input = fopen( argv[ optind ], "r" );
    182181                        if ( ! input ) {
    183                                 std::cout << "Error: can't open " << argv[ optind ] << std::endl;
     182                                std::cout << "Error: can't open " << argv[optind] << std::endl;
    184183                                exit( 1 );
    185184                        } // if
    186                         // if running cfa-cpp directly, might forget to pass -F option (and really shouldn't have to)
    187                         if ( filename == NULL ) filename = argv[ optind ];
    188185                        optind += 1;
    189186                } else {
     
    194191                        output = new ofstream( argv[ optind ] );
    195192                } // if
    196 
     193       
    197194                Parser::get_parser().set_debug( grammarp );
    198195
     
    215212                                        exit( 1 );
    216213                                } // if
    217 
     214                   
    218215                                parse( prelude, LinkageSpec::Intrinsic );
    219216                        } // if
    220217                } // if
    221218
    222                 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );
    223 
     219                parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );     
     220 
    224221                if ( parsep ) {
    225222                        Parser::get_parser().get_parseTree()->printList( std::cout );
     
    256253                OPTPRINT( "mutate" )
    257254                ControlStruct::mutate( translationUnit );
    258                 OPTPRINT( "fixNames" )
     255                OPTPRINT( "fixNames" ) 
    259256                CodeGen::fixNames( translationUnit );
    260                 OPTPRINT( "fixGlobalInit" );
    261                 InitTweak::fixGlobalInit( translationUnit, filename );
    262257                OPTPRINT( "tweak" )
    263258                InitTweak::tweak( translationUnit );
     
    287282                OPTPRINT( "box" )
    288283                GenPoly::box( translationUnit );
    289 
     284               
    290285                // print tree right before code generation
    291286                if ( codegenp ) {
     
    343338        std::list< Declaration * > decls;
    344339        if ( noprotop ) {
    345                 filter( translationUnit.begin(), translationUnit.end(),
     340                filter( translationUnit.begin(), translationUnit.end(), 
    346341                                std::back_inserter( decls ), notPrelude );
    347342        } else {
Note: See TracChangeset for help on using the changeset viewer.