<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 dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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 class="HOEnZb"><div class="h5"><br>
<br>
On 6/22/2013 5:12 PM, Rui Ueyama wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: ruiu<br>
Date: Sat Jun 22 17:12:30 2013<br>
New Revision: 184651<br>
<br>
URL: <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: <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>
  class SectionChunk : public Chunk {<br>
  public:<br>
    static SectionChunk*  make(DefinedAtom::ContentType,<br>
-                             const MachOTargetInfo &ti,<br>
                               MachOWriter &writer);<br>
    virtual StringRef     segmentName() const;<br>
    virtual bool          occupiesNoDiskSpace();<br>
@@ -128,12 +127,10 @@ private:<br>
                  SectionChunk(StringRef seg,<br>
                               StringRef sect,<br>
                               uint32_t flags,<br>
-                             const MachOTargetInfo &ti,<br>
                               MachOWriter &writer);<br>
      StringRef                 _segmentName;<br>
    StringRef                 _sectionName;<br>
-  const MachOTargetInfo    &_targetInfo;<br>
    MachOWriter              &_writer;<br>
    uint32_t                  _flags;<br>
    uint32_t                  _permissions;<br>
@@ -456,46 +453,38 @@ void Chunk::assignFileOffset(<u></u>uint64_t &c<br>
  //===-------------------------<u></u>------------------------------<u></u>---------------===//<br>
    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>
    }<br>
    SectionChunk* SectionChunk::make(<u></u>DefinedAtom::ContentType type,<br>
-                                 const MachOTargetInfo &ti,<br>
                                   MachOWriter &writer) {<br>
    switch ( type ) {<br>
      case DefinedAtom::typeCode:<br>
        return new SectionChunk("__TEXT", "__text",<br>
-                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS,<br>
-                              ti, writer);<br>
+                              S_REGULAR | S_ATTR_PURE_INSTRUCTIONS, writer);<br>
        break;<br>
      case DefinedAtom::typeCString:<br>
         return new SectionChunk("__TEXT", "__cstring",<br>
-                               S_CSTRING_LITERALS,<br>
-                              ti, writer);<br>
+                               S_CSTRING_LITERALS, writer);<br>
         break;<br>
      case DefinedAtom::typeStub:<br>
        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>
        break;<br>
      case DefinedAtom::typeStubHelper:<br>
        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>
        break;<br>
      case DefinedAtom::typeLazyPointer:<br>
        return new SectionChunk("__DATA", "__la_symbol_ptr",<br>
-                              S_LAZY_SYMBOL_POINTERS,<br>
-                              ti, writer);<br>
+                              S_LAZY_SYMBOL_POINTERS, writer);<br>
        break;<br>
      case DefinedAtom::typeGOT:<br>
        return new SectionChunk("__DATA", "__got",<br>
-                              S_NON_LAZY_SYMBOL_POINTERS,<br>
-                              ti, writer);<br>
+                              S_NON_LAZY_SYMBOL_POINTERS, writer);<br>
        break;<br>
      default:<br>
        assert(0 && "TO DO: add support for more sections");<br>
@@ -1320,7 +1309,7 @@ void MachOWriter::createChunks(<u></u>const lld<br>
      DefinedAtom::ContentType type = atom->contentType();<br>
      auto pos = map.find(type);<br>
      if ( pos == map.end() ) {<br>
-      SectionChunk *chunk = SectionChunk::make(type, _targetInfo, *this);<br>
+      SectionChunk *chunk = SectionChunk::make(type, *this);<br>
        map[type] = chunk;<br>
        chunk->appendAtom(atom);<br>
      }<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 class="HOEnZb"><font color="#888888">
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div>