Debug Info: Allow a DIModule to appear as the scope of other entities.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfUnit.cpp
index d3e0b8b798caffc3750e05cac16acf56b8bd4db3..3a89c809da337622aa9ca856d514f75fd0e7873b 100644 (file)
@@ -693,6 +693,8 @@ DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {
     return getOrCreateNameSpace(NS);
   if (auto *SP = dyn_cast<DISubprogram>(Context))
     return getOrCreateSubprogramDIE(SP);
+  if (auto *M = dyn_cast<DIModule>(Context))
+    return getOrCreateModule(M);
   return getDIE(Context);
 }