[ome] Make sure to rewire all project_box we insert through the mark_uninitialized project_box to preserve DI behavior.

Once I update DI in a bit, this will no longer be necessary.

rdar://29870610
This commit is contained in:
Michael Gottesman
2017-04-03 10:33:17 -07:00
parent 97db3931f2
commit c28a62d97c
3 changed files with 105 additions and 3 deletions

View File

@@ -506,10 +506,20 @@ inline bool ValueBase::hasOneUse() const {
}
inline Operand *ValueBase::getSingleUse() const {
auto I = use_begin(), E = use_end();
// If we have no elements, return nullptr.
if (I == E) return nullptr;
// Otherwise, grab the first element and then increment.
Operand *Op = *I;
++I;
// If the next element is not the end list, then return nullptr. We do not
// have one user.
if (I != E) return nullptr;
return *I;
// Otherwise, the element that we accessed.
return Op;
}
/// A constant-size list of the operands of an instruction.