diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index e4ec6e7e40e2..1e3da83900c9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -689,8 +689,10 @@ unsigned DwarfDebug::getOrCreateSourceID(StringRef FileName, StringRef DirName, CUID = 0; // If FE did not provide a file name, then assume stdin. - if (FileName.empty()) - return getOrCreateSourceID("", StringRef(), CUID); + if (FileName.empty()) { + FileName = ""; + DirName = ""; + } // TODO: this might not belong here. See if we can factor this better. if (DirName == CompilationDir)