fix a tricky bug in the JIT global variable emitter, that was triggered when JITing...
[oota-llvm.git] / lib / VMCore / Globals.cpp
index e55cb5a5ac5bf03c8676015699b008468c45e1a1..c917dfc3be7193709b4d6352109114a221fc7e36 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 && hasWeakLinkage())
     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->hasWeakLinkage())
       break;
 
     GV = GA->getAliasedGlobal();