Changeset c0aa336 for src/SynTree/ReferenceToType.cc
- Timestamp:
- Feb 6, 2017, 4:19:41 PM (7 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:
- b4d65c7
- Parents:
- a362f97
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ReferenceToType.cc
ra362f97 rc0aa336 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 13 18:03:30 201613 // Update Count : 912 // Last Modified On : Thu Feb 2 17:45:07 2017 13 // Update Count : 23 14 14 // 15 15 … … 23 23 #include "Common/utility.h" 24 24 25 ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name ) : Type( tq), name( name ) {25 ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ) { 26 26 } 27 27 … … 55 55 } // namespace 56 56 57 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct ) : Parent( tq, baseStruct->get_name() ), baseStruct( baseStruct ) {} 57 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 58 Parent( tq, baseStruct->get_name(), attributes ), baseStruct( baseStruct ) {} 58 59 59 60 std::string StructInstType::typeString() const { return "struct"; } … … 64 65 } 65 66 66 bool StructInstType::isComplete() const { return baseStruct ->has_body(); }67 bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; } 67 68 68 69 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { … … 85 86 } 86 87 88 89 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 90 Parent( tq, baseUnion->get_name(), attributes ), baseUnion( baseUnion ) {} 91 87 92 std::string UnionInstType::typeString() const { return "union"; } 88 93 89 std::list< TypeDecl*>* UnionInstType::get_baseParameters() {94 std::list< TypeDecl * > * UnionInstType::get_baseParameters() { 90 95 if ( ! baseUnion ) return NULL; 91 96 return &baseUnion->get_parameters(); 92 97 } 93 98 94 bool UnionInstType::isComplete() const { return baseUnion ->has_body(); }99 bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; } 95 100 96 101 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { … … 113 118 } 114 119 120 121 EnumInstType::EnumInstType( const Type::Qualifiers & tq, EnumDecl * baseEnum, const std::list< Attribute * > & attributes ) : 122 Parent( tq, baseEnum->get_name(), attributes ), baseEnum( baseEnum ) {} 123 115 124 std::string EnumInstType::typeString() const { return "enum"; } 125 126 bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; } 116 127 117 128 std::string TraitInstType::typeString() const { return "trait"; } … … 127 138 bool TraitInstType::isComplete() const { assert( false ); } 128 139 129 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType ) : Parent( tq, name) {140 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType, const std::list< Attribute * > & attributes ) : Parent( tq, name, attributes ) { 130 141 set_baseType( baseType ); 131 142 } 132 143 133 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, bool isFtype ) : Parent( tq, name), baseType( 0 ), isFtype( isFtype ) {144 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, bool isFtype, const std::list< Attribute * > & attributes ) : Parent( tq, name, attributes ), baseType( 0 ), isFtype( isFtype ) { 134 145 } 135 146
Note: See TracChangeset
for help on using the changeset viewer.