Make the check for global variables the same as the one for functions. In
authorReid Spencer <rspencer@reidspencer.com>
Sun, 13 Feb 2005 18:12:20 +0000 (18:12 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 13 Feb 2005 18:12:20 +0000 (18:12 +0000)
both cases they are looking for non-external variables/functions that do
not have internal linkage. Using "!isExternal()" is a little more
understandable than "hasInitializer()"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20155 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/ReaderWrappers.cpp

index ce54b7a4e256e491642eab11517bf392a1a0f5f8..449bf863816cdf19aa3126d58338751ed1794884 100644 (file)
@@ -331,7 +331,7 @@ bool llvm::GetBytecodeDependentLibraries(const std::string &fname,
 static void getSymbols(Module*M, std::vector<std::string>& symbols) {
   // Loop over global variables
   for (Module::giterator GI = M->gbegin(), GE=M->gend(); GI != GE; ++GI)
-    if (GI->hasInitializer() && !GI->hasInternalLinkage())
+    if (!GI->isExternal() && !GI->hasInternalLinkage())
       if (!GI->getName().empty())
         symbols.push_back(GI->getName());