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
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-11 23:13:10 +00:00
parent 4f0d671b97
commit ab75fd0694

View File

@ -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();