From: Duncan P. N. Exon Smith Date: Tue, 11 Nov 2014 23:13:10 +0000 (+0000) Subject: libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ab75fd0694e7e5bc3d23926fbe7e73198aee03b1;p=oota-llvm.git libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221730 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index 31ab3401c9d..c663d43fe7f 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/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 &undefs = mod->getAsmUndefinedRefs();