Use mayBeOverridden here, in anticipation of the
[oota-llvm.git] / lib / VMCore / Globals.cpp
index e55cb5a5ac5bf03c8676015699b008468c45e1a1..de1b247150ea3e6db8002e071cf6f5b1cb81df36 100644 (file)
@@ -248,11 +248,11 @@ const GlobalValue *GlobalAlias::getAliasedGlobal() const {
   return 0;
 }
 
-const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool traverseWeak) const {
+const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool stopOnWeak) const {
   SmallPtrSet<const GlobalValue*, 3> Visited;
 
   // Check if we need to stop early.
-  if (!traverseWeak && hasWeakLinkage())
+  if (stopOnWeak && mayBeOverridden())
     return this;
 
   const GlobalValue *GV = getAliasedGlobal();
@@ -260,7 +260,7 @@ const GlobalValue *GlobalAlias::resolveAliasedGlobal(bool traverseWeak) const {
 
   // Iterate over aliasing chain, stopping on weak alias if necessary.
   while (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV)) {
-    if (traverseWeak && GA->hasWeakLinkage())
+    if (stopOnWeak && GA->mayBeOverridden())
       break;
 
     GV = GA->getAliasedGlobal();