diff options
author | evgeny <eleviant@accesssoftek.com> | 2019-11-14 12:24:05 +0300 |
---|---|---|
committer | evgeny <eleviant@accesssoftek.com> | 2019-11-14 12:24:05 +0300 |
commit | a2292cc537b561416c21e8d4017715d652c144cc (patch) | |
tree | 25a1ee4080caa66aaeec153b3d15289ee545317e /llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | |
parent | eafe0cf5fa8255257bac3923237e62382610e6d6 (diff) | |
download | llvm-a2292cc537b561416c21e8d4017715d652c144cc.zip llvm-a2292cc537b561416c21e8d4017715d652c144cc.tar.gz llvm-a2292cc537b561416c21e8d4017715d652c144cc.tar.bz2 |
[ThinLTO] Add correctness check for RO/WO variable import
This patch adds an assertion check for exported read/write-only
variables to be also in import list for module. If they aren't
we may face linker errors, because read/write-only variables are
internalized in their source modules. The patch also changes
export lists to store ValueInfo instead of GUID for performance
considerations.
Differential revision: https://reviews.llvm.org/D70128
Diffstat (limited to 'llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp index c667927..a000037 100644 --- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -710,7 +710,7 @@ void runWholeProgramDevirtOnIndex( void updateIndexWPDForExports( ModuleSummaryIndex &Summary, - function_ref<bool(StringRef, GlobalValue::GUID)> isExported, + function_ref<bool(StringRef, ValueInfo)> isExported, std::map<ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap) { for (auto &T : LocalWPDTargetsMap) { auto &VI = T.first; @@ -718,7 +718,7 @@ void updateIndexWPDForExports( assert(VI.getSummaryList().size() == 1 && "Devirt of local target has more than one copy"); auto &S = VI.getSummaryList()[0]; - if (!isExported(S->modulePath(), VI.getGUID())) + if (!isExported(S->modulePath(), VI)) continue; // It's been exported by a cross module import. |