Changes in src/AST/Decl.hpp [3606fe4:77de429]
- File:
-
- 1 edited
-
src/AST/Decl.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
r3606fe4 r77de429 105 105 ptr<Init> init; 106 106 ptr<Expr> bitfieldWidth; 107 bool enumInLine = false; // enum inline is not a real object declaration. 108 // It is a place holder for a set of enum value (ObjectDecl) 109 bool importValue = false; // if the value copied from somewhere else 107 110 108 111 ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, … … 125 128 class FunctionDecl : public DeclWithType { 126 129 public: 130 std::vector<ptr<TypeDecl>> type_params; 131 std::vector<ptr<DeclWithType>> assertions; 127 132 std::vector<ptr<DeclWithType>> params; 128 133 std::vector<ptr<DeclWithType>> returns; 129 std::vector<ptr<TypeDecl>> type_params;130 std::vector<ptr<DeclWithType>> assertions;131 134 // declared type, derived from parameter declarations 132 135 ptr<FunctionType> type; … … 312 315 class EnumDecl final : public AggregateDecl { 313 316 public: 314 ptr<Type> base; 315 316 EnumDecl( const CodeLocation& loc, const std::string& name, 317 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type const * base = nullptr, 317 bool isTyped; // isTyped indicated if the enum has a declaration like: 318 // enum (type_optional) Name {...} 319 ptr<Type> base; // if isTyped == true && base.get() == nullptr, it is a "void" type enum 320 321 EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false, 322 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, 323 Type const * base = nullptr, 318 324 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 319 : AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}325 : AggregateDecl( loc, name, std::move(attrs), linkage ), isTyped(isTyped), base(base), enumValues(enumValues) {} 320 326 321 327 /// gets the integer value for this enumerator, returning true iff value found … … 327 333 const char * typeString() const override { return aggrString( Enum ); } 328 334 329 bool isTyped() {return base && base.get();}330 335 331 336 private:
Note:
See TracChangeset
for help on using the changeset viewer.