Skip to content

Commit

Permalink
[ELF] Simplify --fortran-common. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Feb 24, 2022
1 parent 4129890 commit 15617cd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lld/ELF/Symbols.cpp
Expand Up @@ -653,15 +653,12 @@ void Symbol::resolveDefined(const Defined &other) {
void Symbol::resolveLazy(const LazyObject &other) {
// For common objects, we want to look for global or weak definitions that
// should be extracted as the canonical definition instead.
if (isCommon() && elf::config->fortranCommon) {
if (auto *loSym = dyn_cast<LazyObject>(&other)) {
if (loSym->file->shouldExtractForCommon(getName())) {
backwardReferences.erase(this);
replace(other);
other.extract();
return;
}
}
if (LLVM_UNLIKELY(isCommon()) && elf::config->fortranCommon &&
other.file->shouldExtractForCommon(getName())) {
backwardReferences.erase(this);
replace(other);
other.extract();
return;
}

if (!isUndefined()) {
Expand Down

0 comments on commit 15617cd

Please sign in to comment.