summaryrefslogtreecommitdiff
path: root/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
commitd58ceb27c55a8c84d919d6abbf7ea11bc60612e2 (patch)
treec46d2c90524e22cc45ab97afaac87d61a6dae4f2 /lib
parent96f9cc02e31f9d8722eec33f13ddb0f75eb67ccc (diff)
Add alias with non-external aliasee to the list of exported symbols of the library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Archive/Archive.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 22934d51fe3..7df5e48f9fa 100644
--- a/lib/Archive/Archive.cpp
+++ b/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