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://review.tizen.org/git/?a=commitdiff_plain;h=941986390961a1fc36448d17e2b829a5e602f6ee;p=platform%2Fupstream%2Fllvm.git libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts llvm-svn: 221730 --- diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 31ab340..c663d43 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 &undefs = mod->getAsmUndefinedRefs();