Changeset 6840e7c for src/SynTree/ObjectDecl.cc
- Timestamp:
- Oct 19, 2017, 12:01:04 PM (8 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 837ce06
- Parents:
- b96ec83 (diff), a15b72c (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ObjectDecl.cc
rb96ec83 r6840e7c 44 44 } 45 45 46 void ObjectDecl::print( std::ostream &os, int indent ) const { 47 if ( get_name() != "" ) { 48 os << get_name() << ": "; 46 void ObjectDecl::print( std::ostream &os, Indenter indent ) const { 47 if ( name != "" ) os << name << ": "; 48 49 if ( linkage != LinkageSpec::Cforall ) { 50 os << LinkageSpec::linkageName( linkage ) << " "; 49 51 } // if 50 51 if ( get_linkage() != LinkageSpec::Cforall ) {52 os << LinkageSpec::linkageName( get_linkage() ) << " ";53 } // if54 55 printAll( get_attributes(), os, indent );56 52 57 53 get_storageClasses().print( os ); 58 54 59 if ( get_type()) {60 get_type()->print( os, indent );55 if ( type ) { 56 type->print( os, indent ); 61 57 } else { 62 58 os << " untyped entity "; … … 64 60 65 61 if ( init ) { 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(); 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; 70 65 } // if 71 66 67 if ( ! attributes.empty() ) { 68 os << std::endl << indent << "... with attributes: " << std::endl; 69 printAll( attributes, os, indent+1 ); 70 } 71 72 72 if ( bitfieldWidth ) { 73 os << std::string(indent, ' '); 74 os << " with bitfield width "; 73 os << indent << " with bitfield width "; 75 74 bitfieldWidth->print( os ); 76 75 } // if 77 76 } 78 77 79 void ObjectDecl::printShort( std::ostream &os, intindent ) const {78 void ObjectDecl::printShort( std::ostream &os, Indenter indent ) const { 80 79 #if 0 81 80 if ( get_mangleName() != "") { … … 83 82 } else 84 83 #endif 85 if ( get_name() != "" ) { 86 os << get_name() << ": "; 87 } // if 88 89 // xxx - should printShort print attributes? 84 if ( name != "" ) os << name << ": "; 90 85 91 86 get_storageClasses().print( os ); 92 87 93 if ( get_type()) {94 get_type()->print( os, indent );88 if ( type ) { 89 type->print( os, indent ); 95 90 } else { 96 91 os << "untyped entity ";
Note:
See TracChangeset
for help on using the changeset viewer.