aboutsummaryrefslogtreecommitdiff
path: root/lld/lib
diff options
context:
space:
mode:
authorKazuaki Ishizaki <ishizaki@jp.ibm.com>2020-01-06 10:21:05 -0800
committerFangrui Song <maskray@google.com>2020-01-06 10:25:48 -0800
commit7ae3d335467a24faa80ebd9b31446c649570ca0c (patch)
tree2c198b4fca6d45c20d7a8c0c805847f7ce8bf72b /lld/lib
parent5b24c088171d3bd7a8ff559c82926e5d4b04f032 (diff)
downloadllvm-project-7ae3d335467a24faa80ebd9b31446c649570ca0c.tar.gz
[lld] Fix trivial typos in comments
Reviewed By: ruiu, MaskRay Differential Revision: https://reviews.llvm.org/D72196
Diffstat (limited to 'lld/lib')
-rw-r--r--lld/lib/Core/Resolver.cpp2
-rw-r--r--lld/lib/Driver/DarwinLdDriver.cpp8
-rw-r--r--lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/MachO/File.h2
-rw-r--r--lld/lib/ReaderWriter/MachO/GOTPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp2
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp4
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp8
-rw-r--r--lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp4
9 files changed, 17 insertions, 17 deletions
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp
index 88119130852c..d1c3d8159f58 100644
--- a/lld/lib/Core/Resolver.cpp
+++ b/lld/lib/Core/Resolver.cpp
@@ -435,7 +435,7 @@ bool Resolver::checkUndefines() {
return true;
}
-// remove from _atoms all coaleseced away atoms
+// Remove from _atoms all coalesced away atoms.
void Resolver::removeCoalescedAwayAtoms() {
DEBUG_WITH_TYPE("resolver",
llvm::dbgs() << "******** Removing coalesced away atoms:\n");
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp
index 10e0aa3d9fee..062e945bbd83 100644
--- a/lld/lib/Driver/DarwinLdDriver.cpp
+++ b/lld/lib/Driver/DarwinLdDriver.cpp
@@ -788,7 +788,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
break;
case llvm::MachO::MH_EXECUTE:
// dynamic executables default to generating a version load command,
- // while static exectuables only generate it if required.
+ // while static executables only generate it if required.
if (isStaticExecutable) {
if (flagOn)
ctx.setGenerateVersionLoadCommand(true);
@@ -836,7 +836,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
break;
case llvm::MachO::MH_EXECUTE:
// dynamic executables default to generating a version load command,
- // while static exectuables only generate it if required.
+ // while static executables only generate it if required.
if (isStaticExecutable) {
if (flagOn)
ctx.setGenerateFunctionStartsLoadCommand(true);
@@ -885,7 +885,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
break;
case llvm::MachO::MH_EXECUTE:
// dynamic executables default to generating a version load command,
- // while static exectuables only generate it if required.
+ // while static executables only generate it if required.
if (isStaticExecutable) {
if (flagOn)
ctx.setGenerateDataInCodeLoadCommand(true);
@@ -926,7 +926,7 @@ bool parse(llvm::ArrayRef<const char *> args, MachOLinkingContext &ctx) {
ctx.setSdkVersion(sdkVersion);
} else if (ctx.generateVersionLoadCommand()) {
// If we don't have an sdk version, but were going to emit a load command
- // with min_version, then we need to give an warning as we have no sdk
+ // with min_version, then we need to give a warning as we have no sdk
// version to put in that command.
// FIXME: We need to decide whether to make this an error.
warn("-sdk_version is required when emitting min version load command. "
diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
index 44e6a29a0b60..94a105a6f159 100644
--- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
@@ -304,7 +304,7 @@ private:
// also probably be sorted by frequency.
assert(personalities.size() <= 4);
- // TODO: Find commmon encodings for use by compressed pages.
+ // TODO: Find common encodings for use by compressed pages.
std::vector<uint32_t> commonEncodings;
// Now sort the entries by final address and fixup the compact encoding to
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h
index 1cc1c4109dce..072702973f81 100644
--- a/lld/lib/ReaderWriter/MachO/File.h
+++ b/lld/lib/ReaderWriter/MachO/File.h
@@ -135,7 +135,7 @@ public:
_undefAtoms[name] = atom;
}
- /// Search this file for an the atom from 'section' that covers
+ /// Search this file for the atom from 'section' that covers
/// 'offsetInSect'. Returns nullptr is no atom found.
MachODefinedAtom *findAtomCoveringAddress(const Section &section,
uint64_t offsetInSect,
diff --git a/lld/lib/ReaderWriter/MachO/GOTPass.cpp b/lld/lib/ReaderWriter/MachO/GOTPass.cpp
index 514dd4e09da8..0f80dfa19d09 100644
--- a/lld/lib/ReaderWriter/MachO/GOTPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/GOTPass.cpp
@@ -109,7 +109,7 @@ private:
assert(target != nullptr);
if (!shouldReplaceTargetWithGOTAtom(target, canBypassGOT)) {
- // Update reference kind to reflect that target is a direct accesss.
+ // Update reference kind to reflect that target is a direct access.
_archHandler.updateReferenceToGOT(ref, false);
} else {
// Replace the target with a reference to a GOT entry.
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
index 221d895a40d0..0be1c10a7ab0 100644
--- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
@@ -830,7 +830,7 @@ void MachOLinkingContext::addExportSymbol(StringRef sym) {
}
// Only i386 MacOSX uses old ABI, so don't change those.
if ((_os != OS::macOSX) || (_arch != arch_x86)) {
- // ObjC has two differnent ABIs. Be nice and allow one export list work for
+ // ObjC has two different ABIs. Be nice and allow one export list work for
// both ABIs by renaming symbols.
if (sym.startswith(".objc_class_name_")) {
std::string abi2className("_OBJC_CLASS_$_");
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
index ab7ea7e07f23..17b45b9ca827 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
@@ -1267,7 +1267,7 @@ void TrieNode::addSymbol(const Export& entry,
edge._child->addSymbol(entry, allocator, allNodes);
return;
}
- // See if string has commmon prefix with existing edge.
+ // See if string has common prefix with existing edge.
for (int n=edgeStr.size()-1; n > 0; --n) {
if (partialStr.substr(0, n).equals(edgeStr.substr(0, n))) {
// Splice in new node: was A -> C, now A -> B -> C
@@ -1351,7 +1351,7 @@ bool TrieNode::updateOffset(uint32_t& offset) {
nodeSize += llvm::getULEB128Size(nodeSize);
}
// Compute size of all child edges.
- ++nodeSize; // Byte for number of chidren.
+ ++nodeSize; // Byte for number of children.
for (TrieEdge &edge : _children) {
nodeSize += edge._subString.size() + 1 // String length.
+ llvm::getULEB128Size(edge._child->_trieOffset); // Offset len.
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
index 6f294b1ecd0f..3347bb13508e 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
@@ -253,7 +253,7 @@ void atomFromSymbol(DefinedAtom::ContentType atomType, const Section &section,
? DefinedAtom::mergeAsWeak : DefinedAtom::mergeNo;
bool thumb = (symbolDescFlags & N_ARM_THUMB_DEF);
if (atomType == DefinedAtom::typeUnknown) {
- // Mach-O needs a segment and section name. Concatentate those two
+ // Mach-O needs a segment and section name. Concatenate those two
// with a / separator (e.g. "seg/sect") to fit into the lld model
// of just a section name.
std::string segSectName = section.segmentName.str()
@@ -326,7 +326,7 @@ llvm::Error processSymboledSection(DefinedAtom::ContentType atomType,
return llvm::Error::success();
if (symbols.empty()) {
- // Section has no symbols, put all content in one anoymous atom.
+ // Section has no symbols, put all content in one anonymous atom.
atomFromSymbol(atomType, section, file, section.address, StringRef(),
0, Atom::scopeTranslationUnit,
section.address + section.content.size(),
@@ -471,7 +471,7 @@ llvm::Error processSection(DefinedAtom::ContentType atomType,
"is not zero terminated.");
}
if (customSectionName) {
- // Mach-O needs a segment and section name. Concatentate those two
+ // Mach-O needs a segment and section name. Concatenate those two
// with a / separator (e.g. "seg/sect") to fit into the lld model
// of just a section name.
std::string segSectName = section.segmentName.str()
@@ -1460,7 +1460,7 @@ normalizedObjectToAtoms(MachOFile *file,
}
// Create atoms from undefined symbols.
for (auto &sym : normalizedFile.undefinedSymbols) {
- // Undefinded symbols with n_value != 0 are actually tentative definitions.
+ // Undefined symbols with n_value != 0 are actually tentative definitions.
if (sym.value == Hex64(0)) {
file->addUndefinedAtom(sym.name, copyRefs);
} else {
diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
index 77936399c1af..23c20aa2ba1c 100644
--- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
+++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
@@ -121,7 +121,7 @@ public:
StringRef newName = copyString(buffer.str());
_refNames[&atom] = newName;
DEBUG_WITH_TYPE("WriterYAML",
- llvm::dbgs() << "name collsion: creating ref-name: '"
+ llvm::dbgs() << "name collision: creating ref-name: '"
<< newName << "' ("
<< (const void *)newName.data()
<< ", " << newName.size() << ")\n");
@@ -135,7 +135,7 @@ public:
StringRef newName2 = copyString(buffer2.str());
_refNames[prevAtom] = newName2;
DEBUG_WITH_TYPE("WriterYAML",
- llvm::dbgs() << "name collsion: creating ref-name: '"
+ llvm::dbgs() << "name collision: creating ref-name: '"
<< newName2 << "' ("
<< (const void *)newName2.data() << ", "
<< newName2.size() << ")\n");