Skip to content

Commit c13902b

Browse files
committed
Address comments from alx32
1 parent 13f2956 commit c13902b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lld/MachO/Driver.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,20 +1328,22 @@ static void codegenDataGenerate() {
13281328
OutlinedHashTreeRecord globalOutlineRecord;
13291329
StableFunctionMapRecord globalMergeRecord;
13301330
for (ConcatInputSection *isec : inputSections) {
1331-
if (isec->getSegName() == segment_names::data &&
1332-
isec->getName() == section_names::outlinedHashTree) {
1331+
if (isec->getSegName() != segment_names::data)
1332+
continue;
1333+
if (isec->getName() == section_names::outlinedHashTree) {
13331334
// Read outlined hash tree from each section.
13341335
OutlinedHashTreeRecord localOutlineRecord;
1336+
// Use a pointer to allow modification by the function.
13351337
auto *data = isec->data.data();
13361338
localOutlineRecord.deserialize(data);
13371339

13381340
// Merge it to the global hash tree.
13391341
globalOutlineRecord.merge(localOutlineRecord);
13401342
}
1341-
if (isec->getSegName() == segment_names::data &&
1342-
isec->getName() == section_names::functionmap) {
1343+
if (isec->getName() == section_names::functionMap) {
13431344
// Read stable functions from each section.
13441345
StableFunctionMapRecord localMergeRecord;
1346+
// Use a pointer to allow modification by the function.
13451347
auto *data = isec->data.data();
13461348
localMergeRecord.deserialize(data);
13471349

lld/MachO/InputSection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ constexpr const char const_[] = "__const";
339339
constexpr const char lazySymbolPtr[] = "__la_symbol_ptr";
340340
constexpr const char lazyBinding[] = "__lazy_binding";
341341
constexpr const char literals[] = "__literals";
342-
constexpr const char functionmap[] = "__llvm_merge";
342+
constexpr const char functionMap[] = "__llvm_merge";
343343
constexpr const char moduleInitFunc[] = "__mod_init_func";
344344
constexpr const char moduleTermFunc[] = "__mod_term_func";
345345
constexpr const char nonLazySymbolPtr[] = "__nl_symbol_ptr";

0 commit comments

Comments
 (0)