- Timestamp:
- Jun 29, 2024, 5:02:06 AM (18 months ago)
- Branches:
- master
- Children:
- 4117761
- Parents:
- 7552fde
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
r7552fde r5ccc733 203 203 } 204 204 205 bool EnumDecl::isTyped() const { return base;} 206 207 bool EnumDecl::isOpague() const { return isCfa && !isTyped(); } 205 208 } 206 209 -
src/AST/Decl.hpp
r7552fde r5ccc733 308 308 class EnumDecl final : public AggregateDecl { 309 309 public: 310 // is Typedindicated if the enum has a declaration like:310 // isCfa indicated if the enum has a declaration like: 311 311 // enum (type_optional) Name {...} 312 bool is Typed;313 // if is Typed == true && base.get() == nullptr, it is a "void" typeenum312 bool isCfa; 313 // if isCfa == true && base.get() == nullptr, it is a "opague" enum 314 314 ptr<Type> base; 315 315 enum class EnumHiding { Visible, Hide } hide; 316 316 std::vector< ast::ptr<ast::EnumInstType>> inlinedDecl; // child enums 317 317 318 EnumDecl( const CodeLocation& loc, const std::string& name, bool is Typed= false,318 EnumDecl( const CodeLocation& loc, const std::string& name, bool isCfa = false, 319 319 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, 320 320 Type const * base = nullptr, EnumHiding hide = EnumHiding::Hide, 321 321 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 322 : AggregateDecl( loc, name, std::move(attrs), linkage ), is Typed(isTyped), base(base), hide(hide), enumValues(enumValues) {}322 : AggregateDecl( loc, name, std::move(attrs), linkage ), isCfa(isCfa), base(base), hide(hide), enumValues(enumValues) {} 323 323 324 324 /// gets the integer value for this enumerator, returning true iff value found … … 336 336 337 337 bool isSubTypeOf(const ast::EnumDecl *) const; 338 bool isTyped() const; 339 bool isOpague() const; 338 340 private: 339 341 EnumDecl * clone() const override { return new EnumDecl{ *this }; }
Note:
See TracChangeset
for help on using the changeset viewer.