mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DebugInfo] Remove Expr from debug variables used as DenseMap keys
We do keep the fragment part of the expression as it is important to identify fragments separately. A variable with less fragments should be considered a superset of variables with more fragments, but that would require to change a lot of code.
This commit is contained in:
@@ -296,6 +296,16 @@ public:
|
||||
return Elements.size() &&
|
||||
Elements[0].getAsOperator() == SILDIExprOperator::Dereference;
|
||||
}
|
||||
|
||||
/// Return the part of this SILDebugInfoExpression corresponding to fragments
|
||||
SILDebugInfoExpression getFragmentPart() const {
|
||||
for (auto it = element_begin(), end = element_end(); it != end; ++it) {
|
||||
if (it->getAsOperator() == SILDIExprOperator::Fragment
|
||||
|| it->getAsOperator() == SILDIExprOperator::TupleFragment)
|
||||
return SILDebugInfoExpression(ArrayRef(it, element_end()));
|
||||
}
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
/// Returns the hashcode for the di expr element.
|
||||
|
||||
Reference in New Issue
Block a user