summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-07-23 20:36:13 +0000
committerDevang Patel <dpatel@apple.com>2010-07-23 20:36:13 +0000
commit3032354bbef002ccf0c871b70e44d4795c5ac07c (patch)
tree7afba6e0b3a32a7b214b47f1150d7148ac13bbd5 /llvm/lib/CodeGen
parentb59625ecea47bf77f10c7a55f3cf6663e396fdc7 (diff)
downloadbcm5719-llvm-3032354bbef002ccf0c871b70e44d4795c5ac07c.tar.gz
bcm5719-llvm-3032354bbef002ccf0c871b70e44d4795c5ac07c.zip
IF directory name is empty then try to extract one using absolute file name.
llvm-svn: 109262
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 5618f09efe2..f41b7693bad 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud