[llvm] r346365 - Add parentheses to silence warning.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 10:56:56 PST 2018


Simplified this a bit further - since those pieces of code didn't need to
use the outer scope DebugOffset variable & then I figured that variable was
a bit subtle being an indirect out parameter from a lambda used as
prolifically as this lambda/out parameter are, so I turned it into a return
value in r346691

On Wed, Nov 7, 2018 at 2:41 PM via llvm-commits <llvm-commits at lists.llvm.org>
wrote:

> Thanks, I was just about to fix it myself.
> --paulr
>
> > -----Original Message-----
> > From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On
> Behalf
> > Of Jorge Gorbe Moya via llvm-commits
> > Sent: Wednesday, November 07, 2018 5:30 PM
> > To: llvm-commits at lists.llvm.org
> > Subject: [llvm] r346365 - Add parentheses to silence warning.
> >
> > Author: jgorbe
> > Date: Wed Nov  7 14:30:01 2018
> > New Revision: 346365
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=346365&view=rev
> > Log:
> > Add parentheses to silence warning.
> >
> > DWARFContext.cpp:356:20: error: using the result of an assignment as a
> > condition without parentheses [-Werror,-Wparentheses]
> >
> > Modified:
> >     llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
> >
> > Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
> > URL: http://llvm.org/viewvc/llvm-
> >
> project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=346365&r1=3463
> > 64&r2=346365&view=diff
> >
> ==========================================================================
> > ====
> > --- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)
> > +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Wed Nov  7 14:30:01
> > 2018
> > @@ -353,7 +353,7 @@ void DWARFContext::dump(
> >
> >    auto dumpDebugInfo = [&](const char *Name, unit_iterator_range Units)
> {
> >      OS << '\n' << Name << " contents:\n";
> > -    if (DumpOffset = DumpOffsets[DIDT_ID_DebugInfo])
> > +    if ((DumpOffset = DumpOffsets[DIDT_ID_DebugInfo]))
> >        for (const auto &U : Units)
> >          U->getDIEForOffset(DumpOffset.getValue())
> >              .dump(OS, 0, DumpOpts.noImplicitRecursion());
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://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/20181112/4251fe00/attachment.html>


More information about the llvm-commits mailing list