Changeset e7f8119 for src/AST/Expr.hpp
- Timestamp:
- Jun 10, 2019, 10:52:03 AM (5 years ago)
- 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
- Children:
- 6355ba7
- Parents:
- 9856ca9 (diff), 61c7239 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
r9856ca9 re7f8119 17 17 18 18 #include <cassert> 19 #include <deque> 19 20 #include <map> 20 21 #include <string> … … 111 112 } 112 113 113 const ResnSlots& resnSlots Const() const {114 const ResnSlots& resnSlots() const { 114 115 if (mode == Slots) { 115 116 return data.resnSlots; … … 128 129 } 129 130 130 const InferredParams& inferParams Const() const {131 const InferredParams& inferParams() const { 131 132 if (mode == Params) { 132 133 return data.inferParams; … … 134 135 assert(!"Mode was not already Params"); 135 136 return *((InferredParams*)nullptr); 137 } 138 139 /// splices other InferUnion into this one. Will fail if one union is in `Slots` mode 140 /// and the other is in `Params`. 141 void splice( InferUnion && o ) { 142 if ( o.mode == Empty ) return; 143 if ( mode == Empty ) { init_from( o ); return; } 144 assert( mode == o.mode && "attempt to splice incompatible InferUnion" ); 145 146 if ( mode == Slots ){ 147 data.resnSlots.insert( 148 data.resnSlots.end(), o.data.resnSlots.begin(), o.data.resnSlots.end() ); 149 } else if ( mode == Params ) { 150 for ( const auto & p : o.data.inferParams ) { 151 data.inferParams[p.first] = std::move(p.second); 152 } 153 } else assert(!"invalid mode"); 136 154 } 137 155 }; … … 695 713 public: 696 714 ptr<Expr> expr; 697 std:: vector<InitAlternative> initAlts;698 699 UntypedInitExpr( const CodeLocation & loc, const Expr * e, std:: vector<InitAlternative> && as )715 std::deque<InitAlternative> initAlts; 716 717 UntypedInitExpr( const CodeLocation & loc, const Expr * e, std::deque<InitAlternative> && as ) 700 718 : Expr( loc ), expr( e ), initAlts( std::move(as) ) {} 701 719
Note: See TracChangeset
for help on using the changeset viewer.