[ELF] resolve LazySymbol: remove a branch in the fast path
This commit is contained in:
@@ -619,20 +619,18 @@ void Symbol::resolve(Ctx &ctx, const LazySymbol &other) {
|
||||
return;
|
||||
}
|
||||
|
||||
// For common objects, we want to look for global or weak definitions that
|
||||
// should be extracted as the canonical definition instead.
|
||||
if (LLVM_UNLIKELY(isCommon()) && ctx.arg.fortranCommon &&
|
||||
other.file->shouldExtractForCommon(getName())) {
|
||||
ctx.backwardReferences.erase(this);
|
||||
other.overwrite(*this);
|
||||
other.extract(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isUndefined()) {
|
||||
// See the comment in resolveUndefined().
|
||||
if (isDefined())
|
||||
if (LLVM_UNLIKELY(!isUndefined())) {
|
||||
// See the comment in resolve(Ctx &, const Undefined &).
|
||||
if (isDefined()) {
|
||||
ctx.backwardReferences.erase(this);
|
||||
} else if (isCommon() && ctx.arg.fortranCommon &&
|
||||
other.file->shouldExtractForCommon(getName())) {
|
||||
// For common objects, we want to look for global or weak definitions that
|
||||
// should be extracted as the canonical definition instead.
|
||||
ctx.backwardReferences.erase(this);
|
||||
other.overwrite(*this);
|
||||
other.extract(ctx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user