[lld] r196505 - Use !! to convert to a boolean value.

Rui Ueyama ruiu at google.com
Thu Dec 5 16:52:32 PST 2013


On Thu, Dec 5, 2013 at 8:40 AM, David Blaikie <dblaikie at gmail.com> wrote:

> On Thu, Dec 5, 2013 at 5:11 AM, Rui Ueyama <ruiu at google.com> wrote:
> > Author: ruiu
> > Date: Thu Dec  5 07:11:33 2013
> > New Revision: 196505
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=196505&view=rev
> > Log:
> > Use !! to convert to a boolean value.
>
> This is to silence that bool conversion 'performance' warning from
> MSVC? Should we just disable that warning? It's not actually a real
> performance problem ever in my experience, and I've yet to see it find
> a bug.


I made this change because I think it's just easier to read than the
original three line code. Not to silence warning or something.

 >
> > Modified:
> >     lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
> >
> > Modified: lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h?rev=196505&r1=196504&r2=196505&view=diff
> >
> ==============================================================================
> > --- lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h (original)
> > +++ lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h Thu Dec  5
> 07:11:33 2013
> > @@ -230,11 +230,7 @@ public:
> >      return ArrayRef<uint8_t>(p, p + array.size());
> >    }
> >
> > -  virtual bool hasInputGraph() {
> > -    if (_inputGraph)
> > -      return true;
> > -    return false;
> > -  }
> > +  virtual bool hasInputGraph() { return !!_inputGraph; }
> >
> >    void setLibraryGroup(Group *group) { _libraryGroup = group; }
> >    Group *getLibraryGroup() const { return _libraryGroup; }
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131205/da906cac/attachment.html>


More information about the llvm-commits mailing list