Changeset 937e51d for src/SynTree


Ignore:
Timestamp:
Jun 26, 2015, 4:00:26 PM (11 years ago)
Author:
Aaron Moss <a3moss@…>
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, string, with_gc
Children:
0df292b, e0ff3e6
Parents:
eb50842 (diff), 1869adf (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 pointer to pointer to qualified fix into master

Location:
src/SynTree
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AggregateDecl.cc

    reb50842 r937e51d  
    1010// Created On       : Sun May 17 23:56:39 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 16:52:08 2015
    13 // Update Count     : 5
     12// Last Modified On : Sat Jun 13 08:12:49 2015
     13// Update Count     : 6
    1414//
    1515
     
    1919
    2020
    21 AggregateDecl::AggregateDecl( const std::string &name ) : Parent( name, Declaration::NoStorageClass, LinkageSpec::Cforall ) {
     21AggregateDecl::AggregateDecl( const std::string &name ) : Parent( name, DeclarationNode::NoStorageClass, LinkageSpec::Cforall ) {
    2222}
    2323
  • src/SynTree/ArrayType.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 07:52:08 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun  6 14:11:48 2015
     13// Update Count     : 9
    1414//
    1515
     
    2525
    2626ArrayType::ArrayType( const ArrayType &other )
    27         : Type( other ), base( maybeClone( other.base ) ), dimension( maybeClone( other.dimension ) ),
    28           isVarLen( other.isVarLen ), isStatic( other.isStatic ) {
     27                : Type( other ), base( maybeClone( other.base ) ), dimension( maybeClone( other.dimension ) ),
     28                  isVarLen( other.isVarLen ), isStatic( other.isStatic ) {
    2929}
    3030
     
    4343        } else if ( dimension ) {
    4444                os << "array of ";
    45                 dimension->print( os, indent );
    4645        } else {
    4746                os << "open array of ";
     
    4948        if ( base ) {
    5049                base->print( os, indent );
     50        } // if
     51        if ( dimension ) {
     52                os << "with dimension of ";
     53                dimension->print( os, indent );
    5154        } // if
    5255}
  • src/SynTree/BasicType.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 07:55:16 2015
    13 // Update Count     : 1
     12// Last Modified On : Sun Jun  7 08:44:36 2015
     13// Update Count     : 5
    1414//
    1515
  • src/SynTree/CompoundStmt.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:11:02 2015
    13 // Update Count     : 1
     12// Last Modified On : Tue Jun 23 11:37:49 2015
     13// Update Count     : 3
    1414//
    1515
     
    3333}
    3434
    35 void CompoundStmt::print( std::ostream &os, int indent ) {
    36         os << "\r" << string(indent, ' ') << "CompoundStmt" << endl ;
    37         printAll( kids, os, indent+2 );
     35void CompoundStmt::print( std::ostream &os, int indent ) const {
     36        os << string( indent, ' ' ) << "CompoundStmt" << endl ;
     37        printAll( kids, os, indent + 2 );
    3838}
    3939
  • src/SynTree/Constant.cc

    reb50842 r937e51d  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:13:25 2015
    13 // Update Count     : 1
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jun 10 14:41:03 2015
     13// Update Count     : 8
    1414//
    1515
     
    2020#include "Type.h"
    2121
    22 Constant::Constant( Type *_type, std::string _value ) : type(_type), value(_value) {}
     22Constant::Constant( Type *type_, std::string value_ ) : type( type_ ), value( value_ ) {}
    2323
    2424Constant::~Constant() {}
     
    2727
    2828void Constant::print( std::ostream &os ) const {
    29         os << value;
     29        os << "(" << value;
    3030        if ( type ) {
    31                 os << " (type: ";
     31                os << ": ";
    3232                type->print( os );
    33                 os << ")";
    3433        } // if
     34  os << ")";
    3535}
    3636
  • src/SynTree/DeclStmt.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:16:03 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue Jun 23 11:38:15 2015
     13// Update Count     : 4
    1414//
    1515
     
    2828}
    2929
    30 void DeclStmt::print( std::ostream &os, int indent ) {
     30void DeclStmt::print( std::ostream &os, int indent ) const {
     31        assert( decl != 0 );
    3132        os << "Declaration of ";
    32         if ( decl ) {
    33                 decl->print( os, indent );
    34         } // if
     33        decl->print( os, indent );
    3534}
    3635
  • src/SynTree/Declaration.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:18:35 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun 13 08:07:20 2015
     13// Update Count     : 9
    1414//
    1515
     
    2222#include "utility.h"
    2323
    24 const char* Declaration::storageClassName[] = { "", "auto", "static", "extern", "register" }; 
    25 
    2624static UniqueId lastUniqueId = 0;
    2725typedef std::map< UniqueId, Declaration* > IdMapType;
    2826static IdMapType idMap;
    2927
    30 Declaration::Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )
    31         : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
     28Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
     29                : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
    3230}
    3331
    3432Declaration::Declaration( const Declaration &other )
    35         : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {
     33                : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {
    3634}
    3735
     
    4442}
    4543
    46 /* static class method */
    4744Declaration *Declaration::declFromId( UniqueId id ) {
    4845        IdMapType::const_iterator i = idMap.find( id );
    49         if ( i != idMap.end() ) {
    50                 return i->second;
    51         } else {
    52                 return 0;
    53         } // if
     46        return i != idMap.end() ? i->second : 0;
    5447}
    5548
    56 /* static class method */
    5749void Declaration::dumpIds( std::ostream &os ) {
    5850        for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
  • src/SynTree/Declaration.h

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:46:25 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun 13 09:10:31 2015
     13// Update Count     : 25
    1414//
    1515
     
    2121#include "Mutator.h"
    2222#include "Parser/LinkageSpec.h"
     23#include "Parser/ParseNode.h"
    2324
    2425class Declaration {
    2526  public:
    26         enum StorageClass { 
    27                 NoStorageClass,
    28                 Extern,
    29                 Static,
    30                 Auto,
    31                 Register,
    32                 Inline,
    33                 Fortran,
    34         };     
    35 
    36         Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
     27        Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
    3728        Declaration( const Declaration &other );
    3829        virtual ~Declaration();
    3930
    40         std::string get_name() const { return name; }
     31        const std::string &get_name() const { return name; }
    4132        void set_name( std::string newValue ) { name = newValue; }
    42         StorageClass get_storageClass() const { return storageClass; }
    43         void set_storageClass( StorageClass newValue ) { storageClass = newValue; }
     33        DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
     34        void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
    4435        LinkageSpec::Type get_linkage() const { return linkage; }
    4536        void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; }
     
    5344        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
    5445
    55         static const char* storageClassName[]; 
    56 
    5746        static void dumpIds( std::ostream &os );
    5847        static Declaration *declFromId( UniqueId id );
    5948  private:
    6049        std::string name;
    61         StorageClass storageClass;
     50        DeclarationNode::StorageClass storageClass;
    6251        LinkageSpec::Type linkage;
    6352        UniqueId uniqueId;
     
    6655class DeclarationWithType : public Declaration {
    6756  public:
    68         DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
     57        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
    6958        DeclarationWithType( const DeclarationWithType &other );
    7059        virtual ~DeclarationWithType();
     
    8675        typedef DeclarationWithType Parent;
    8776  public:
    88         ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
     77        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
    8978        ObjectDecl( const ObjectDecl &other );
    9079        virtual ~ObjectDecl();
     
    112101        typedef DeclarationWithType Parent;
    113102  public:
    114         FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline );
     103        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn );
    115104        FunctionDecl( const FunctionDecl &other );
    116105        virtual ~FunctionDecl();
     
    123112        CompoundStmt *get_statements() const { return statements; }
    124113        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
    125 //    bool get_isInline() const { return isInline; }
    126 //    void set_isInline( bool newValue ) { isInline = newValue; }
     114        bool get_isInline() const { return isInline; }
     115        bool get_isNoreturn() const { return isNoreturn; }
    127116        std::list< std::string >& get_oldIdents() { return oldIdents; }
    128117        std::list< Declaration* >& get_oldDecls() { return oldDecls; }
     
    136125        FunctionType *type;
    137126        CompoundStmt *statements;
    138         bool isInline;
     127        bool isInline, isNoreturn;
    139128        std::list< std::string > oldIdents;
    140129        std::list< Declaration* > oldDecls;
     
    144133        typedef Declaration Parent;
    145134  public:
    146         NamedTypeDecl( const std::string &name, StorageClass sc, Type *type );
     135        NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );
    147136        NamedTypeDecl( const TypeDecl &other );
    148137        virtual ~NamedTypeDecl();
     
    169158        enum Kind { Any, Dtype, Ftype };
    170159
    171         TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind );
     160        TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind );
    172161        TypeDecl( const TypeDecl &other );
    173162
     
    185174        typedef NamedTypeDecl Parent;
    186175  public:
    187         TypedefDecl( const std::string &name, StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
     176        TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
    188177        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    189178
  • src/SynTree/DeclarationWithType.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:20:23 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun 13 08:08:07 2015
     13// Update Count     : 3
    1414//
    1515
     
    1818#include "utility.h"
    1919
    20 DeclarationWithType::DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )
     20DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
    2121                : Declaration( name, sc, linkage ) {
    2222}
  • src/SynTree/Expression.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:27:07 2015
    13 // Update Count     : 2
     12// Last Modified On : Sun Jun  7 08:40:46 2015
     13// Update Count     : 16
    1414//
    1515
     
    5050}
    5151
    52 void Expression::print(std::ostream &os, int indent) const {
     52void Expression::print( std::ostream &os, int indent ) const {
    5353        if ( env ) {
    54                 os << std::string(indent, ' ') << "with environment:" << std::endl;
     54                os << std::string( indent, ' ' ) << "with environment:" << std::endl;
    5555                env->print( os, indent+2 );
    5656        } // if
    5757
    5858        if ( argName ) {
    59                 os << std::string(indent, ' ') << "with designator:";
     59                os << std::string( indent, ' ' ) << "with designator:";
    6060                argName->print( os, indent+2 );
    6161        } // if
     
    7272
    7373void ConstantExpr::print( std::ostream &os, int indent ) const {
    74         os << std::string(indent, ' ') << "Constant Expression: " ;
    75         constant.print(os);
    76         os << std::endl;
     74        os << "constant expression " ;
     75        constant.print( os );
    7776        Expression::print( os, indent );
    7877}
     
    9392
    9493void VariableExpr::print( std::ostream &os, int indent ) const {
    95         os << std::string(indent, ' ') << "Variable Expression: ";
     94        os << std::string( indent, ' ' ) << "Variable Expression: ";
    9695
    9796        Declaration *decl = get_var();
     
    122121
    123122void SizeofExpr::print( std::ostream &os, int indent) const {
    124         os << std::string(indent, ' ') << "Sizeof Expression on: ";
     123        os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
    125124
    126125        if (isType)
     
    152151
    153152void AttrExpr::print( std::ostream &os, int indent) const {
    154         os << std::string(indent, ' ') << "Attr ";
     153        os << std::string( indent, ' ' ) << "Attr ";
    155154        attr->print( os, indent + 2 );
    156155        if ( isType || expr ) {
     
    184183
    185184void CastExpr::print( std::ostream &os, int indent ) const {
    186         os << std::string(indent, ' ') << "Cast of:" << std::endl;
     185        os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
    187186        arg->print(os, indent+2);
    188         os << std::endl << std::string(indent, ' ') << "to:" << std::endl;
     187        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
    189188        if ( results.empty() ) {
    190                 os << std::string(indent+2, ' ') << "nothing" << std::endl;
     189                os << std::string( indent+2, ' ' ) << "nothing" << std::endl;
    191190        } else {
    192191                printAll(results, os, indent+2);
     
    207206
    208207void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
    209         os << std::string(indent, ' ') << "Member Expression, with field: " << get_member();
     208        os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
    210209
    211210        Expression *agg = get_aggregate();
    212         os << std::string(indent, ' ') << "from aggregate: ";
     211        os << std::string( indent, ' ' ) << "from aggregate: ";
    213212        if (agg != 0) agg->print(os, indent + 2);
    214213        Expression::print( os, indent );
     
    234233
    235234void MemberExpr::print( std::ostream &os, int indent ) const {
    236         os << std::string(indent, ' ') << "Member Expression, with field: " << std::endl;
     235        os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
    237236
    238237        assert( member );
    239         os << std::string(indent + 2, ' ');
     238        os << std::string( indent + 2, ' ' );
    240239        member->print( os, indent + 2 );
    241240        os << std::endl;
    242241
    243242        Expression *agg = get_aggregate();
    244         os << std::string(indent, ' ') << "from aggregate: " << std::endl;
     243        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
    245244        if (agg != 0) agg->print(os, indent + 2);
    246245        Expression::print( os, indent );
     
    261260
    262261void UntypedExpr::print( std::ostream &os, int indent ) const {
    263         os << std::string(indent, ' ') << "Applying untyped: " << std::endl;
     262        os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
    264263        function->print(os, indent + 4);
    265         os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;
     264        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    266265        printArgs(os, indent + 4);
    267266        Expression::print( os, indent );
     
    282281
    283282void NameExpr::print( std::ostream &os, int indent ) const {
    284         os << std::string(indent, ' ') << "Name: " << get_name() << std::endl;
     283        os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
    285284        Expression::print( os, indent );
    286285}
     
    301300
    302301void LogicalExpr::print( std::ostream &os, int indent )const {
    303         os << std::string(indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
     302        os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    304303        arg1->print(os);
    305304        os << " and ";
     
    323322
    324323void ConditionalExpr::print( std::ostream &os, int indent ) const {
    325         os << std::string(indent, ' ') << "Conditional expression on: " << std::endl;
     324        os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl;
    326325        arg1->print( os, indent+2 );
    327         os << std::string(indent, ' ') << "First alternative:" << std::endl;
     326        os << std::string( indent, ' ' ) << "First alternative:" << std::endl;
    328327        arg2->print( os, indent+2 );
    329         os << std::string(indent, ' ') << "Second alternative:" << std::endl;
     328        os << std::string( indent, ' ' ) << "Second alternative:" << std::endl;
    330329        arg3->print( os, indent+2 );
    331330        os << std::endl;
     
    334333
    335334void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    336         os << std::string(indent, ' ') << "Valof Expression: " << std::endl;
     335        os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
    337336        if ( get_body() != 0 )
    338337                get_body()->print( os, indent + 2 );
  • src/SynTree/Expression.h

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:46:15 2015
    13 // Update Count     : 3
     12// Last Modified On : Sun Jun  7 22:03:44 2015
     13// Update Count     : 4
    1414//
    1515
     
    125125        virtual ~NameExpr();
    126126
    127         std::string get_name() const { return name; }
     127        const std::string &get_name() const { return name; }
    128128        void set_name( std::string newValue ) { name = newValue; }
    129129
  • src/SynTree/FunctionDecl.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 21 21:31:16 2015
    13 // Update Count     : 11
     12// Last Modified On : Sat Jun 13 09:10:32 2015
     13// Update Count     : 16
    1414//
    1515
     
    2121#include "utility.h"
    2222
    23 FunctionDecl::FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline )
    24                 : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ) {
     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 ), isInline( isInline ), isNoreturn( isNoreturn ) {
    2525        // this is a brazen hack to force the function "main" to have C linkage
    2626        if ( name == "main" ) {
     
    3030
    3131FunctionDecl::FunctionDecl( const FunctionDecl &other )
    32                 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ) {
     32        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ), isNoreturn( other.isNoreturn ) {
    3333}
    3434
     
    5252       
    5353        if ( get_name() != "" ) {
    54                 os << get_name() << ": a ";
     54                os << get_name() << ": ";
    5555        } // if
    5656        if ( get_linkage() != LinkageSpec::Cforall ) {
     
    6060                os << "inline ";
    6161        } // if
    62         if ( get_storageClass() != NoStorageClass ) {
    63                 os << storageClassName[ get_storageClass() ] << ' ';
     62        if ( isNoreturn ) {
     63                os << "_Noreturn ";
     64        } // if
     65        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     66                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    6467        } // if
    6568        if ( get_type() ) {
     
    7073
    7174        if ( ! oldIdents.empty() ) {
    72                 os << string( indent+2, ' ' ) << "with parameter names" << endl;
     75                os << string( indent + 2, ' ' ) << "with parameter names" << endl;
    7376                for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
    74                         os << string( indent+4, ' ' ) << *i << endl;
     77                        os << string( indent + 4, ' ' ) << *i << endl;
    7578                } // for
    7679        } // if
    7780
    7881        if ( ! oldDecls.empty() ) {
    79                 os << string( indent+2, ' ' ) << "with parameter declarations" << endl;
    80                 printAll( oldDecls, os, indent+4 );
     82                os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;
     83                printAll( oldDecls, os, indent + 4 );
    8184        } // if
    8285        if ( statements ) {
    83                 os << string( indent+2, ' ' ) << "with body " << endl;
    84                 statements->print( os, indent+4 );
     86                os << string( indent + 2, ' ' ) << "with body " << endl;
     87                statements->print( os, indent + 4 );
    8588        } // if
    8689}
     
    9194       
    9295        if ( get_name() != "" ) {
    93                 os << get_name() << ": a ";
     96                os << get_name() << ": ";
    9497        } // if
    9598        if ( isInline ) {
    9699                os << "inline ";
    97100        } // if
    98         if ( get_storageClass() != NoStorageClass ) {
    99                 os << storageClassName[ get_storageClass() ] << ' ';
     101        if ( isNoreturn ) {
     102                os << "_Noreturn ";
     103        } // if
     104        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     105                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    100106        } // if
    101107        if ( get_type() ) {
  • src/SynTree/Mutator.h

    reb50842 r937e51d  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:12:28 2015
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri May 29 16:34:08 2015
     13// Update Count     : 4
    1414//
    1515#include <cassert>
     
    104104                assert( newnode );
    105105                return newnode;
    106 ///         return tree->acceptMutator( mutator );
    107106        } else {
    108107                return 0;
  • src/SynTree/NamedTypeDecl.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:13:19 2015
    13 // Update Count     : 1
     12// Last Modified On : Sat Jun 13 08:13:55 2015
     13// Update Count     : 3
    1414//
    1515
     
    1818#include "utility.h"
    1919
    20 NamedTypeDecl::NamedTypeDecl( const std::string &name, StorageClass sc, Type *base )
     20NamedTypeDecl::NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *base )
    2121        : Parent( name, sc, LinkageSpec::Cforall ), base( base ) {}
    2222
     
    3737       
    3838        if ( get_name() != "" ) {
    39                 os << get_name() << ": a ";
     39                os << get_name() << ": ";
    4040        } // if
    41         if ( get_storageClass() != NoStorageClass ) {
    42                 os << storageClassName[ get_storageClass() ] << ' ';
     41        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     42                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    4343        } // if
    4444        os << typeString();
     
    6161       
    6262        if ( get_name() != "" ) {
    63                 os << get_name() << ": a ";
     63                os << get_name() << ": ";
    6464        } // if
    65         if ( get_storageClass() != NoStorageClass ) {
    66                 os << storageClassName[ get_storageClass() ] << ' ';
     65        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     66                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    6767        } // if
    6868        os << typeString();
  • src/SynTree/ObjectDecl.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:14:18 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun 13 08:10:16 2015
     13// Update Count     : 15
    1414//
    1515
     
    2020#include "utility.h"
    2121
    22 ObjectDecl::ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init )
     22ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init )
    2323        : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
    2424}
     
    3636void ObjectDecl::print( std::ostream &os, int indent ) const {
    3737        if ( get_name() != "" ) {
    38                 os << get_name() << ": a ";
     38                os << get_name() << ": ";
    3939        } // if
    4040
     
    4343        } // if
    4444
    45         if ( get_storageClass() != NoStorageClass ) {
    46                 os << storageClassName[ get_storageClass() ] << ' ';
     45        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     46                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    4747        } // if
    4848
     
    6565
    6666void ObjectDecl::printShort( std::ostream &os, int indent ) const {
     67#if 0
     68        if ( get_mangleName() != "") {
     69                os << get_mangleName() << ": ";
     70        } else
     71#endif
    6772        if ( get_name() != "" ) {
    68                 os << get_name() << ": a ";
     73                os << get_name() << ": ";
    6974        } // if
    7075
    71         if ( get_storageClass() != NoStorageClass ) {
    72                 os << storageClassName[ get_storageClass() ] << ' ';
     76        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
     77                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
    7378        } // if
    7479
  • src/SynTree/ReferenceToType.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 16:52:40 2015
    13 // Update Count     : 3
     12// Last Modified On : Sun Jun  7 08:31:48 2015
     13// Update Count     : 4
    1414//
    1515
     
    101101       
    102102        Type::print( os, indent );
    103         os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " a function type) ";
     103        os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) ";
    104104        if ( ! parameters.empty() ) {
    105105                os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
  • src/SynTree/Statement.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:55:19 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue Jun 23 11:42:09 2015
     13// Update Count     : 21
    1414//
    1515
     
    3030Statement::Statement( std::list<Label> _labels ) : labels(_labels ) {}
    3131
    32 void Statement::print( std::ostream &, int indent ) {}
     32void Statement::print( std::ostream &, int indent ) const {}
    3333
    3434Statement::~Statement() {}
     
    3838ExprStmt::~ExprStmt() {}
    3939
    40 void ExprStmt::print( std::ostream &os, int indent ) {
    41         os << "\r" << string(indent, ' ') << "Expression Statement:" << endl;
     40void ExprStmt::print( std::ostream &os, int indent ) const {
     41        os << string( indent, ' ' ) << "Expression Statement:" << endl;
    4242        expr->print( os, indent + 2 );
    4343}
     
    4646
    4747BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
    48         Statement( labels ), target(_target ), type(_type ) {
     48        Statement( labels ), originalTarget(_target ), target(_target ), type(_type ) {
    4949        //actually this is a syntactic error signaled by the parser
    5050        if ( type == BranchStmt::Goto && target.size() == 0 )
     
    5858}
    5959
    60 void BranchStmt::print( std::ostream &os, int indent ) {
    61         os << "\r" << string( indent, ' ') << "Branch (" << brType[type] << ")" << endl ;
     60void BranchStmt::print( std::ostream &os, int indent ) const {
     61        os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ;
    6262}
    6363
     
    6868}
    6969
    70 void ReturnStmt::print( std::ostream &os, int indent ) {
    71         os << "\r" << std::string( indent, ' ') << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
     70void ReturnStmt::print( std::ostream &os, int indent ) const {
     71        os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
    7272        if ( expr != 0 ) expr->print( os );
    7373        os << endl;
     
    7979IfStmt::~IfStmt() {}
    8080
    81 void IfStmt::print( std::ostream &os, int indent ) {
    82         os << "\r" << string( indent, ' ') << "If on condition: " << endl ;
     81void IfStmt::print( std::ostream &os, int indent ) const {
     82        os << string( indent, ' ' ) << "If on condition: " << endl ;
    8383        condition->print( os, indent + 4 );
    8484
    85         os << string( indent, ' ') << ".... and branches: " << endl;
     85        os << string( indent, ' ' ) << ".... and branches: " << endl;
    8686
    8787        thenPart->print( os, indent + 4 );
     
    103103void SwitchStmt::add_case( CaseStmt *c ) {}
    104104
    105 void SwitchStmt::print( std::ostream &os, int indent ) {
    106         os << "\r" << string( indent, ' ') << "Switch on condition: ";
     105void SwitchStmt::print( std::ostream &os, int indent ) const {
     106        os << string( indent, ' ' ) << "Switch on condition: ";
    107107        condition->print( os );
    108108        os << endl;
    109109
    110110        // branches
    111         std::list<Statement *>::iterator i;
     111        std::list<Statement *>::const_iterator i;
    112112        for ( i = branches.begin(); i != branches.end(); i++)
    113                 (*i )->print( os, indent + 4 );
     113                (*i)->print( os, indent + 4 );
    114114
    115115        //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));
     
    126126}
    127127
    128 void CaseStmt::print( std::ostream &os, int indent ) {
    129         os << "\r" << string( indent, ' ');
    130 
    131         if ( isDefault())
     128CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) {
     129        return new CaseStmt( labels, 0, branches, true );
     130}
     131
     132void CaseStmt::print( std::ostream &os, int indent ) const {
     133        os << string( indent, ' ' );
     134
     135        if ( isDefault() )
    132136                os << "Default ";
    133137        else {
     
    138142        os << endl;
    139143
    140         std::list<Statement *>::iterator i;
     144        std::list<Statement *>::const_iterator i;
    141145        for ( i = stmts.begin(); i != stmts.end(); i++)
    142146                (*i )->print( os, indent + 4 );
     
    154158void ChooseStmt::add_case( CaseStmt *c ) {}
    155159
    156 void ChooseStmt::print( std::ostream &os, int indent ) {
    157         os << "\r" << string( indent, ' ') << "Choose on condition: ";
     160void ChooseStmt::print( std::ostream &os, int indent ) const {
     161        os << string( indent, ' ' ) << "Choose on condition: ";
    158162        condition->print( os );
    159163        os << endl;
    160164
    161165        // branches
    162         std::list<Statement *>::iterator i;
     166        std::list<Statement *>::const_iterator i;
    163167        for ( i = branches.begin(); i != branches.end(); i++)
    164168                (*i )->print( os, indent + 4 );
     
    167171}
    168172
    169 void FallthruStmt::print( std::ostream &os, int indent ) {
    170         os << "\r" << string( indent, ' ') << "Fall-through statement" << endl;
     173void FallthruStmt::print( std::ostream &os, int indent ) const {
     174        os << string( indent, ' ' ) << "Fall-through statement" << endl;
    171175}
    172176
     
    179183}
    180184
    181 void WhileStmt::print( std::ostream &os, int indent ) {
    182         os << "\r" << string( indent, ' ') << "While on condition: " << endl ;
     185void WhileStmt::print( std::ostream &os, int indent ) const {
     186        os << string( indent, ' ' ) << "While on condition: " << endl ;
    183187        condition->print( os, indent + 4 );
    184188
    185         os << string( indent, ' ') << ".... with body: " << endl;
     189        os << string( indent, ' ' ) << ".... with body: " << endl;
    186190
    187191        if ( body != 0 ) body->print( os, indent + 4 );
     
    199203}
    200204
    201 void ForStmt::print( std::ostream &os, int indent ) {
    202         os << "\r" << string( indent, ' ') << "For Statement" << endl ;
    203 
    204         os << "\r" << string( indent + 2, ' ') << "initialization: \n";
     205void ForStmt::print( std::ostream &os, int indent ) const {
     206        os << string( indent, ' ' ) << "Labels: {";
     207        for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
     208                os << *it << ",";
     209        }
     210        os << "}" << endl;
     211
     212        os << string( indent, ' ' ) << "For Statement" << endl ;
     213
     214        os << string( indent + 2, ' ' ) << "initialization: \n";
    205215        if ( initialization != 0 )
    206216                initialization->print( os, indent + 4 );
    207217
    208         os << "\n\r" << string( indent + 2, ' ') << "condition: \n";
     218        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
    209219        if ( condition != 0 )
    210220                condition->print( os, indent + 4 );
    211221
    212         os << "\n\r" << string( indent + 2, ' ') << "increment: \n";
     222        os << "\n" << string( indent + 2, ' ' ) << "increment: \n";
    213223        if ( increment != 0 )
    214224                increment->print( os, indent + 4 );
    215225
    216         os << "\n\r" << string( indent + 2, ' ') << "statement block: \n";
     226        os << "\n" << string( indent + 2, ' ' ) << "statement block: \n";
    217227        if ( body != 0 )
    218228                body->print( os, indent + 4 );
     
    235245}
    236246
    237 void TryStmt::print( std::ostream &os, int indent ) {
    238         os << "\r" << string( indent, ' ') << "Try Statement" << endl;
    239         os << string( indent + 2, ' ') << "with block: " << endl;
     247void TryStmt::print( std::ostream &os, int indent ) const {
     248        os << string( indent, ' ' ) << "Try Statement" << endl;
     249        os << string( indent + 2, ' ' ) << "with block: " << endl;
    240250        block->print( os, indent + 4 );
    241251
    242252        // handlers
    243         os << string( indent + 2, ' ') << "and handlers: " << endl;
    244         std::list<Statement *>::iterator i;
    245         for ( i = handlers.begin(); i != handlers.end(); i++)
     253        os << string( indent + 2, ' ' ) << "and handlers: " << endl;
     254        for ( std::list<Statement *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
    246255                (*i )->print( os, indent + 4 );
    247256
    248257        // finally block
    249258        if ( finallyBlock != 0 ) {
    250                 os << string( indent + 2, ' ') << "Finally block: " << endl;
     259                os << string( indent + 2, ' ' ) << "Finally block: " << endl;
    251260                finallyBlock->print( os, indent + 4 );
    252261        } // if
     
    262271}
    263272
    264 void CatchStmt::print( std::ostream &os, int indent ) {
    265         os << "\r" << string( indent, ' ') << "Catch Statement" << endl;
    266 
    267         os << "\r" << string( indent, ' ') << "... catching" << endl;
     273void CatchStmt::print( std::ostream &os, int indent ) const {
     274        os << string( indent, ' ' ) << "Catch Statement" << endl;
     275
     276        os << string( indent, ' ' ) << "... catching" << endl;
    268277        if ( decl ) {
    269278                decl->printShort( os, indent + 4 );
    270279                os << endl;
    271280        } else if ( catchRest )
    272                 os << "\r" << string( indent + 4 , ' ') << "the rest" << endl;
     281                os << string( indent + 4 , ' ' ) << "the rest" << endl;
    273282        else
    274                 os << "\r" << string( indent + 4 , ' ') << ">>> Error:  this catch clause must have a declaration <<<" << endl;
     283                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
    275284}
    276285
     
    284293}
    285294
    286 void FinallyStmt::print( std::ostream &os, int indent ) {
    287         os << "\r" << string( indent, ' ') << "Finally Statement" << endl;
    288         os << string( indent + 2, ' ') << "with block: " << endl;
     295void FinallyStmt::print( std::ostream &os, int indent ) const {
     296        os << string( indent, ' ' ) << "Finally Statement" << endl;
     297        os << string( indent + 2, ' ' ) << "with block: " << endl;
    289298        block->print( os, indent + 4 );
    290299}
     
    294303NullStmt::~NullStmt() {}
    295304
    296 void NullStmt::print( std::ostream &os, int indent ) {
    297         os << "\r" << string( indent, ' ') << "Null Statement" << endl ;
     305void NullStmt::print( std::ostream &os, int indent ) const {
     306        os << string( indent, ' ' ) << "Null Statement" << endl ;
    298307}
    299308
  • src/SynTree/Statement.h

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 10:57:40 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue Jun 23 11:44:27 2015
     13// Update Count     : 20
    1414//
    1515
     
    2828
    2929        std::list<Label> & get_labels() { return labels; }
     30        const std::list<Label> & get_labels() const { return labels; }
    3031
    3132        virtual Statement *clone() const = 0;
    3233        virtual void accept( Visitor &v ) = 0;
    3334        virtual Statement *acceptMutator( Mutator &m ) = 0;
    34         virtual void print( std::ostream &os, int indent = 0 );
     35        virtual void print( std::ostream &os, int indent = 0 ) const;
    3536  protected:
    3637        std::list<Label> labels;
     
    4849        virtual void accept( Visitor &v ) { v.visit( this ); }
    4950        virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    50         virtual void print( std::ostream &os, int indent = 0 );
     51        virtual void print( std::ostream &os, int indent = 0 ) const;
    5152  private:
    5253        std::list<Statement*> kids;
     
    6465        virtual void accept( Visitor &v ) { v.visit( this ); }
    6566        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    66         virtual void print( std::ostream &os, int indent = 0 );
     67        virtual void print( std::ostream &os, int indent = 0 ) const;
    6768  private:
    6869        Expression *expr;
     
    8485        virtual void accept( Visitor &v ) { v.visit( this ); }
    8586        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    86         virtual void print( std::ostream &os, int indent = 0 );
     87        virtual void print( std::ostream &os, int indent = 0 ) const;
    8788  private:
    8889        Expression *condition;
     
    106107
    107108        virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
    108         virtual void print( std::ostream &os, int indent = 0 );
     109        virtual void print( std::ostream &os, int indent = 0 ) const;
    109110  private:
    110111        Expression * condition;
     
    127128
    128129        virtual ChooseStmt *clone() const { return new ChooseStmt( *this ); }
    129         virtual void print( std::ostream &os, int indent = 0 );
     130        virtual void print( std::ostream &os, int indent = 0 ) const;
    130131  private:
    131132        Expression *condition;
     
    141142
    142143        virtual FallthruStmt *clone() const { return new FallthruStmt( *this ); }
    143         virtual void print( std::ostream &os, int indent = 0 );
     144        virtual void print( std::ostream &os, int indent = 0 ) const;
    144145};
    145146
     
    150151        virtual ~CaseStmt();
    151152
    152         bool isDefault() { return _isDefault; }
     153        static CaseStmt * makeDefault( std::list<Label> labels = std::list<Label>(),
     154                std::list<Statement *> stmts = std::list<Statement *>() );
     155
     156        bool isDefault() const { return _isDefault; }
    153157        void set_default(bool b) { _isDefault = b; }
    154158
     
    163167
    164168        virtual CaseStmt *clone() const { return new CaseStmt( *this ); }
    165         virtual void print( std::ostream &os, int indent = 0 );
     169        virtual void print( std::ostream &os, int indent = 0 ) const;
    166170  private:
    167171        Expression * condition;
     
    186190        virtual void accept( Visitor &v ) { v.visit( this ); }
    187191        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    188         virtual void print( std::ostream &os, int indent = 0 );
     192        virtual void print( std::ostream &os, int indent = 0 ) const;
    189193  private:
    190194        Expression *condition;
     
    211215        virtual void accept( Visitor &v ) { v.visit( this ); }
    212216        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    213         virtual void print( std::ostream &os, int indent = 0 );
     217        virtual void print( std::ostream &os, int indent = 0 ) const;
    214218  private:
    215219        Statement *initialization;
     
    221225class BranchStmt : public Statement {
    222226  public:
    223         enum Type { Goto = 0 , Break, Continue };
     227        enum Type { Goto = 0, Break, Continue };
    224228
    225229        BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError);
     
    227231        virtual ~BranchStmt() {}
    228232
     233        Label get_originalTarget() { return originalTarget; }
    229234        Label get_target() { return target; }
    230235        void set_target( Label newValue ) { target = newValue; }
     
    239244        virtual void accept( Visitor &v ) { v.visit( this ); }
    240245        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    241         virtual void print( std::ostream &os, int indent = 0 );
     246        virtual void print( std::ostream &os, int indent = 0 ) const;
    242247  private:
    243248        static const char *brType[];
     249        Label originalTarget;  // can give better error messages if we remember the label name that the user entered
    244250        Label target;
    245251        Expression *computedTarget;
     
    258264        virtual void accept( Visitor &v ) { v.visit( this ); }
    259265        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    260         virtual void print( std::ostream &os, int indent = 0 );
     266        virtual void print( std::ostream &os, int indent = 0 ) const;
    261267  private:
    262268        Expression *expr;
     
    274280        virtual void accept( Visitor &v ) { v.visit( this ); }
    275281        virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    276         virtual void print( std::ostream &os, int indent = 0 );
     282        virtual void print( std::ostream &os, int indent = 0 ) const;
    277283       
    278284  private:
     
    295301        virtual void accept( Visitor &v ) { v.visit( this ); }
    296302        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    297         virtual void print( std::ostream &os, int indent = 0 );
     303        virtual void print( std::ostream &os, int indent = 0 ) const;
    298304       
    299305  private:
     
    317323        virtual void accept( Visitor &v ) { v.visit( this ); }
    318324        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    319         virtual void print( std::ostream &os, int indent = 0 );
     325        virtual void print( std::ostream &os, int indent = 0 ) const;
    320326       
    321327  private:
     
    336342        virtual void accept( Visitor &v ) { v.visit( this ); }
    337343        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    338         virtual void print( std::ostream &os, int indent = 0 );
     344        virtual void print( std::ostream &os, int indent = 0 ) const;
    339345  private:
    340346        CompoundStmt *block;
     
    355361        virtual void accept( Visitor &v ) { v.visit( this ); }
    356362        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    357         virtual void print( std::ostream &os, int indent = 0 );
     363        virtual void print( std::ostream &os, int indent = 0 ) const;
    358364  private:
    359365        Declaration *decl;
  • src/SynTree/Type.h

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 11:01:40 2015
    13 // Update Count     : 1
     12// Last Modified On : Sun Jun  7 21:50:38 2015
     13// Update Count     : 12
    1414//
    1515
     
    110110        }; 
    111111
    112         static const char *typeNames[];                 // string names for basic types, MUST MATCH with Kind
     112        static const char *typeNames[];                                         // string names for basic types, MUST MATCH with Kind
    113113
    114114        BasicType( const Type::Qualifiers &tq, Kind bt );
     
    214214        virtual ~ReferenceToType();
    215215
    216         std::string get_name() const { return name; }
     216        const std::string &get_name() const { return name; }
    217217        void set_name( std::string newValue ) { name = newValue; }
    218218        std::list< Expression* >& get_parameters() { return parameters; }
     
    372372        virtual ~AttrType();
    373373
    374         std::string get_name() const { return name; }
     374        const std::string &get_name() const { return name; }
    375375        void set_name( const std::string &newValue ) { name = newValue; }
    376376        Expression *get_expr() const { return expr; }
  • src/SynTree/TypeDecl.cc

    reb50842 r937e51d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 11:02:11 2015
    13 // Update Count     : 1
     12// Last Modified On : Sat Jun 13 08:14:35 2015
     13// Update Count     : 2
    1414//
    1515
     
    1818#include "utility.h"
    1919
    20 TypeDecl::TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ) {
     20TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ) {
    2121}
    2222
  • src/SynTree/module.mk

    reb50842 r937e51d  
     1######################### -*- Mode: Makefile-Gmake -*- ########################
     2##
     3## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
     4##
     5## The contents of this file are covered under the licence agreement in the
     6## file "LICENCE" distributed with Cforall.
     7##
     8## module.mk --
     9##
     10## Author           : Richard C. Bilson
     11## Created On       : Mon Jun  1 17:49:17 2015
     12## Last Modified By : Peter A. Buhr
     13## Last Modified On : Mon Jun  1 17:54:09 2015
     14## Update Count     : 1
     15###############################################################################
     16
    117SRC += SynTree/Type.cc \
    218       SynTree/VoidType.cc \
     
    3046       SynTree/Mutator.cc \
    3147       SynTree/CodeGenVisitor.cc \
    32        SynTree/TypeSubstitution.cc \
    33         $(NULL)
     48       SynTree/TypeSubstitution.cc
    3449
Note: See TracChangeset for help on using the changeset viewer.