<div dir="ltr">As discussed in the previous thread and noted in the comment, this was a temporary measure until we enable RoundTripYAMLPass test. If there are duplicate atoms, YAML reader would complain that there are duplicates in the input (it currently does, and if it wouldn't it's a bug of the reader). I don't see a reason to keep a test that's basically redundant. IMO this code is technical debt rather than a useful test.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 2:26 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">You should add this as a pass to detect duplicate atoms before the YAML/Native RoundTripPasses.<div class="HOEnZb"><div class="h5">

<br>
<br>
On 11/1/2013 4:11 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: Fri Nov  1 16:11:43 2013<br>
New Revision: 193886<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=193886&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=193886&view=rev</a><br>
Log:<br>
[PECOFF] Remove unnecessary assertion.<br>
<br>
Bugs that would be caught by this assertion would also be caught by<br>
RoundTripYAMLPass test. We've enabled the pass for PECOFF, so we can remove<br>
this.<br>
<br>
Modified:<br>
     lld/trunk/lib/ReaderWriter/<u></u>PECOFF/WriterPECOFF.cpp<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/<u></u>PECOFF/WriterPECOFF.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=193886&r1=193885&r2=193886&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/PECOFF/<u></u>WriterPECOFF.cpp?rev=193886&<u></u>r1=193885&r2=193886&view=diff</a><br>


==============================<u></u>==============================<u></u>==================<br>
--- lld/trunk/lib/ReaderWriter/<u></u>PECOFF/WriterPECOFF.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/<u></u>PECOFF/WriterPECOFF.cpp Fri Nov  1 16:11:43 2013<br>
@@ -807,19 +807,6 @@ public:<br>
        : _PECOFFLinkingContext(context)<u></u>, _numSections(0),<br>
          _imageSizeInMemory(PAGE_SIZE), _imageSizeOnDisk(0) {}<br>
  -  // Make sure there are no duplicate atoms in the file. RoundTripYAMLPass also<br>
-  // fails if there are duplicate atoms. This is a temporary measure until we<br>
-  // enable the pass for PECOFF port.<br>
-  void verifyFile(const File &linkedFile) {<br>
-#ifndef NDEBUG<br>
-    std::set<const DefinedAtom *> set;<br>
-    for (const DefinedAtom *atom : linkedFile.defined()) {<br>
-      assert(set.count(atom) == 0);<br>
-      set.insert(atom);<br>
-    }<br>
-#endif<br>
-  }<br>
-<br>
    // Create all chunks that consist of the output file.<br>
    void build(const File &linkedFile) {<br>
      // Create file chunks and add them to the list.<br>
@@ -890,7 +877,6 @@ public:<br>
    }<br>
      virtual error_code writeFile(const File &linkedFile, StringRef path) {<br>
-    verifyFile(linkedFile);<br>
      this->build(linkedFile);<br>
        uint64_t totalSize = _chunks.back()->fileOffset() + _chunks.back()->size();<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>