Changeset 40cd873
- Timestamp:
- Sep 13, 2018, 11:09:15 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 4d59ff9, b499c18
- Parents:
- b181639
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeTools/ResolvProtoDump.cc
rb181639 r40cd873 23 23 #include <string> 24 24 #include <unordered_set> 25 #include <utility> 25 26 #include <vector> 26 27 … … 36 37 /// Visitor for dumping resolver prototype output 37 38 class ProtoDump : public WithShortCircuiting, public WithVisitorRef<ProtoDump> { 38 std::set<std::string> decls; 39 std::vector<std::string> exprs; 40 std::vector<P assVisitor<ProtoDump>> subs;///< Sub-scopes41 const ProtoDump* parent; 39 std::set<std::string> decls; ///< Declarations in this scope 40 std::vector<std::string> exprs; ///< Expressions in this scope 41 std::vector<ProtoDump> subs; ///< Sub-scopes 42 const ProtoDump* parent; ///< Outer lexical scope 42 43 43 44 public: … … 46 47 47 48 /// Child constructor 48 ProtoDump(const ProtoDump & p) : decls(), exprs(), subs(), parent(&p) {}49 ProtoDump(const ProtoDump* p) : decls(), exprs(), subs(), parent(p) {} 49 50 50 51 private: … … 67 68 68 69 /// adds a new subscope to this scope, returning a reference 69 PassVisitor<ProtoDump>& addSub() { 70 subs.emplace_back( *this ); 71 return subs.back(); 70 void addSub( PassVisitor<ProtoDump>&& sub ) { 71 subs.emplace_back( std::move(sub.pass) ); 72 72 } 73 73 … … 517 517 // add body if available 518 518 if ( decl->statements ) { 519 PassVisitor<ProtoDump> & body = addSub();519 PassVisitor<ProtoDump> body{ this }; 520 520 521 521 // add named parameters and returns to local scope … … 529 529 // add contents of function to new scope 530 530 decl->statements->accept( body ); 531 532 // store sub-scope 533 addSub( std::move(body) ); 531 534 } 532 535
Note: See TracChangeset
for help on using the changeset viewer.