<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 2, 2013 at 3:49 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 02/12/2013 02:01, Rui Ueyama wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Sun, Dec 1, 2013 at 5:53 PM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a>>> wrote:<br>

<br>
<br>
    On 02/12/2013 01:05, Rui Ueyama wrote:<br>
<br>
        On Sun, Dec 1, 2013 at 3:58 PM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a><br></div>
        <mailto:<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a>> <mailto:<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a><div><div class="h5"><br>

        <mailto:<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a>>>> wrote:<br>
<br>
            Author: alp<br>
            Date: Sun Dec  1 17:58:45 2013<br>
            New Revision: 196054<br>
<br>
            URL: <a href="http://llvm.org/viewvc/llvm-project?rev=196054&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project?rev=196054&view=rev</a><br>
            Log:<br>
            Fix "don't" typos missed in previous commit<br>
<br>
            Modified:<br>
                lld/trunk/include/lld/<u></u>ReaderWriter/<u></u>ELFLinkingContext.h<br>
                lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h<br>
                lld/trunk/lib/ReaderWriter/<u></u>ELF/ExecutableWriter.h<br>
                lld/trunk/lib/ReaderWriter/<u></u>ELF/OutputELFWriter.h<br>
                lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h<br>
                lld/trunk/lib/ReaderWriter/<u></u>ELF/SegmentChunks.h<br>
                lld/trunk/test/elf/X86_64/<u></u>largebss.test<br>
<br>
            Modified:<br>
        lld/trunk/include/lld/<u></u>ReaderWriter/<u></u>ELFLinkingContext.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/include/lld/<u></u>ReaderWriter/<u></u>ELFLinkingContext.h?rev=<u></u>196054&r1=196053&r2=196054&<u></u>view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/include/lld/<u></u>ReaderWriter/<u></u>ELFLinkingContext.h<br>
        (original)<br>
            +++ lld/trunk/include/lld/<u></u>ReaderWriter/<u></u>ELFLinkingContext.h<br>
        Sun Dec<br>
             1 17:58:45 2013<br>
            @@ -45,9 +45,9 @@ public:<br>
               /// creates.<br>
               enum class OutputMagic : uint8_t {<br>
                 DEFAULT, // The default mode, no specific magic set<br>
            -    NMAGIC,  // Disallow shared libraries and dont align<br>
        sections<br>
            +    NMAGIC,  // Disallow shared libraries and don't align<br>
        sections<br>
                          // PageAlign Data, Mark Text Segment/Data<br>
        segment RW<br>
            -    OMAGIC   // Disallow shared libraries and dont align<br>
        sections,<br>
            +    OMAGIC   // Disallow shared libraries and don't align<br>
        sections,<br>
                          // Mark Text Segment/Data segment RW<br>
               };<br>
<br>
<br>
            Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>DefaultLayout.h?rev=196054&r1=<u></u>196053&r2=196054&view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h (original)<br>
            +++ lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h Sun Dec  1<br>
            17:58:45 2013<br>
            @@ -639,7 +639,7 @@ template <class ELFT> void DefaultLayout<br>
                     lookupSectionFlag &= ~(llvm::ELF::SHF_TLS);<br>
<br>
                     Segment<ELFT> *segment;<br>
            -        // We need a separate segment for sections that<br>
        dont have<br>
            +        // We need a separate segment for sections that<br>
        don't have<br>
                     // the segment type to be PT_LOAD<br>
                     if (segmentType != llvm::ELF::PT_LOAD) {<br>
                       const AdditionalSegmentKey key(segmentType,<br>
            lookupSectionFlag);<br>
            @@ -706,7 +706,7 @@ template <class ELFT> void DefaultLayout<br>
               uint64_t offset = 0;<br>
               for (auto si : _segments) {<br>
                 si->setOrdinal(++ordinal);<br>
            -    // Dont assign offsets for segments that are not loadable<br>
            +    // Don't assign offsets for segments that are not<br>
        loadable<br>
                 if (si->segmentType() != llvm::ELF::PT_LOAD)<br>
                   continue;<br>
                 si->assignOffsets(offset);<br>
            @@ -742,7 +742,7 @@ DefaultLayout<ELFT>::<u></u>assignVirtualAddres<br>
               while (true) {<br>
                 for (auto si : _segments) {<br>
                   si->finalize();<br>
            -      // Dont add PT_NULL segments into the program header<br>
            +      // Don't add PT_NULL segments into the program header<br>
                   if (si->segmentType() != llvm::ELF::PT_NULL)<br>
                     newSegmentHeaderAdded =<br>
        _programHeader->addSegment(si)<u></u>;<br>
                 }<br>
            @@ -778,7 +778,7 @@ DefaultLayout<ELFT>::<u></u>assignVirtualAddres<br>
                   } else {<br>
                     si->setVAddr(virtualAddress);<br>
                     // The first segment has the virtualAddress set<br>
        to the<br>
            base address as<br>
            -        // we have added the file header and the program<br>
        header<br>
            dont align the<br>
            +        // we have added the file header and the program<br>
        header<br>
            don't align the<br>
                     // first segment to the pagesize<br>
                     si->assignVirtualAddress(<u></u>address);<br>
                     si->setMemSize(address - virtualAddress);<br>
            @@ -841,7 +841,7 @@ DefaultLayout<ELFT>::<u></u>assignOffsetsForMis<br>
               uint64_t fileoffset = 0;<br>
               uint64_t size = 0;<br>
               for (auto si : _segments) {<br>
            -    // Dont calculate offsets from non loadable segments<br>
            +    // Don't calculate offsets from non loadable segments<br>
                 if ((si->segmentType() != llvm::ELF::PT_LOAD) &&<br>
                     (si->segmentType() != llvm::ELF::PT_NULL))<br>
                   continue;<br>
<br>
            Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/ExecutableWriter.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>ExecutableWriter.h?rev=196054&<u></u>r1=196053&r2=196054&view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/lib/ReaderWriter/<u></u>ELF/ExecutableWriter.h<br>
        (original)<br>
            +++ lld/trunk/lib/ReaderWriter/<u></u>ELF/ExecutableWriter.h Sun<br>
        Dec  1<br>
            17:58:45 2013<br>
            @@ -122,7 +122,7 @@ template <class ELFT> void ExecutableWri<br>
<br>
               auto bssSection = this->_layout-><u></u>findOutputSection(".bss");<br>
<br>
            -  // If we dont find a bss section, then dont set these<br>
        values<br>
            +  // If we don't find a bss section, then don't set these<br>
        values<br>
               if (bssSection) {<br>
                 (*bssStartAtomIter)->_<u></u>virtualAddr =<br>
        bssSection->virtualAddr();<br>
                 (*bssEndAtomIter)->_<u></u>virtualAddr =<br>
<br>
            Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/OutputELFWriter.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>OutputELFWriter.h?rev=196054&<u></u>r1=196053&r2=196054&view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/lib/ReaderWriter/<u></u>ELF/OutputELFWriter.h<br>
        (original)<br>
            +++ lld/trunk/lib/ReaderWriter/<u></u>ELF/OutputELFWriter.h Sun<br>
        Dec  1<br>
            17:58:45 2013<br>
            @@ -188,7 +188,7 @@ void OutputELFWriter<ELFT>::<u></u>buildDynamic<br>
               // The dynamic symbol table need to be sorted earlier<br>
        because<br>
            the hash<br>
               // table needs to be built using the dynamic symbol<br>
        table. It<br>
            would be<br>
               // late to sort the symbols due to that in finalize. In the<br>
            dynamic symbol<br>
            -  // table finalize, we call the symbol table finalize and we<br>
            dont want to<br>
            +  // table finalize, we call the symbol table finalize and we<br>
            don't want to<br>
               // sort again<br>
               _dynamicSymbolTable-><u></u>sortSymbols();<br>
<br>
<br>
            Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>SectionChunks.h?rev=196054&r1=<u></u>196053&r2=196054&view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h (original)<br>
            +++ lld/trunk/lib/ReaderWriter/<u></u>ELF/SectionChunks.h Sun Dec  1<br>
            17:58:45 2013<br>
            @@ -790,7 +790,7 @@ void SymbolTable<ELFT>::<u></u>addUndefinedAtom<br>
             }<br>
<br>
             /// Add a symbol to the symbol Table, definedAtoms which get<br>
            added to the symbol<br>
            -/// section dont have their virtual addresses set at the<br>
        time of<br>
            adding the<br>
            +/// section don't have their virtual addresses set at the<br>
        time of<br>
            adding the<br>
             /// symbol to the symbol table(Example: dynamic symbols), the<br>
            addresses needs<br>
             /// to be updated in the table before writing the dynamic<br>
        symbol<br>
            table<br>
             /// information<br>
            @@ -885,7 +885,7 @@ public:<br>
<br>
               virtual void finalize() {<br>
                 // Defined symbols which have been added into the dynamic<br>
            symbol table<br>
            -    // dont have their addresses known until addresses<br>
        have been<br>
            assigned<br>
            +    // don't have their addresses known until addresses<br>
        have been<br>
            assigned<br>
                 // so lets update the symbol values after they have<br>
        got assigned<br>
                 for (auto &ste: this->_symbolTable) {<br>
                   const lld::AtomLayout *atomLayout = ste._atomLayout;<br>
            @@ -894,7 +894,7 @@ public:<br>
                   ste._symbol.st_value = atomLayout->_virtualAddr;<br>
                 }<br>
<br>
            -    // Dont sort the symbols<br>
            +    // Don't sort the symbols<br>
                 SymbolTable<ELFT>::finalize(<u></u>false);<br>
               }<br>
<br>
<br>
            Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/SegmentChunks.h<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/<u></u>SegmentChunks.h?rev=196054&r1=<u></u>196053&r2=196054&view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/lib/ReaderWriter/<u></u>ELF/SegmentChunks.h (original)<br>
            +++ lld/trunk/lib/ReaderWriter/<u></u>ELF/SegmentChunks.h Sun Dec  1<br>
            17:58:45 2013<br>
            @@ -570,7 +570,7 @@ template <class ELFT> void Segment<ELFT><br>
                     tlsStartAddr += section->memSize();<br>
                   section->setMemSize(addr + section->memSize() -<br>
            section->virtualAddr());<br>
                   // TBSS section is special that it doesnot<br>
        contribute to<br>
            memory of any<br>
<br>
<br>
        We should probably s/doesnot/doesn't/ as well?<br>
<br>
<br>
    Done with a couple of other fixes in r196056. I see a few more<br>
    potential grammar issues that but will hand it over to you.<br>
<br>
    I'm planning to run this on LLVM core and clang, but only after<br>
    we're sure there are no false-positives and 3.4 has been finalized<br>
    so as not to make backporting difficult for Bill in the next<br>
    couple of weeks given the size of the patches.<br>
<br>
<br>
Yeah, I guess simple sed wouldn't work as weird spelling might be a valid identifier in code. I'm wondering if clang-format has a feature to fix typos only in comments...<br>
</div></div></blockquote>
<br>
That's the first thing that came to my mind, but it turns out that comments are full of domain-specific jargon which evolves over time. A "real" spell checker would too readily change words that look similar to English. IMO it's better to miss a few typos rather than attempting to fix everything Microsoft Word style.<br>

<br>
Because of that, I'm satisfied with this approach finding the most common mistakes in all files including rst documentation, identifiers / function names (see r195985) etc. Best of all, it's catching embarrassing mistakes in user-visible strings like llvm::opt descriptions and static analyser notes, which matter more than typos in comments.<br>

<br>
So If I had one feature request for clang-format, it would actually be comment re-flow --</blockquote><div><br></div><div>It is on our list of things to do...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 the spell checker is currently set up to skip all typo corrections that push the line width beyond 80-columns just because there's no obvious way to fix up the resulting coding style.<br>
<br>
Alp.<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
    FWIW lld had the one of the lowest typo counts per line amongst<br>
    the LLVM modules :-)<br>
<br>
    Alp.<br>
<br>
<br>
<br>
            -      // segment, If we see a tbss section, dont add<br>
        memory size<br>
            to addr<br>
            +      // segment, If we see a tbss section, don't add<br>
        memory size<br>
            to addr<br>
                   // The fileOffset is automatically taken care of<br>
        since TBSS<br>
            section does<br>
                   // not endup using file size<br>
                   if (section->order() !=<br>
        DefaultLayout<ELFT>::ORDER_<u></u>TBSS)<br>
<br>
            Modified: lld/trunk/test/elf/X86_64/<u></u>largebss.test<br>
            URL:<br>
        <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/largebss.test?rev=196054&r1=196053&r2=196054&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/test/elf/<u></u>X86_64/largebss.test?rev=<u></u>196054&r1=196053&r2=196054&<u></u>view=diff</a><br>

                   ==============================<u></u>==============================<u></u>==================<br>
            --- lld/trunk/test/elf/X86_64/<u></u>largebss.test (original)<br>
            +++ lld/trunk/test/elf/X86_64/<u></u>largebss.test Sun Dec  1<br>
        17:58:45 2013<br>
            @@ -1,5 +1,5 @@<br>
             # This tests the functionality of handling BSS symbols<br>
            -# BSS symbols dont occupy file content and are associated<br>
        with<br>
            typeZeroFill<br>
            +# BSS symbols don't occupy file content and are<br>
        associated with<br>
            typeZeroFill<br>
             # Any typeZeroFill content wouldnot have space reserved<br>
        in the<br>
            file to store<br>
             # its content<br>
<br>
<br>
<br>
            ______________________________<u></u>_________________<br>
            llvm-commits mailing list<br>
        <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.<u></u>edu</a>><br>
</div></div>
        <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.<u></u>edu</a><div class="im"><br>
        <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.<u></u>edu</a>>><br>
        <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
<br>
<br>
    --     <a href="http://www.nuanti.com" target="_blank" class="cremed">http://www.nuanti.com</a><br>
    the browser experts<br>
<br>
<br>
</div></blockquote><div class="im">
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank" class="cremed">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
</div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>