[cfe-commits] r154015 - /cfe/trunk/lib/Tooling/Tooling.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Wed Apr 4 06:59:36 PDT 2012
Author: chapuni
Date: Wed Apr 4 08:59:36 2012
New Revision: 154015
URL: http://llvm.org/viewvc/llvm-project?rev=154015&view=rev
Log:
Tooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.
$ENV{PWD} is not expected to be set on all hosts.
Modified:
cfe/trunk/lib/Tooling/Tooling.cpp
Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=154015&r1=154014&r2=154015&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Wed Apr 4 08:59:36 2012
@@ -24,6 +24,7 @@
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
+#include "llvm/Support/FileSystem.h"
namespace clang {
namespace tooling {
@@ -235,7 +236,8 @@
ClangTool::ClangTool(const CompilationDatabase &Compilations,
ArrayRef<std::string> SourcePaths)
: Files((FileSystemOptions())) {
- StringRef BaseDirectory(::getenv("PWD"));
+ llvm::SmallString<1024> BaseDirectory;
+ llvm::sys::fs::current_path(BaseDirectory);
for (unsigned I = 0, E = SourcePaths.size(); I != E; ++I) {
llvm::SmallString<1024> File(getAbsolutePath(
SourcePaths[I], BaseDirectory));
More information about the cfe-commits
mailing list