[lld] r230729 - Update comments, fix typos.

Rui Ueyama ruiu at google.com
Thu Feb 26 20:23:22 PST 2015


Author: ruiu
Date: Thu Feb 26 22:23:21 2015
New Revision: 230729

URL: http://llvm.org/viewvc/llvm-project?rev=230729&view=rev
Log:
Update comments, fix typos.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
    lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
    lld/trunk/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=230729&r1=230728&r2=230729&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Thu Feb 26 22:23:21 2015
@@ -383,7 +383,7 @@ protected:
   /// sections. They may not reference local symbols for addresses in
   /// the group's sections, including section symbols.
   /// ABI Doc : https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html
-  /// Does the atom need to be redirected using a separate undefined atom ?
+  /// Does the atom need to be redirected using a separate undefined atom?
   bool redirectReferenceUsingUndefAtom(const Elf_Sym *sourceSymbol,
                                        const Elf_Sym *targetSymbol) const;
 
@@ -440,7 +440,7 @@ protected:
   /// \brief the cached options relevant while reading the ELF File
   bool _doStringsMerge;
 
-  /// \brief Is --wrap on ?
+  /// \brief Is --wrap on?
   bool _useWrap;
 
   /// \brief The LinkingContext.
@@ -1166,7 +1166,7 @@ void ELFFile<ELFT>::createEdge(ELFDefine
   from->addReference(reference);
 }
 
-/// Does the atom need to be redirected using a separate undefined atom ?
+/// Does the atom need to be redirected using a separate undefined atom?
 template <class ELFT>
 bool ELFFile<ELFT>::redirectReferenceUsingUndefAtom(
     const Elf_Sym *sourceSymbol, const Elf_Sym *targetSymbol) const {

Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=230729&r1=230728&r2=230729&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Thu Feb 26 22:23:21 2015
@@ -950,7 +950,7 @@ std::error_code FileCOFF::addRelocationR
   for (const auto &sec : _obj->sections()) {
     const coff_section *section = _obj->getCOFFSection(sec);
 
-    // Skip there's no atom for the section. Currently we do not create any
+    // Skip if there's no atom for the section. Currently we do not create any
     // atoms for some sections, such as "debug$S", and such sections need to
     // be skipped here too.
     if (_sectionAtoms.find(section) == _sectionAtoms.end())
@@ -1056,10 +1056,13 @@ StringRef FileCOFF::ArrayRefToString(Arr
   if (array.empty())
     return "";
 
+  // This is equivalent to strnlen, but we don't use the function because
+  // it only exists in recent POSIX standards.
   size_t len = 0;
   size_t e = array.size();
   while (len < e && array[len] != '\0')
     ++len;
+
   std::string *contents =
       new (_alloc) std::string(reinterpret_cast<const char *>(&array[0]), len);
   return StringRef(*contents).trim();

Modified: lld/trunk/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test?rev=230729&r1=230728&r2=230729&view=diff
==============================================================================
--- lld/trunk/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test (original)
+++ lld/trunk/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test Thu Feb 26 22:23:21 2015
@@ -2,7 +2,7 @@
 # appropriately. The testcase has been created by using the following source
 # code.
 # TODO: This test should produce a discarded reference error message which it
-# doesnot currently.
+# does not currently.
 # linkoncea.s
 #        .section .gnu.linkonce.d.dummy,"aw"
 #bar:





More information about the llvm-commits mailing list