diff options
author | Devang Patel <dpatel@apple.com> | 2010-07-23 20:36:13 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-07-23 20:36:13 +0000 |
commit | f83f42599d1242cc498b8062bb514b357aa572ce (patch) | |
tree | c9456d5b7d98f487066d791192b4bb6ecc7481b3 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 79ced813d7c1b70993804ea0044a158800d69e78 (diff) |
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 5618f09efe..f41b7693ba 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); |