<div dir="ltr"><div>Clang (head) displayed the following warning:<br></div><div><br></div><div>lib/ReaderWriter/MachO/WriterMachO.cpp:136:29: warning: private field '_targetInfo' is not used [-Wunused-private-field]</div>

<div>  const MachOTargetInfo    &_targetInfo;</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 12:53 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Rui,</div><div><br></div><div>Where exactly was the warning?  Which compilers?  </div>

<span class="HOEnZb"><font color="#888888"><div><br></div><div>-Nick</div></font></span><div><div class="h5"><br><div><div>On Jun 24, 2013, at 8:53 AM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:</div>

<blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr">Shankar,<div><br></div><div>We usually treat compiler warnings as errors as a policy, don't we? I hesitate to reintroduce the code that compiler warns. I'll leave it to Nick. If the code is resurrected, it should be with a pragma to supress the warning, I think.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 23, 2013 at 8:17 PM, Shankar Easwaran<span> </span><span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span><span> </span>wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Rui,<br><br>The writer was supposed to use _targetInfo, which MachO writer was not using at present.<br>

<br>I am not sure if we wanted to remove the un-referenced field, _targetInfo though.<br><br>Does any build recognize unused private variables ? If the buildbot is not checking for it, I would leave the original changes around.<br>

<br>Thanks<br><br>Shankar Easwaran<div><div><br><br>On 6/22/2013 5:12 PM, Rui Ueyama wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Author: ruiu<br>Date: Sat Jun 22 17:12:30 2013<br>New Revision: 184651<br><br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project?rev=184651&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=184651&view=rev</a><br>

Log:<br>Fix unused field warning.<br><br>Modified:<br>     lld/trunk/lib/ReaderWriter/<u></u>MachO/WriterMachO.cpp<br><br>Modified: lld/trunk/lib/ReaderWriter/<u></u>MachO/WriterMachO.cpp<br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp?rev=184651&r1=184650&r2=184651&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/MachO/<u></u>WriterMachO.cpp?rev=184651&r1=<u></u>184650&r2=184651&view=diff</a><br>

==============================<u></u>==============================<u></u>==================<br>--- lld/trunk/lib/ReaderWriter/<u></u>MachO/WriterMachO.cpp (original)<br>+++ lld/trunk/lib/ReaderWriter/<u></u>MachO/WriterMachO.cpp Sat Jun 22 17:12:30 2013<br>

@@ -106,7 +106,6 @@ protected:<br> <span> </span>class SectionChunk : public Chunk {<br> <span> </span>public:<br>   <span> </span>static SectionChunk*  make(DefinedAtom::ContentType,<br>-                             const MachOTargetInfo &ti,<br>

                               MachOWriter &writer);<br>   <span> </span>virtual StringRef     segmentName() const;<br>   <span> </span>virtual bool          occupiesNoDiskSpace();<br>@@ -128,12 +127,10 @@ private:<br>

                 <span> </span>SectionChunk(StringRef seg,<br>                               StringRef sect,<br>                               uint32_t flags,<br>-                             const MachOTargetInfo &ti,<br>

                               MachOWriter &writer);<br>     <span> </span>StringRef                 _segmentName;<br>   <span> </span>StringRef                 _sectionName;<br>-  const MachOTargetInfo    &_targetInfo;<br>

   <span> </span>MachOWriter              &_writer;<br>   <span> </span>uint32_t                  _flags;<br>   <span> </span>uint32_t                  _permissions;<br>@@ -456,46 +453,38 @@ void Chunk::assignFileOffset(<u></u>uint64_t &c<br>

 <span> </span>//===-------------------------<u></u>------------------------------<u></u>---------------===//<br>   <span> </span>SectionChunk::SectionChunk(<u></u>StringRef seg, StringRef sect,<br>-                           uint32_t flags, const MachOTargetInfo &ti,<br>

-                                                MachOWriter &writer)<br>- : _segmentName(seg), _sectionName(sect), _targetInfo(ti),<br>-   _writer(writer), _flags(flags), _permissions(0) {<br>+                           uint32_t flags, MachOWriter &writer)<br>

+ : _segmentName(seg), _sectionName(sect), _writer(writer),<br>+   _flags(flags), _permissions(0) {<br>   <span> </span>}<br>   <span> </span>SectionChunk* SectionChunk::make(<u></u>DefinedAtom::ContentType type,<br>-                                 const MachOTargetInfo &ti,<br>

                                   MachOWriter &writer) {<br>   <span> </span>switch ( type ) {<br>     <span> </span>case DefinedAtom::typeCode:<br>       <span> </span>return new SectionChunk("__TEXT", "__text",<br>

-                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS,<br>-                              ti, writer);<br>+                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS, writer);<br>       <span> </span>break;<br>

     <span> </span>case DefinedAtom::typeCString:<br>         return new SectionChunk("__TEXT", "__cstring",<br>-                               S_CSTRING_LITERALS,<br>-                              ti, writer);<br>

+                               S_CSTRING_LITERALS, writer);<br>         break;<br>     <span> </span>case DefinedAtom::typeStub:<br>       <span> </span>return new SectionChunk("__TEXT", "__stubs",<br>

-                              S_SYMBOL_STUBS | S_ATTR_PURE_INSTRUCTIONS,<br>-                              ti, writer);<br>+                              S_SYMBOL_STUBS | S_ATTR_PURE_INSTRUCTIONS, writer);<br>       <span> </span>break;<br>

     <span> </span>case DefinedAtom::typeStubHelper:<br>       <span> </span>return new SectionChunk("__TEXT", "__stub_helper",<br>-                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS,<br>

-                              ti, writer);<br>+                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS, writer);<br>       <span> </span>break;<br>     <span> </span>case DefinedAtom::typeLazyPointer:<br>       <span> </span>return new SectionChunk("__DATA", "__la_symbol_ptr",<br>

-                              S_LAZY_SYMBOL_POINTERS,<br>-                              ti, writer);<br>+                              S_LAZY_SYMBOL_POINTERS, writer);<br>       <span> </span>break;<br>     <span> </span>case DefinedAtom::typeGOT:<br>

       <span> </span>return new SectionChunk("__DATA", "__got",<br>-                              S_NON_LAZY_SYMBOL_POINTERS,<br>-                              ti, writer);<br>+                              S_NON_LAZY_SYMBOL_POINTERS, writer);<br>

       <span> </span>break;<br>     <span> </span>default:<br>       <span> </span>assert(0 && "TO DO: add support for more sections");<br>@@ -1320,7 +1309,7 @@ void MachOWriter::createChunks(<u></u>const lld<br>

     <span> </span>DefinedAtom::ContentType type = atom->contentType();<br>     <span> </span>auto pos = map.find(type);<br>     <span> </span>if ( pos == map.end() ) {<br>-      SectionChunk *chunk = SectionChunk::make(type, _targetInfo, *this);<br>

+      SectionChunk *chunk = SectionChunk::make(type, *this);<br>       <span> </span>map[type] = chunk;<br>       <span> </span>chunk->appendAtom(atom);<br>     <span> </span>}<br><br><br>______________________________<u></u>_________________<br>

llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>

<br><br></blockquote><br><br></div></div><span><font color="#888888">--<span> </span><br>Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</font></span></blockquote></div></div>

</div></blockquote></div><br></div></div></div></blockquote></div><br></div>