diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-11 23:13:10 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-11 23:13:10 +0000 |
| commit | 941986390961a1fc36448d17e2b829a5e602f6ee (patch) | |
| tree | 11d5fc47b916a696971c2441bd27ebdb2dce358a /llvm/lib/LTO | |
| parent | 89441b0dd895fa31a16d8e5d95ca9e741faf36b6 (diff) | |
| download | bcm5719-llvm-941986390961a1fc36448d17e2b829a5e602f6ee.tar.gz bcm5719-llvm-941986390961a1fc36448d17e2b829a5e602f6ee.zip | |
libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts
llvm-svn: 221730
Diffstat (limited to 'llvm/lib/LTO')
| -rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 31ab3401c9d..c663d43fe7f 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<const char*> &undefs = mod->getAsmUndefinedRefs(); |

