Changes in src/AST/Decl.hpp [93c10de:19a8c40]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r93c10de r19a8c40 10 10 // Created On : Thu May 9 10:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Nov 24 9:44:00 202213 // Update Count : 3 412 // Last Modified On : Thu May 5 12:09:00 2022 13 // Update Count : 33 14 14 // 15 15 … … 191 191 ptr<Type> init; 192 192 193 /// Data extracted from a type decl 194 struct Data { 195 Kind kind; 196 bool isComplete; 197 198 Data() : kind( NUMBER_OF_KINDS ), isComplete( false ) {} 199 Data( const TypeDecl * d ) : kind( d->kind ), isComplete( d->sized ) {} 200 Data( Kind k, bool c ) : kind( k ), isComplete( c ) {} 201 Data( const Data & d1, const Data & d2 ) 202 : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {} 203 204 bool operator==( const Data & o ) const { return kind == o.kind && isComplete == o.isComplete; } 205 bool operator!=( const Data & o ) const { return !(*this == o); } 206 }; 207 193 208 TypeDecl( 194 209 const CodeLocation & loc, const std::string & name, Storage::Classes storage, … … 210 225 }; 211 226 212 /// Data extracted from a TypeDecl. 213 struct TypeData { 214 TypeDecl::Kind kind; 215 bool isComplete; 216 217 TypeData() : kind( TypeDecl::NUMBER_OF_KINDS ), isComplete( false ) {} 218 TypeData( const TypeDecl * d ) : kind( d->kind ), isComplete( d->sized ) {} 219 TypeData( TypeDecl::Kind k, bool c ) : kind( k ), isComplete( c ) {} 220 TypeData( const TypeData & d1, const TypeData & d2 ) 221 : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {} 222 223 bool operator==( const TypeData & o ) const { return kind == o.kind && isComplete == o.isComplete; } 224 bool operator!=( const TypeData & o ) const { return !(*this == o); } 225 }; 226 227 std::ostream & operator<< ( std::ostream &, const TypeData & ); 227 std::ostream & operator<< ( std::ostream &, const TypeDecl::Data & ); 228 228 229 229 /// C-style typedef `typedef Foo Bar` … … 315 315 // enum (type_optional) Name {...} 316 316 ptr<Type> base; // if isTyped == true && base.get() == nullptr, it is a "void" type enum 317 enum class EnumHiding { Visible, Hide } hide; 318 319 EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false, 317 318 EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false, 320 319 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, 321 Type const * base = nullptr, EnumHiding hide = EnumHiding::Hide,320 Type const * base = nullptr, 322 321 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 323 : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), hide(hide),enumValues(enumValues) {}322 : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), enumValues(enumValues) {} 324 323 325 324 /// gets the integer value for this enumerator, returning true iff value found
Note:
See TracChangeset
for help on using the changeset viewer.