Changes in src/AST/Decl.hpp [19a8c40:93c10de]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r19a8c40 r93c10de 10 10 // Created On : Thu May 9 10:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu May 5 12:09:00 202213 // Update Count : 3 312 // Last Modified On : Thu Nov 24 9:44:00 2022 13 // Update Count : 34 14 14 // 15 15 … … 191 191 ptr<Type> init; 192 192 193 /// Data extracted from a type decl194 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 208 193 TypeDecl( 209 194 const CodeLocation & loc, const std::string & name, Storage::Classes storage, … … 225 210 }; 226 211 227 std::ostream & operator<< ( std::ostream &, const TypeDecl::Data & ); 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 & ); 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 318 EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false, 317 enum class EnumHiding { Visible, Hide } hide; 318 319 EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false, 319 320 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, 320 Type const * base = nullptr, 321 Type const * base = nullptr, EnumHiding hide = EnumHiding::Hide, 321 322 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 322 : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), enumValues(enumValues) {}323 : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), hide(hide), enumValues(enumValues) {} 323 324 324 325 /// gets the integer value for this enumerator, returning true iff value found
Note:
See TracChangeset
for help on using the changeset viewer.