[llvm] b23ba29 - DebugInfo: Make DWARFExpression::iterator::operator++ return itself

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 23 13:36:15 PST 2021


I /think/ there's unit test coverage for this class that could be improved
to cover this fix (& maybe the constification fixes in that other commit
too)

On Mon, Nov 15, 2021 at 5:29 PM Duncan P. N. Exon Smith via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Duncan P. N. Exon Smith
> Date: 2021-11-15T17:29:00-08:00
> New Revision: b23ba295bd129315eac09a52cf58346081e6fdc8
>
> URL:
> https://github.com/llvm/llvm-project/commit/b23ba295bd129315eac09a52cf58346081e6fdc8
> DIFF:
> https://github.com/llvm/llvm-project/commit/b23ba295bd129315eac09a52cf58346081e6fdc8.diff
>
> LOG: DebugInfo: Make DWARFExpression::iterator::operator++ return itself
>
> Looks like an accident that `operator++` was returning `Operator&`
> instead of `iterator&`. Update to match standard iterator behaviour.
>
> Added:
>
>
> Modified:
>     llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
> b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
> index dc575265d816..9ebe9b0e4110 100644
> --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
> +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
> @@ -116,12 +116,12 @@ class DWARFExpression {
>      }
>
>    public:
> -    class Operation &operator++() {
> +    iterator &operator++() {
>        Offset = Op.isError() ? Expr->Data.getData().size() : Op.EndOffset;
>        Op.Error =
>            Offset >= Expr->Data.getData().size() ||
>            !Op.extract(Expr->Data, Expr->AddressSize, Offset,
> Expr->Format);
> -      return Op;
> +      return *this;
>      }
>
>      class Operation &operator*() const {
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211123/ae052925/attachment.html>


More information about the llvm-commits mailing list