[llvm] r290416 - [ThinLTO] Verify lazy-loaded source module for function importing when assertions are enabled (NFC)
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 23 04:50:14 PST 2016
On Dec 23, 2016 5:26 AM, "Mehdi Amini via llvm-commits" <
llvm-commits at lists.llvm.org> wrote:
Author: mehdi_amini
Date: Thu Dec 22 23:16:19 2016
New Revision: 290416
URL: http://llvm.org/viewvc/llvm-project?rev=290416&view=rev
Log:
[ThinLTO] Verify lazy-loaded source module for function importing when
assertions are enabled (NFC)
Modified:
llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
Modified: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
Transforms/IPO/FunctionImport.cpp?rev=290416&r1=290415&r2=290416&view=diff
============================================================
==================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp Thu Dec 22 23:16:19
2016
@@ -697,6 +697,14 @@ Expected<bool> FunctionImporter::importF
}
}
+#ifndef DEBUG
NDEBUG?
+ // Note: this can't be done after `renameModuleForThinLTO` as it
leaves the
+ // module in a state that does not pass the verifier (for example
aliases
+ // pointing to available_externally functions).
+ if (verifyModule(*SrcModule, &errs()))
+ report_fatal_error("Invalid lazy-loaded source module for
importing");
+#endif
+
// Link in the specified functions.
if (renameModuleForThinLTO(*SrcModule, Index, &GlobalsToImport))
return true;
_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161223/0a88dc33/attachment.html>
More information about the llvm-commits
mailing list