summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-07-24 00:53:22 +0000
committerDevang Patel <dpatel@apple.com>2010-07-24 00:53:22 +0000
commit498877d055a82e82e1e7a0cc7dbd37e4f3240ded (patch)
tree84062f0ee4f1701c522c7dfda3b79a69a4f14295 /llvm/lib/CodeGen
parentf5275a833929e4a3a55246fa960daa76db719ef7 (diff)
downloadbcm5719-llvm-498877d055a82e82e1e7a0cc7dbd37e4f3240ded.tar.gz
bcm5719-llvm-498877d055a82e82e1e7a0cc7dbd37e4f3240ded.zip
Use current working directory when Dirname is empty. This only happens when absolute source file path is used on compiler command line.
llvm-svn: 109302
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..b81aad92cbb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud