diff options
author | Devang Patel <dpatel@apple.com> | 2010-07-24 00:53:22 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-07-24 00:53:22 +0000 |
commit | 2f58485fc87143bb97e3d88dde9ab2d28211cd28 (patch) | |
tree | 4d0e1e3c14fa69fb13a6988a35390376e98f225c /lib/CodeGen | |
parent | 70017e44cdba1946cc478ce1856a3e855a767e28 (diff) |
Use current working directory when Dirname is empty. This only happens when absolute source file path is used on compiler command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-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..b81aad92cb 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1753,6 +1753,11 @@ DIE *DwarfDebug::constructScopeDIE(DbgScope *Scope) { /// maps as well. unsigned DwarfDebug::GetOrCreateSourceID(StringRef DirName, StringRef FileName){ unsigned DId; + if (DirName.empty()) { + llvm::sys::Path CWD = llvm::sys::Path::GetCurrentDirectory(); + DirName = StringRef(CWD.c_str(), CWD.size()); + } + StringMap<unsigned>::iterator DI = DirectoryIdMap.find(DirName); if (DI != DirectoryIdMap.end()) { DId = DI->getValue(); |