summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-23 05:16:19 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-23 05:16:19 +0000
commit96cdc4930522efa7816ae614647364bbfc7bdd2a (patch)
treeb63b3adc969d502991f2b49166fa7cd56a65c1f3 /llvm/lib
parentb2a5eb87f83bed3342e90c1ba50194953e73242a (diff)
downloadbcm5719-llvm-96cdc4930522efa7816ae614647364bbfc7bdd2a.tar.gz
bcm5719-llvm-96cdc4930522efa7816ae614647364bbfc7bdd2a.zip
[ThinLTO] Verify lazy-loaded source module for function importing when assertions are enabled (NFC)
llvm-svn: 290416
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index c57435e284a..9489f8d699b 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -697,6 +697,14 @@ Expected<bool> FunctionImporter::importFunctions(
}
}
+#ifndef DEBUG
+ // 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;
OpenPOWER on IntegriCloud