The test program attached with this patch crashes as
``````````````````````````````````````````````````````````````````````
command line: llc llvm/test/DebugInfo/X86/dwarfdump-ContextDICompileUnit.ll
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: bin/llc ../llvm/test/DebugInfo/X86/dwarfdump-ContextDICompileUnit.ll
- Running pass 'Function Pass Manager' on module '../llvm/test/DebugInfo/X86/dwarfdump-ContextDICompileUnit.ll'.
- Running pass 'X86 Assembly Printer' on function '@mdl1_sub1_'
#0 0x00007f055f76be80 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm/lib/Support/Unix/Signals.inc:565:0
#1 0x00007f055f76bf37 PrintStackTraceSignalHandler(void*) llvm/lib/Support/Unix/Signals.inc:632:0
#2 0x00007f055f769beb llvm::sys::RunSignalHandlers() llvm/lib/Support/Signals.cpp:97:0
#3 0x00007f055f76b801 SignalHandler(int) llvm/lib/Support/Unix/Signals.inc:407:0
#4 0x00007f055d971040 (/lib/x86_64-linux-gnu/libc.so.6+0x3f040)
#5 0x00007f056436d62d llvm::IntrusiveBackListBase::push_back(llvm::IntrusiveBackListNode&) llvm/include/llvm/CodeGen/DIE.h:536:0
#6 0x00007f056436ffbb llvm::IntrusiveBackList<llvm::DIE>::push_back(llvm::DIE&) llvm/include/llvm/CodeGen/DIE.h:560:0
#7 0x00007f056436d8ef llvm::DIE::addChild(llvm::DIE*) llvm/include/llvm/CodeGen/DIE.h:850:0
#8 0x00007f05643f1850 llvm::DwarfUnit::createAndAddDIE(llvm::dwarf::Tag, llvm::DIE&, llvm::DINode const*) llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:390:0
#9 0x00007f05643f4dc2 llvm::DwarfUnit::getOrCreateModule(llvm::DIModule const*) llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1096:0
#10 0x00007f05643f2450 llvm::DwarfUnit::getOrCreateContextDIE(llvm::DIScope const*) llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:549:0
#11 0x00007f05643f50a1 llvm::DwarfUnit::getOrCreateSubprogramDIE(llvm::DISubprogram const*, bool) llvm/lib/CodeGen/AsmPrinterDwarfUnit.cpp:1125:0
#12 0x00007f056436a880 llvm::DwarfCompileUnit::constructCallSiteEntryDIE(llvm::DIE&, llvm::DISubprogram const*, bool, llvm::MCSymbol const*, llvm::MCSymbol const*, unsigned int) llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1182:0
#13 0x00007f0564388282 llvm::DwarfDebug::constructCallSiteEntryDIEs(llvm::DISubprogram const&, llvm::DwarfCompileUnit&, llvm::DIE&, llvm::MachineFunction const&) llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:987:0
#14 0x00007f056438e580 llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2257:0
#15 0x00007f0564350aa0 llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) llvm/lib/CodeGen/AsmPrinterDebugHandlerBase.cpp:410:0
#16 0x00007f05642f4b3f llvm::AsmPrinter::emitFunctionBody() llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1505:0
#17 0x00007f05663d2653 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) llvm/lib/Target/X86/X86AsmPrinter.cpp:85:0
#18 0x00007f056329e007 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) llvm/lib/CodeGen/MachineFunctionPass.cpp:72:0
#19 0x00007f05621b6082 llvm::FPPassManager::runOnFunction(llvm::Function&) llvm/lib/IR/LegacyPassManager.cpp:1439:0
#20 0x00007f05621b632b llvm::FPPassManager::runOnModule(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:1485:0
#21 0x00007f05621b6753 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:1554:0
#22 0x00007f05621b1813 llvm::legacy::PassManagerImpl::run(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:542:0
#23 0x00007f05621b6fdd llvm::legacy::PassManager::run(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:1682:0
#24 0x0000558e5b81985d compileModule(char**, llvm::LLVMContext&) llvm/tools/llc/llc.cpp:690:0
#25 0x0000558e5b81752a main llvm/tools/llc/llc.cpp:388:0
#26 0x00007f055d953bf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#27 0x0000558e5b81647a _start (bin/llc+0x2947a)
``````````````````````````````````````````````````````````````````````
This is due to a missing case in DwarfUnit::getOrCreateContextDIE for DICompileUnit, which is now added to fix the issue.