summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-03-04 20:15:35 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-03-04 20:15:35 +0000
commitd72ade3b3b15c69e185490800cdc468ae6de66e7 (patch)
treeb61b605838941f7c76ae5a23b67584d9d3b93678 /llvm/lib
parente26c37d37d9382ea0e5463d9b0862b91afd53c18 (diff)
downloadbcm5719-llvm-d72ade3b3b15c69e185490800cdc468ae6de66e7.tar.gz
bcm5719-llvm-d72ade3b3b15c69e185490800cdc468ae6de66e7.zip
Add alias with non-external aliasee to the list of exported symbols of the library.
llvm-svn: 47899
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Archive/Archive.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Archive/Archive.cpp b/llvm/lib/Archive/Archive.cpp
index 22934d51fe3..7df5e48f9fa 100644
--- a/llvm/lib/Archive/Archive.cpp
+++ b/llvm/lib/Archive/Archive.cpp
@@ -198,11 +198,20 @@ static void getSymbols(Module*M, std::vector<std::string>& symbols) {
if (!GI->getName().empty())
symbols.push_back(GI->getName());
- // Loop over functions.
+ // Loop over functions
for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
if (!FI->isDeclaration() && !FI->hasInternalLinkage())
if (!FI->getName().empty())
symbols.push_back(FI->getName());
+
+ // Loop over aliases
+ for (Module::alias_iterator AI = M->alias_begin(), AE = M->alias_end();
+ AI != AE; ++AI) {
+ const GlobalValue *Aliased = AI->getAliasedGlobal();
+ if (!Aliased->isDeclaration())
+ if (AI->hasName())
+ symbols.push_back(AI->getName());
+ }
}
// Get just the externally visible defined symbols from the bitcode
OpenPOWER on IntegriCloud