Changeset a08ba92 for translator/SynTree/ReferenceToType.cc
- Timestamp:
- May 19, 2015, 4:58:14 PM (9 years ago)
- 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:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/ReferenceToType.cc
r01aeade ra08ba92 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:49:00 201513 // Update Count : 212 // Last Modified On : Tue May 19 16:52:40 2015 13 // Update Count : 3 14 14 // 15 15 … … 27 27 28 28 ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ) { 29 29 cloneAll( other.parameters, parameters ); 30 30 } 31 31 32 32 ReferenceToType::~ReferenceToType() { 33 33 deleteAll( parameters ); 34 34 } 35 35 36 36 void ReferenceToType::print( std::ostream &os, int indent ) const { 37 38 39 40 41 37 using std::endl; 38 39 Type::print( os, indent ); 40 os << "instance of " << typeString() << " " << name << " "; 41 if ( ! parameters.empty() ) { 42 42 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 43 43 printAll( parameters, os, indent+2 ); 44 44 } // if 45 45 } 46 46 … … 60 60 61 61 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 62 63 62 assert( baseStruct ); 63 doLookup( baseStruct->get_members(), baseStruct->get_parameters(), parameters, name, foundDecls ); 64 64 } 65 65 … … 67 67 68 68 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 69 70 69 assert( baseUnion ); 70 doLookup( baseUnion->get_members(), baseUnion->get_parameters(), parameters, name, foundDecls ); 71 71 } 72 72 … … 76 76 77 77 ContextInstType::ContextInstType( const ContextInstType &other ) : Parent( other ) { 78 78 cloneAll( other.members, members ); 79 79 } 80 80 81 81 ContextInstType::~ContextInstType() { 82 82 deleteAll( members ); 83 83 } 84 84 85 85 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType ) : Parent( tq, name ) { 86 86 set_baseType( baseType ); 87 87 } 88 88 … … 91 91 92 92 void TypeInstType::set_baseType( TypeDecl *newValue ) { 93 94 93 baseType = newValue; 94 isFtype = newValue->get_kind() == TypeDecl::Ftype; 95 95 } 96 96 … … 98 98 99 99 void TypeInstType::print( std::ostream &os, int indent ) const { 100 101 102 103 104 100 using std::endl; 101 102 Type::print( os, indent ); 103 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " a function type) "; 104 if ( ! parameters.empty() ) { 105 105 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; 106 106 printAll( parameters, os, indent+2 ); 107 107 } // if 108 108 } 109 109
Note: See TracChangeset
for help on using the changeset viewer.