Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ObjectDecl.cc

    r50377a4 r93389c1  
    4444}
    4545
    46 void ObjectDecl::print( std::ostream &os, Indenter indent ) const {
    47         if ( name != "" ) os << name << ": ";
     46void ObjectDecl::print( std::ostream &os, int indent ) const {
     47        if ( get_name() != "" ) {
     48                os << get_name() << ": ";
     49        } // if
    4850
    49         if ( linkage != LinkageSpec::Cforall ) {
    50                 os << LinkageSpec::linkageName( linkage ) << " ";
     51        if ( get_linkage() != LinkageSpec::Cforall ) {
     52                os << LinkageSpec::linkageName( get_linkage() ) << " ";
    5153        } // if
     54
     55        printAll( get_attributes(), os, indent );
    5256
    5357        get_storageClasses().print( os );
    5458
    55         if ( type ) {
    56                 type->print( os, indent );
     59        if ( get_type() ) {
     60                get_type()->print( os, indent );
    5761        } else {
    5862                os << " untyped entity ";
     
    6064
    6165        if ( init ) {
    62                 os << " with initializer (" << (init->get_maybeConstructed() ? "maybe constructed" : "not constructed") << ")" << std::endl << indent+1;
    63                 init->print( os, indent+1 );
    64                 os << std::endl;
     66                os << " with initializer " << std::endl;
     67                init->print( os, indent+2 );
     68                os << std::endl << std::string(indent+2, ' ');
     69                os << "maybeConstructed? " << init->get_maybeConstructed();
    6570        } // if
    6671
    67         if ( ! attributes.empty() ) {
    68                 os << std::endl << indent << "... with attributes: " << std::endl;
    69                 printAll( attributes, os, indent+1 );
    70         }
    71 
    7272        if ( bitfieldWidth ) {
    73                 os << indent << " with bitfield width ";
     73                os << std::string(indent, ' ');
     74                os << " with bitfield width ";
    7475                bitfieldWidth->print( os );
    7576        } // if
    7677}
    7778
    78 void ObjectDecl::printShort( std::ostream &os, Indenter indent ) const {
     79void ObjectDecl::printShort( std::ostream &os, int indent ) const {
    7980#if 0
    8081        if ( get_mangleName() != "") {
     
    8283        } else
    8384#endif
    84         if ( name != "" ) os << name << ": ";
     85        if ( get_name() != "" ) {
     86                os << get_name() << ": ";
     87        } // if
     88
     89        // xxx - should printShort print attributes?
    8590
    8691        get_storageClasses().print( os );
    8792
    88         if ( type ) {
    89                 type->print( os, indent );
     93        if ( get_type() ) {
     94                get_type()->print( os, indent );
    9095        } else {
    9196                os << "untyped entity ";
Note: See TracChangeset for help on using the changeset viewer.