Changeset 3f7e12cb for src/SynTree/Type.cc
- Timestamp:
- Nov 8, 2017, 5:43:33 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 954908d
- Parents:
- 78315272 (diff), e35f30a (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/Type.cc
r78315272 r3f7e12cb 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 11 13:21:25201713 // Update Count : 3 712 // Last Modified On : Mon Sep 25 15:16:32 2017 13 // Update Count : 38 14 14 // 15 15 #include "Type.h" … … 45 45 "double _Imaginary", 46 46 "long double _Imaginary", 47 "__int128", 48 "unsigned __int128", 47 49 }; 48 50 … … 73 75 Type * type; 74 76 ReferenceType * ref; 75 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref-> get_base());77 for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->base ); 76 78 return type; 77 79 } … … 79 81 int Type::referenceDepth() const { return 0; } 80 82 81 void Type::print( std::ostream &os, intindent ) const {83 void Type::print( std::ostream &os, Indenter indent ) const { 82 84 if ( ! forall.empty() ) { 83 85 os << "forall" << std::endl; 84 printAll( forall, os, indent + 4);85 os << std::string( indent+2, ' ' );86 printAll( forall, os, indent+1 ); 87 os << ++indent; 86 88 } // if 87 89 88 90 if ( ! attributes.empty() ) { 89 os << endl << string( indent+2, ' ' ) <<"with attributes" << endl;90 printAll( attributes, os, indent+ 4);91 os << "with attributes" << endl; 92 printAll( attributes, os, indent+1 ); 91 93 } // if 92 94 … … 99 101 const Type::Qualifiers noQualifiers; 100 102 101 std::ostream & operator<<( std::ostream & out, const Type * type ) {102 if ( type ) {103 type->print( out );104 } else {105 out << "nullptr";106 } // if107 return out;108 }109 110 103 // Local Variables: // 111 104 // tab-width: 4 //
Note:
See TracChangeset
for help on using the changeset viewer.