• Home
  • Raw
  • Download

Lines Matching +full:merge +full:- +full:base

2 // Use of this source code is governed by a BSD-style license that can be
8 #include "src/ast/ast-types.h"
76 template<class Var, class Base, class Effects>
77 class EffectsMixin: public Base {
79 explicit EffectsMixin(Zone* zone) : Base(zone) {} in EffectsMixin()
83 return this->Find(var, &locator) in Lookup()
84 ? locator.value() : Effect::Unknown(Base::zone()); in Lookup()
96 if (!this->Insert(var, &locator)) { in Seq()
97 effect = Effect::Seq(locator.value(), effect, Base::zone()); in Seq()
103 SeqMerger<EffectsMixin> merge = { *this }; in Seq() local
104 that.ForEach(&merge); in Seq()
110 if (!this->Insert(var, &locator)) { in Alt()
111 effect = Effect::Alt(locator.value(), effect, Base::zone()); in Alt()
118 this->ForEach(&weaken); in Alt()
119 AltMerger<EffectsMixin> merge = { *this }; in Alt() local
120 that.ForEach(&merge); in Alt()
126 Effect::Forget(Base::zone()), Effects(Base::zone()) }; in Forget()
127 this->ForEach(&override); in Forget()
132 typedef typename Base::Locator Locator;
176 bool IsEmpty() { return map_->is_empty(); } in IsEmpty()
183 Zone* zone() { return map_->allocator().zone(); } in zone()
190 static int Compare(int x, int y) { return y - x; } in Compare()
197 return map_->Contains(var); in Contains()
201 return map_->Find(var, locator); in Find()
205 return map_->Insert(var, locator); in Insert()
210 return map_->ForEach(callback); in ForEach()
237 if (node_->previous) NestedEffectsBase(node_->previous).ForEach(callback); in ForEach()
238 node_->effects.ForEach(callback); in ForEach()
241 Effects<Var, kNoVar> Top() { return node_->effects; } in Top()
244 for (Node* node = node_; node != NULL; node = node->previous) { in IsEmpty()
245 if (!node->effects.IsEmpty()) return false; in IsEmpty()
253 Zone* zone() { return node_->zone; } in zone()
255 void push() { node_ = new(node_->zone) Node(node_->zone, node_); } in push()
256 void pop() { node_ = node_->previous; } in pop()
261 for (Node* node = node_; node != NULL; node = node->previous) { in Contains()
262 if (node->effects.Contains(var)) return true; in Contains()
269 for (Node* node = node_; node != NULL; node = node->previous) { in Find()
270 if (node->effects.Find(var, locator)) return true; in Find()
295 if (!node_->effects.Insert(var, locator)) return false; in Insert()
297 for (Node* node = node_->previous; node != NULL; node = node->previous) { in Insert()
298 if (node->effects.Find(var, &shadowed)) { in Insert()
300 locator->set_value(shadowed.value()); in Insert()
327 DCHECK(!this->is_empty()); in Pop()