From: Devang Patel Date: Fri, 23 Jul 2010 20:36:13 +0000 (+0000) Subject: IF directory name is empty then try to extract one using absolute file name. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=f83f42599d1242cc498b8062bb514b357aa572ce IF directory name is empty then try to extract one using absolute file name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109262 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 5618f09efe2..f41b7693bad 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1805,6 +1805,11 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) { DICompileUnit DIUnit(N); StringRef FN = DIUnit.getFilename(); StringRef Dir = DIUnit.getDirectory(); + if (Dir.empty()) { + sys::Path AbsFileDirName(FN); + AbsFileDirName.makeAbsolute(); + Dir = AbsFileDirName.getDirname(); + } unsigned ID = GetOrCreateSourceID(Dir, FN); DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);