From: Benjamin Kramer Date: Fri, 14 Oct 2011 18:45:11 +0000 (+0000) Subject: Upgrade to PathV2. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcbca75e94c8eb7073482fa0c5c8940f39f66849;p=clang Upgrade to PathV2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141969 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(CWD.size()); - memcpy(CompDirnamePtr, CWD.c_str(), CWD.size()); + llvm::SmallString<256> CWD; + llvm::sys::fs::current_path(CWD); + char *CompDirnamePtr = DebugInfoNames.Allocate(CWD.size()); + memcpy(CompDirnamePtr, CWD.data(), CWD.size()); return CWDName = StringRef(CompDirnamePtr, CWD.size()); }