diff --git a/llvm/lib/VMCore/Globals.cpp b/llvm/lib/VMCore/Globals.cpp index c917dfc3be71..de1b247150ea 100644 --- a/llvm/lib/VMCore/Globals.cpp +++ b/llvm/lib/VMCore/Globals.cpp @@ -252,7 +252,7 @@ const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) const { SmallPtrSet Visited; // Check if we need to stop early. - if (stopOnWeak && hasWeakLinkage()) + if (stopOnWeak && mayBeOverridden()) return this; const GlobalValue *GV = getAliasedGlobal(); @@ -260,7 +260,7 @@ const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) const { // Iterate over aliasing chain, stopping on weak alias if necessary. while (const GlobalAlias *GA = dyn_cast(GV)) { - if (stopOnWeak && GA->hasWeakLinkage()) + if (stopOnWeak && GA->mayBeOverridden()) break; GV = GA->getAliasedGlobal();