Skip to content

Commit 2838c93

Browse files
committed
Fix comments and order of checks for a symbol
1 parent 4801398 commit 2838c93

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/ObjCopy/COFF/COFFWriter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Error COFFWriter::finalizeSymbolContents() {
9595
}
9696

9797
Error COFFWriter::finalizeSymIdxContents() {
98-
// CFGuards shouldn't be present in PE
98+
// CFGuards shouldn't be present in PE.
9999
if (Obj.IsPE)
100100
return Error::success();
101101

@@ -114,9 +114,9 @@ Error COFFWriter::finalizeSymIdxContents() {
114114
NeedUpdate |= Sym.OriginalRawIndex != Sym.RawIndex;
115115
SymIdMap[Sym.OriginalRawIndex] = Sym.RawIndex;
116116

117-
// We collect only definition symbols of the sections to update checksum
118-
if (Sym.Sym.NumberOfAuxSymbols == 1 &&
119-
Sym.Sym.StorageClass == IMAGE_SYM_CLASS_STATIC && Sym.Sym.Value == 0 &&
117+
// We collect only definition symbols of the sections to update checksum.
118+
if (Sym.Sym.StorageClass == IMAGE_SYM_CLASS_STATIC &&
119+
Sym.Sym.NumberOfAuxSymbols == 1 && Sym.Sym.Value == 0 &&
120120
IsSymIdxSection(Sym.Name))
121121
SecIdMap[Sym.TargetSectionId] =
122122
reinterpret_cast<coff_aux_section_definition *>(
@@ -143,7 +143,7 @@ Error COFFWriter::finalizeSymIdxContents() {
143143
"symbol or the symbol has unexpected format",
144144
Sec.Name.str().c_str());
145145

146-
// Create updated content
146+
// Create updated content.
147147
ArrayRef<support::ulittle32_t> Ids(
148148
reinterpret_cast<const support::ulittle32_t *>(RawIds.data()),
149149
RawIds.size() / 4);
@@ -159,7 +159,7 @@ Error COFFWriter::finalizeSymIdxContents() {
159159
}
160160
ArrayRef<uint8_t> NewRawIds(reinterpret_cast<uint8_t *>(NewIds.data()),
161161
RawIds.size());
162-
// Update check sum
162+
// Update check sum.
163163
JamCRC JC(/*Init=*/0);
164164
JC.update(NewRawIds);
165165
SecDefIt->getSecond()->CheckSum = JC.getCRC();

0 commit comments

Comments
 (0)