summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-02-03 07:41:43 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-02-03 07:41:43 +0000
commit1380edf4ef9469e2dda07020436a1b229c1ad804 (patch)
treeeb556ccc87157b8445f7f9c59051e9f1a9f755d7 /llvm/lib/LTO/LTO.cpp
parente5f2bfaea9d96c93ff0ca8b5c986092a9a488c47 (diff)
downloadbcm5719-llvm-1380edf4ef9469e2dda07020436a1b229c1ad804.tar.gz
bcm5719-llvm-1380edf4ef9469e2dda07020436a1b229c1ad804.zip
Revert "[ThinLTO] Add an auto-hide feature"
This reverts commit r293970. After more discussion, this belongs to the linker side and there is no added value to do it at this level. llvm-svn: 293993
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index db0253161b8..bf30fec5d20 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -203,14 +203,11 @@ void llvm::thinLTOResolveWeakForLinkerInIndex(
static void thinLTOInternalizeAndPromoteGUID(
GlobalValueSummaryList &GVSummaryList, GlobalValue::GUID GUID,
- function_ref<SummaryResolution(StringRef, GlobalValue::GUID)> isExported) {
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported) {
for (auto &S : GVSummaryList) {
- auto ExportResolution = isExported(S->modulePath(), GUID);
- if (ExportResolution != Internal) {
+ if (isExported(S->modulePath(), GUID)) {
if (GlobalValue::isLocalLinkage(S->linkage()))
S->setLinkage(GlobalValue::ExternalLinkage);
- if (ExportResolution == Hidden)
- S->setAutoHide();
} else if (!GlobalValue::isLocalLinkage(S->linkage()))
S->setLinkage(GlobalValue::InternalLinkage);
}
@@ -220,7 +217,7 @@ static void thinLTOInternalizeAndPromoteGUID(
// as external and non-exported values as internal.
void llvm::thinLTOInternalizeAndPromoteInIndex(
ModuleSummaryIndex &Index,
- function_ref<SummaryResolution(StringRef, GlobalValue::GUID)> isExported) {
+ function_ref<bool(StringRef, GlobalValue::GUID)> isExported) {
for (auto &I : Index)
thinLTOInternalizeAndPromoteGUID(I.second, I.first, isExported);
}
@@ -954,20 +951,11 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
const GlobalValueSummary *S) {
return ThinLTO.PrevailingModuleForGUID[GUID] == S->modulePath();
};
- auto isExported = [&](StringRef ModuleIdentifier,
- GlobalValue::GUID GUID) -> SummaryResolution {
+ auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
const auto &ExportList = ExportLists.find(ModuleIdentifier);
- if ((ExportList != ExportLists.end() && ExportList->second.count(GUID)) ||
- ExportedGUIDs.count(GUID)) {
- // We could do better by hiding when a symbol is in
- // GUIDPreservedSymbols because it is only referenced from regular LTO
- // or from native files and not outside the final binary, but that's
- // something the native linker could do as gwell.
- if (GUIDPreservedSymbols.count(GUID))
- return Exported;
- return Hidden;
- }
- return Internal;
+ return (ExportList != ExportLists.end() &&
+ ExportList->second.count(GUID)) ||
+ ExportedGUIDs.count(GUID);
};
thinLTOInternalizeAndPromoteInIndex(ThinLTO.CombinedIndex, isExported);
OpenPOWER on IntegriCloud