diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-12 18:03:13 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-02-12 18:03:13 +0000 |
commit | 2e3066b319866fbc8798bd0e56b535ba1f82620d (patch) | |
tree | 0e652ad106854dd32a9c69cad638bb01f9c30796 /tools | |
parent | d800cf0a509b79ba80b6f4d9b170ccd83661560e (diff) | |
download | external_llvm-2e3066b319866fbc8798bd0e56b535ba1f82620d.zip external_llvm-2e3066b319866fbc8798bd0e56b535ba1f82620d.tar.gz external_llvm-2e3066b319866fbc8798bd0e56b535ba1f82620d.tar.bz2 |
Preserve aliases if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index b2554f8..adb7102 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -367,6 +367,14 @@ void LTOCodeGenerator::applyScopeRestrictions() { _mustPreserveSymbols.count(Buffer)) mustPreserveList.push_back(::strdup(v->getNameStr().c_str())); } + for (Module::alias_iterator a = mergedModule->alias_begin(), + e = mergedModule->alias_end(); a != e; ++a) { + Buffer.clear(); + mangler.getNameWithPrefix(Buffer, a, false); + if (!a->isDeclaration() && + _mustPreserveSymbols.count(Buffer)) + mustPreserveList.push_back(::strdup(a->getNameStr().c_str())); + } passes.add(createInternalizePass(mustPreserveList)); } |