Changeset 9e1d485 for src/AST/Init.hpp
- Timestamp:
- May 15, 2019, 3:41:08 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 69bafd2
- Parents:
- 264e691
- File:
-
- 1 edited
-
src/AST/Init.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Init.hpp
r264e691 r9e1d485 42 42 }; 43 43 44 /// Flag for whether to construct from initialzier 45 enum ConstructFlag { DoConstruct, MaybeConstruct }; 46 44 47 /// Object initializer base class 45 48 class Init : public ParseNode { 46 49 public: 47 boolmaybeConstructed;50 ConstructFlag maybeConstructed; 48 51 49 Init( const CodeLocation& loc, boolmc ) : ParseNode( loc ), maybeConstructed( mc ) {}52 Init( const CodeLocation& loc, ConstructFlag mc ) : ParseNode( loc ), maybeConstructed( mc ) {} 50 53 51 54 virtual Init* accept( Visitor& v ) override = 0; … … 60 63 ptr<Expr> value; 61 64 62 SingleInit( const CodeLocation& loc, Expr* val, bool mc = false)65 SingleInit( const CodeLocation& loc, Expr* val, ConstructFlag mc = DoConstruct ) 63 66 : Init( loc, mc ), value( val ) {} 64 67 … … 78 81 79 82 ListInit( const CodeLocation& loc, std::vector<ptr<Init>>&& is, 80 std::vector<ptr<Designation>>&& ds = {}, bool mc = false);83 std::vector<ptr<Designation>>&& ds = {}, ConstructFlag mc = DoConstruct ); 81 84 82 85 using iterator = std::vector<ptr<Init>>::iterator; … … 104 107 105 108 ConstructorInit( const CodeLocation& loc, Stmt* ctor, Stmt* dtor, Init* init ) 106 : Init( loc, true), ctor( ctor ), dtor( dtor ), init( init ) {}109 : Init( loc, DoConstruct ), ctor( ctor ), dtor( dtor ), init( init ) {} 107 110 108 111 Init* accept( Visitor& v ) override { return v.visit( this ); }
Note:
See TracChangeset
for help on using the changeset viewer.