Skip to content

Commit

Permalink
[lld-macho][nfc] Reduce nesting of code added in D130125
Browse files Browse the repository at this point in the history
  • Loading branch information
int3 committed Jul 23, 2022
1 parent 3096b85 commit ee61dc5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lld/MachO/SyntheticSections.cpp
Expand Up @@ -1680,17 +1680,17 @@ void ObjCImageInfoSection::finalizeContents() {
ImageInfo inputInfo = parseImageInfo(file);
info.hasCategoryClassProperties &= inputInfo.hasCategoryClassProperties;

if (inputInfo.swiftVersion != 0) {
if (info.swiftVersion != 0 &&
info.swiftVersion != inputInfo.swiftVersion) {
error("Swift version mismatch: " + toString(firstFile) +
" has version " + swiftVersionString(info.swiftVersion) +
" but " + toString(file) + " has version " +
swiftVersionString(inputInfo.swiftVersion));
} else {
info.swiftVersion = inputInfo.swiftVersion;
firstFile = file;
}
// swiftVersion 0 means no Swift is present, so no version checking required
if (inputInfo.swiftVersion == 0)
continue;

if (info.swiftVersion != 0 && info.swiftVersion != inputInfo.swiftVersion) {
error("Swift version mismatch: " + toString(firstFile) + " has version " +
swiftVersionString(info.swiftVersion) + " but " + toString(file) +
" has version " + swiftVersionString(inputInfo.swiftVersion));
} else {
info.swiftVersion = inputInfo.swiftVersion;
firstFile = file;
}
}
}
Expand Down

0 comments on commit ee61dc5

Please sign in to comment.