summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-02-27 04:23:21 +0000
committerRui Ueyama <ruiu@google.com>2015-02-27 04:23:21 +0000
commit5b3d935fcee8ed13ff5b160dcf4b7fe16be209a6 (patch)
treed411a0730226cc81068c0bef661ef8d803191d06
parente088a0f9899e0c51a138b7a1a8d70ebd1fdbe9d4 (diff)
downloadbcm5719-llvm-5b3d935fcee8ed13ff5b160dcf4b7fe16be209a6.tar.gz
bcm5719-llvm-5b3d935fcee8ed13ff5b160dcf4b7fe16be209a6.zip
Update comments, fix typos.
llvm-svn: 230729
-rw-r--r--lld/lib/ReaderWriter/ELF/ELFFile.h6
-rw-r--r--lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp5
-rw-r--r--lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test2
3 files changed, 8 insertions, 5 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.h b/lld/lib/ReaderWriter/ELF/ELFFile.h
index 60d8ce083ac..66f781a1a6e 100644
--- a/lld/lib/ReaderWriter/ELF/ELFFile.h
+++ b/lld/lib/ReaderWriter/ELF/ELFFile.h
@@ -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(ELFDefinedAtom<ELFT> *from,
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 {
diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
index 422df403480..0c5da203dd3 100644
--- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
@@ -950,7 +950,7 @@ std::error_code FileCOFF::addRelocationReferenceToAtoms() {
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(ArrayRef<uint8_t> array) {
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();
diff --git a/lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test b/lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test
index 8caffd44bdd..e1d0f8e7b55 100644
--- a/lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test
+++ b/lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test
@@ -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:
OpenPOWER on IntegriCloud