summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-10-14 18:45:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-10-14 18:45:11 +0000
commitbcbca75e94c8eb7073482fa0c5c8940f39f66849 (patch)
tree3b14ccd0212ff274d566e9b83460a7f5f4134f93
parentc95ff94a2d67093a696a0c70dbb272bcf8b97146 (diff)
Upgrade to PathV2.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141969 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index f3d2687f90..5ae4dfe83c 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -33,7 +33,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/Path.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
using namespace clang;
@@ -254,10 +254,10 @@ unsigned CGDebugInfo::getColumnNumber(SourceLocation Loc) {
StringRef CGDebugInfo::getCurrentDirname() {
if (!CWDName.empty())
return CWDName;
- char *CompDirnamePtr = NULL;
- llvm::sys::Path CWD = llvm::sys::Path::GetCurrentDirectory();
- CompDirnamePtr = DebugInfoNames.Allocate<char>(CWD.size());
- memcpy(CompDirnamePtr, CWD.c_str(), CWD.size());
+ llvm::SmallString<256> CWD;
+ llvm::sys::fs::current_path(CWD);
+ char *CompDirnamePtr = DebugInfoNames.Allocate<char>(CWD.size());
+ memcpy(CompDirnamePtr, CWD.data(), CWD.size());
return CWDName = StringRef(CompDirnamePtr, CWD.size());
}