libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts

llvm-svn: 221730
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-11 23:13:10 +00:00
parent a372ecb2f1
commit 0da7d23ee5

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