summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-11 23:13:10 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-11 23:13:10 +0000
commit941986390961a1fc36448d17e2b829a5e602f6ee (patch)
tree11d5fc47b916a696971c2441bd27ebdb2dce358a /llvm/lib/LTO
parent89441b0dd895fa31a16d8e5d95ca9e741faf36b6 (diff)
downloadbcm5719-llvm-941986390961a1fc36448d17e2b829a5e602f6ee.tar.gz
bcm5719-llvm-941986390961a1fc36448d17e2b829a5e602f6ee.zip
libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts
llvm-svn: 221730
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 31ab3401c9d..c663d43fe7f 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -128,6 +128,9 @@ void LTOCodeGenerator::initializeLTOPasses() {
}
bool LTOCodeGenerator::addModule(LTOModule *mod) {
+ assert(&mod->getModule().getContext() == &Context &&
+ "Expected module in same context");
+
bool ret = IRLinker.linkInModule(&mod->getModule());
const std::vector<const char*> &undefs = mod->getAsmUndefinedRefs();
OpenPOWER on IntegriCloud