Make the check for global variables the same as the one for functions. In

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()"

llvm-svn: 20155
This commit is contained in:
Reid Spencer 2005-02-13 18:12:20 +00:00
parent 8d54dd37c9
commit 8d0f126b74
1 changed files with 1 additions and 1 deletions

View 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());