[lld] r193886 - [PECOFF] Remove unnecessary assertion.

Rui Ueyama ruiu at google.com
Fri Nov 1 14:36:03 PDT 2013


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.


On Fri, Nov 1, 2013 at 2:26 PM, Shankar Easwaran <shankare at codeaurora.org>wrote:

> You should add this as a pass to detect duplicate atoms before the
> YAML/Native RoundTripPasses.
>
>
> On 11/1/2013 4:11 PM, Rui Ueyama wrote:
>
>> Author: ruiu
>> Date: Fri Nov  1 16:11:43 2013
>> New Revision: 193886
>>
>> URL: http://llvm.org/viewvc/llvm-**project?rev=193886&view=rev<http://llvm.org/viewvc/llvm-project?rev=193886&view=rev>
>> Log:
>> [PECOFF] Remove unnecessary assertion.
>>
>> Bugs that would be caught by this assertion would also be caught by
>> RoundTripYAMLPass test. We've enabled the pass for PECOFF, so we can
>> remove
>> this.
>>
>> Modified:
>>      lld/trunk/lib/ReaderWriter/**PECOFF/WriterPECOFF.cpp
>>
>> Modified: lld/trunk/lib/ReaderWriter/**PECOFF/WriterPECOFF.cpp
>> URL: http://llvm.org/viewvc/llvm-**project/lld/trunk/lib/**
>> ReaderWriter/PECOFF/**WriterPECOFF.cpp?rev=193886&**
>> r1=193885&r2=193886&view=diff<http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=193886&r1=193885&r2=193886&view=diff>
>> ==============================**==============================**
>> ==================
>> --- lld/trunk/lib/ReaderWriter/**PECOFF/WriterPECOFF.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/**PECOFF/WriterPECOFF.cpp Fri Nov  1
>> 16:11:43 2013
>> @@ -807,19 +807,6 @@ public:
>>         : _PECOFFLinkingContext(context)**, _numSections(0),
>>           _imageSizeInMemory(PAGE_SIZE), _imageSizeOnDisk(0) {}
>>   -  // Make sure there are no duplicate atoms in the file.
>> RoundTripYAMLPass also
>> -  // fails if there are duplicate atoms. This is a temporary measure
>> until we
>> -  // enable the pass for PECOFF port.
>> -  void verifyFile(const File &linkedFile) {
>> -#ifndef NDEBUG
>> -    std::set<const DefinedAtom *> set;
>> -    for (const DefinedAtom *atom : linkedFile.defined()) {
>> -      assert(set.count(atom) == 0);
>> -      set.insert(atom);
>> -    }
>> -#endif
>> -  }
>> -
>>     // Create all chunks that consist of the output file.
>>     void build(const File &linkedFile) {
>>       // Create file chunks and add them to the list.
>> @@ -890,7 +877,6 @@ public:
>>     }
>>       virtual error_code writeFile(const File &linkedFile, StringRef
>> path) {
>> -    verifyFile(linkedFile);
>>       this->build(linkedFile);
>>         uint64_t totalSize = _chunks.back()->fileOffset() +
>> _chunks.back()->size();
>>
>>
>> ______________________________**_________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>>
>>
>>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131101/94d2ae00/attachment.html>


More information about the llvm-commits mailing list