Changeset e67991f for src/AST/Decl.hpp


Ignore:
Timestamp:
Jul 16, 2019, 10:38:32 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
6f15121
Parents:
7dc2e57b
Message:

WithStmt is now a Declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    r7dc2e57b re67991f  
    102102        ptr<Expr> bitfieldWidth;
    103103
    104         ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, 
    105                 const Init * init = nullptr, Storage::Classes storage = {}, 
    106                 Linkage::Spec linkage = Linkage::C, const Expr * bitWd = nullptr, 
     104        ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type,
     105                const Init * init = nullptr, Storage::Classes storage = {},
     106                Linkage::Spec linkage = Linkage::C, const Expr * bitWd = nullptr,
    107107                std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} )
    108108        : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ),
     
    321321};
    322322
     323/// With statement `with (...) ...`
     324class WithStmt final : public Decl {
     325public:
     326        std::vector<ptr<Expr>> exprs;
     327        ptr<Stmt> stmt;
     328
     329        WithStmt( const CodeLocation & loc, std::vector<ptr<Expr>> && exprs, const Stmt * stmt )
     330        : Decl(loc, "", Storage::Auto, Linkage::Cforall), exprs(std::move(exprs)), stmt(stmt) {}
     331
     332        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     333private:
     334        WithStmt * clone() const override { return new WithStmt{ *this }; }
     335        MUTATE_FRIEND
     336};
     337
    323338class AsmDecl : public Decl {
    324339public:
Note: See TracChangeset for help on using the changeset viewer.