Always use current working directory for DW_AT_comp_dir.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109535 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 0309c6e..8e9f416 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -184,15 +184,6 @@
return CWDName = llvm::StringRef(CompDirnamePtr, CWD.size());
}
-/// getCompDirname - AT_comp_dir is empty if filename is absulte otherwise
-/// it points to compilation directory.
-llvm::StringRef CGDebugInfo::getCompDirname(llvm::StringRef Filename) {
- llvm::sys::Path FilePath(Filename);
- if (FilePath.isAbsolute())
- return llvm::StringRef();
- return getCurrentDirname();
-}
-
/// CreateCompileUnit - Create new compile unit.
void CGDebugInfo::CreateCompileUnit() {
@@ -246,7 +237,7 @@
// Create new compile unit.
TheCU = DebugFactory.CreateCompileUnit(
- LangTag, Filename, getCompDirname(Filename),
+ LangTag, Filename, getCurrentDirname(),
Producer, true,
LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers);
}
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index fc296ac..b20506d 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -199,10 +199,6 @@
llvm::DIDescriptor getContextDescriptor(const Decl *Decl,
llvm::DIDescriptor &CU);
- /// getCompDirname - AT_comp_dir is empty if filename is absulte otherwise
- /// it points to compilation directory.
- llvm::StringRef getCompDirname(llvm::StringRef Filename);
-
/// getCurrentDirname - Return current directory name.
llvm::StringRef getCurrentDirname();