aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp')
-rw-r--r--contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp b/contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp
index dd852d6ef7..973c59057c 100644
--- a/contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp
+++ b/contrib/libs/llvm12/lib/MC/StringTableBuilder.cpp
@@ -33,12 +33,12 @@ void StringTableBuilder::initSize() {
case DWARF:
Size = 0;
break;
- case MachOLinked:
- case MachO64Linked:
- Size = 2;
- break;
+ case MachOLinked:
+ case MachO64Linked:
+ Size = 2;
+ break;
case MachO:
- case MachO64:
+ case MachO64:
case ELF:
// Start the table with a NUL byte.
Size = 1;
@@ -166,17 +166,17 @@ void StringTableBuilder::finalizeStringTable(bool Optimize) {
}
}
- if (K == MachO || K == MachOLinked)
+ if (K == MachO || K == MachOLinked)
Size = alignTo(Size, 4); // Pad to multiple of 4.
- if (K == MachO64 || K == MachO64Linked)
- Size = alignTo(Size, 8); // Pad to multiple of 8.
-
- // According to ld64 the string table of a final linked Mach-O binary starts
- // with " ", i.e. the first byte is ' ' and the second byte is zero. In
- // 'initSize()' we reserved the first two bytes for holding this string.
- if (K == MachOLinked || K == MachO64Linked)
- StringIndexMap[CachedHashStringRef(" ")] = 0;
-
+ if (K == MachO64 || K == MachO64Linked)
+ Size = alignTo(Size, 8); // Pad to multiple of 8.
+
+ // According to ld64 the string table of a final linked Mach-O binary starts
+ // with " ", i.e. the first byte is ' ' and the second byte is zero. In
+ // 'initSize()' we reserved the first two bytes for holding this string.
+ if (K == MachOLinked || K == MachO64Linked)
+ StringIndexMap[CachedHashStringRef(" ")] = 0;
+
// The first byte in an ELF string table must be null, according to the ELF
// specification. In 'initSize()' we reserved the first byte to hold null for
// this purpose and here we actually add the string to allow 'getOffset()' to