[llvm] r221730 - libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Nov 11 15:13:11 PST 2014


Author: dexonsmith
Date: Tue Nov 11 17:13:10 2014
New Revision: 221730

URL: http://llvm.org/viewvc/llvm-project?rev=221730&view=rev
Log:
libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts

Modified:
    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp

Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=221730&r1=221729&r2=221730&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Tue Nov 11 17:13:10 2014
@@ -128,6 +128,9 @@ void LTOCodeGenerator::initializeLTOPass
 }
 
 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();





More information about the llvm-commits mailing list