mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user