Skip to content

Commit 2e2038b

Browse files
committed
[COFF] Rename variale references in comments after VariableName -> variableName change
llvm-svn: 366193
1 parent 33fdf82 commit 2e2038b

11 files changed

+24
-24
lines changed

lld/COFF/Chunks.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ namespace coff {
3131

3232
SectionChunk::SectionChunk(ObjFile *f, const coff_section *h)
3333
: Chunk(SectionKind), file(f), header(h), repl(this) {
34-
// Initialize Relocs.
34+
// Initialize relocs.
3535
setRelocs(file->getCOFFObj()->getRelocations(header));
3636

37-
// Initialize SectionName.
37+
// Initialize sectionName.
3838
StringRef sectionName;
3939
if (Expected<StringRef> e = file->getCOFFObj()->getSectionName(header))
4040
sectionName = *e;
@@ -218,7 +218,7 @@ void applyArm64Addr(uint8_t *off, uint64_t s, uint64_t p, int shift) {
218218

219219
// Update the immediate field in a AARCH64 ldr, str, and add instruction.
220220
// Optionally limit the range of the written immediate by one or more bits
221-
// (RangeLimit).
221+
// (rangeLimit).
222222
void applyArm64Imm(uint8_t *off, uint64_t imm, uint32_t rangeLimit) {
223223
uint32_t orig = read32le(off);
224224
imm += (orig >> 10) & 0xFFF;
@@ -561,7 +561,7 @@ void SectionChunk::getRuntimePseudoRelocs(
561561
toString(file));
562562
continue;
563563
}
564-
// SizeInBits is used to initialize the Flags field; currently no
564+
// sizeInBits is used to initialize the Flags field; currently no
565565
// other flags are defined.
566566
res.emplace_back(
567567
RuntimePseudoReloc(target, this, rel.VirtualAddress, sizeInBits));

lld/COFF/Config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Export {
4949

5050
// If an export is a form of /export:foo=dllname.bar, that means
5151
// that foo should be exported as an alias to bar in the DLL.
52-
// ForwardTo is set to "dllname.bar" part. Usually empty.
52+
// forwardTo is set to "dllname.bar" part. Usually empty.
5353
StringRef forwardTo;
5454
StringChunk *forwardChunk = nullptr;
5555

lld/COFF/DLL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void IdataContents::create() {
567567
// Create .idata contents for each DLL.
568568
for (std::vector<DefinedImportData *> &syms : v) {
569569
// Create lookup and address tables. If they have external names,
570-
// we need to create HintName chunks to store the names.
570+
// we need to create hintName chunks to store the names.
571571
// If they don't (if they are import-by-ordinals), we store only
572572
// ordinal values to the table.
573573
size_t base = lookups.size();

lld/COFF/Driver.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ static void findKeepUniqueSections() {
936936
}
937937
}
938938

939-
// link.exe replaces each %foo% in AltPath with the contents of environment
939+
// link.exe replaces each %foo% in altPath with the contents of environment
940940
// variable foo, and adds the two magic env vars _PDB (expands to the basename
941941
// of pdb's output path) and _EXT (expands to the extension of the output
942942
// binary).
@@ -952,9 +952,9 @@ static void parsePDBAltPath(StringRef altPath) {
952952
binaryExtension = binaryExtension.substr(1); // %_EXT% does not include '.'.
953953

954954
// Invariant:
955-
// +--------- Cursor ('a...' might be the empty string).
956-
// | +----- FirstMark
957-
// | | +- SecondMark
955+
// +--------- cursor ('a...' might be the empty string).
956+
// | +----- firstMark
957+
// | | +- secondMark
958958
// v v v
959959
// a...%...%...
960960
size_t cursor = 0;

lld/COFF/DriverUtils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class TemporaryFile {
345345
// so it is safe to remove the file immediately after this function
346346
// is called (you cannot remove an opened file on Windows.)
347347
std::unique_ptr<MemoryBuffer> getMemoryBuffer() {
348-
// IsVolatileSize=true forces MemoryBuffer to not use mmap().
348+
// IsVolatile=true forces MemoryBuffer to not use mmap().
349349
return CHECK(MemoryBuffer::getFile(path, /*FileSize=*/-1,
350350
/*RequiresNullTerminator=*/false,
351351
/*IsVolatile=*/true),

lld/COFF/InputFiles.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ Optional<Symbol *> ObjFile::createDefined(
556556
// The second symbol entry has the name of the comdat symbol, called the
557557
// "comdat leader".
558558
// When this function is called for the first symbol entry of a comdat,
559-
// it sets ComdatDefs and returns None, and when it's called for the second
560-
// symbol entry it reads ComdatDefs and then sets it back to nullptr.
559+
// it sets comdatDefs and returns None, and when it's called for the second
560+
// symbol entry it reads comdatDefs and then sets it back to nullptr.
561561

562562
// Handle comdat leader.
563563
if (const coff_aux_section_definition *def = comdatDefs[sectionNumber]) {
@@ -626,7 +626,7 @@ ArrayRef<uint8_t> ObjFile::getDebugSection(StringRef secName) {
626626
// even if the TU was compiled with no debug info. At least two records are
627627
// always there. S_OBJNAME stores a 32-bit signature, which is loaded into the
628628
// PCHSignature member. S_COMPILE3 stores compile-time cmd-line flags. This is
629-
// currently used to initialize the HotPatchable member.
629+
// currently used to initialize the hotPatchable member.
630630
void ObjFile::initializeFlags() {
631631
ArrayRef<uint8_t> data = getDebugSection(".debug$S");
632632
if (data.empty())
@@ -764,7 +764,7 @@ void ImportFile::parse() {
764764

765765
impSym = symtab->addImportData(impName, this);
766766
// If this was a duplicate, we logged an error but may continue;
767-
// in this case, ImpSym is nullptr.
767+
// in this case, impSym is nullptr.
768768
if (!impSym)
769769
return;
770770

lld/COFF/InputFiles.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ObjFile : public InputFile {
119119

120120
ArrayRef<uint8_t> getDebugSection(StringRef secName);
121121

122-
// Returns a Symbol object for the SymbolIndex'th symbol in the
122+
// Returns a Symbol object for the symbolIndex'th symbol in the
123123
// underlying object file.
124124
Symbol *getSymbol(uint32_t symbolIndex) {
125125
return symbols[symbolIndex];

lld/COFF/PDB.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class PDBLinker {
119119
///
120120
/// If the object does not use a type server PDB (compiled with /Z7), we merge
121121
/// all the type and item records from the .debug$S stream and fill in the
122-
/// caller-provided ObjectIndexMap.
122+
/// caller-provided objectIndexMap.
123123
Expected<const CVIndexMap &> mergeDebugT(ObjFile *file,
124124
CVIndexMap *objectIndexMap);
125125

@@ -683,7 +683,7 @@ static void translateIdSymbols(MutableArrayRef<uint8_t> &recordData,
683683

684684
TypeIndex *ti =
685685
reinterpret_cast<TypeIndex *>(content.data() + refs[0].Offset);
686-
// `TI` is the index of a FuncIdRecord or MemberFuncIdRecord which lives in
686+
// `ti` is the index of a FuncIdRecord or MemberFuncIdRecord which lives in
687687
// the IPI stream, whose `FunctionType` member refers to the TPI stream.
688688
// Note that LF_FUNC_ID and LF_MEMFUNC_ID have the same record layout, and
689689
// in both cases we just need the second type index.
@@ -1729,7 +1729,7 @@ static bool findLineTable(const SectionChunk *c, uint32_t addr,
17291729
if (dbgC->getSectionName() != ".debug$S")
17301730
continue;
17311731

1732-
// Build a mapping of SECREL relocations in DbgC that refer to C.
1732+
// Build a mapping of SECREL relocations in dbgC that refer to `c`.
17331733
DenseMap<uint32_t, uint32_t> secrels;
17341734
for (const coff_relocation &r : dbgC->getRelocs()) {
17351735
if (r.Type != secrelReloc)

lld/COFF/SymbolTable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool SymbolTable::handleMinGWAutomaticImport(Symbol *sym, StringRef name) {
192192

193193
// Replace the reference directly to a variable with a reference
194194
// to the import address table instead. This obviously isn't right,
195-
// but we mark the symbol as IsRuntimePseudoReloc, and a later pass
195+
// but we mark the symbol as isRuntimePseudoReloc, and a later pass
196196
// will add runtime pseudo relocations for every relocation against
197197
// this Symbol. The runtime pseudo relocation framework expects the
198198
// reference itself to point at the IAT entry.

lld/COFF/SymbolTable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class SymbolTable {
112112
private:
113113
/// Inserts symbol if not already present.
114114
std::pair<Symbol *, bool> insert(StringRef name);
115-
/// Same as insert(Name), but also sets IsUsedInRegularObj.
115+
/// Same as insert(Name), but also sets isUsedInRegularObj.
116116
std::pair<Symbol *, bool> insert(StringRef name, InputFile *f);
117117

118118
std::vector<Symbol *> getSymsWithPrefix(StringRef prefix);

lld/COFF/Writer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void OutputSection::addContributingPartialSection(PartialSection *sec) {
335335
} // namespace lld
336336

337337
// Check whether the target address S is in range from a relocation
338-
// of type RelType at address P.
338+
// of type relType at address P.
339339
static bool isInRange(uint16_t relType, uint64_t s, uint64_t p, int margin) {
340340
if (config->machine == ARMNT) {
341341
int64_t diff = AbsoluteDifference(s, p + 4) + margin;
@@ -427,7 +427,7 @@ static bool createThunks(OutputSection *os, int margin) {
427427

428428
// The estimate of the source address P should be pretty accurate,
429429
// but we don't know whether the target Symbol address should be
430-
// offset by ThunkSize or not (or by some of ThunksSize but not all of
430+
// offset by thunksSize or not (or by some of thunksSize but not all of
431431
// it), giving us some uncertainty once we have added one thunk.
432432
uint64_t p = sc->getRVA() + rel.VirtualAddress + thunksSize;
433433

@@ -1626,7 +1626,7 @@ void Writer::markSymbolsForRVATable(ObjFile *file,
16261626
}
16271627

16281628
// Replace the absolute table symbol with a synthetic symbol pointing to
1629-
// TableChunk so that we can emit base relocations for it and resolve section
1629+
// tableChunk so that we can emit base relocations for it and resolve section
16301630
// relative relocations.
16311631
void Writer::maybeAddRVATable(SymbolRVASet tableSymbols, StringRef tableSym,
16321632
StringRef countSym) {

0 commit comments

Comments
 (0)