This also fixes an infinite recursion between lldb_private::operator>> () and Scalar::operator>>= ().
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Scalar::operator<<= seems to do a m_integer <<= .... Will it suffer from the same recursion problem?
In any case, I think the implementations of both methods should use the same API (it doesn't matter which one if both work).
Also it would be super great if you could make a tiny test for this, say in unittests/Core/ScalarTest.cpp
Scalar::operator<<= works well as-is because it uses APInt &operator<<=(unsigned shiftAmt), whereas the right shift equivalent is not implemented. Should I add APInt &operator>>=, or should I change Scalar::operator<<= for consistency ?
Ah, ok I understand what's going on now. I guess APInt operator >> probably does not exist because it would be ambiguous (arithmetic or bitwise shift?). Let's just leave this as it is now.
Could you add that test though?
Added a small unit test for scalar right shift operator, which invokes the >>= operator.
That's perfect. Thanks for adding that test.
Do you have commit access, or shall I put this in?