summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-08 04:44:18 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-08 04:44:18 +0000
commit00fa1409ec8d8d6db8597fbe73eac65094e8b425 (patch)
tree9c3675ad2540add82493fb1e04f5e209630d2a34 /llvm/lib/LTO/LTO.cpp
parent01e0e136bd6039a3a45acf83dd6d561f307e4963 (diff)
downloadbcm5719-llvm-00fa1409ec8d8d6db8597fbe73eac65094e8b425.tar.gz
bcm5719-llvm-00fa1409ec8d8d6db8597fbe73eac65094e8b425.zip
ThinLTO: handles modules with empty summaries
We need to add an entry in the combined-index for modules that have a hash but otherwise empty summary, this is needed so that we can get the hash for the module. Also, if no entry is present in the combined index for a module, we need to skip it when trying to compute a cache entry. Differential Revision: https://reviews.llvm.org/D25300 llvm-svn: 283654
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index b2d42f4d2a6..94a4abfb896 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -541,13 +541,15 @@ public:
ImportList, DefinedGlobals, ModuleMap);
};
- if (!Cache)
+ auto ModuleID = MBRef.getBufferIdentifier();
+ if (!Cache || !CombinedIndex.modulePaths().count(ModuleID))
+ // Cache disabled or no entry for this module in the combined index
return RunThinBackend(AddStream);
SmallString<40> Key;
// The module may be cached, this helps handling it.
- computeCacheKey(Key, CombinedIndex, MBRef.getBufferIdentifier(),
- ImportList, ExportList, ResolvedODR, DefinedGlobals);
+ computeCacheKey(Key, CombinedIndex, ModuleID, ImportList, ExportList,
+ ResolvedODR, DefinedGlobals);
if (AddStreamFn CacheAddStream = Cache(Task, Key))
return RunThinBackend(CacheAddStream);
OpenPOWER on IntegriCloud