Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.h

    re04ef3a r888cbe4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CodeGenerator.h -- 
     7// CodeGenerator.h --
    88//
    99// Author           : Richard C. Bilson
     
    6060                virtual void visit( MemberExpr *memberExpr );
    6161                virtual void visit( VariableExpr *variableExpr );
    62                 virtual void visit( ConstantExpr *constantExpr ); 
     62                virtual void visit( ConstantExpr *constantExpr );
    6363                virtual void visit( SizeofExpr *sizeofExpr );
    6464                virtual void visit( AlignofExpr *alignofExpr );
     
    8585                virtual void visit( ForStmt * );
    8686                virtual void visit( NullStmt * );
    87                 virtual void visit( DeclStmt * );
     87                virtual void visit( DeclStmt * );
     88
     89                void genAttributes( std::list< Attribute * > & attributes );
    8890
    8991                template< class Iterator > void genCommaList( Iterator begin, Iterator end );
     
    9294                        Indenter(CodeGenerator &cg) : cg(cg) {}
    9395                        CodeGenerator & cg;
    94                         std::ostream& operator()(std::ostream & os);
     96                        std::ostream& operator()(std::ostream & os) const;
     97                };
     98
     99                struct LabelPrinter {
     100                        LabelPrinter(CodeGenerator &cg) : cg(cg), labels( 0 ) {}
     101                        LabelPrinter & operator()( std::list< Label > & l );
     102                        CodeGenerator & cg;
     103                        std::list< Label > * labels;
    95104                };
    96105
     
    106115                bool insideFunction;
    107116                std::ostream &output;
     117                LabelPrinter printLabels;
    108118
    109119                void printDesignators( std::list< Expression * > & );
    110                 static std::string printLabels ( std::list < Label > & );
    111120                void handleStorageClass( Declaration *decl );
    112121                void handleAggregate( AggregateDecl *aggDecl );
     
    114123
    115124        };
    116        
     125
    117126        template< class Iterator >
    118127        void CodeGenerator::genCommaList( Iterator begin, Iterator end ) {
     
    125134                } // for
    126135        }
    127  
     136
    128137        inline bool doSemicolon( Declaration* decl ) {
    129138                if ( FunctionDecl* func = dynamic_cast< FunctionDecl* >( decl ) ) {
Note: See TracChangeset for help on using the changeset viewer.