r187654 - Convert last use of st_dev in clang.
Rafael Espindola
rafael.espindola at gmail.com
Fri Aug 2 08:31:35 PDT 2013
Author: rafael
Date: Fri Aug 2 10:31:35 2013
New Revision: 187654
URL: http://llvm.org/viewvc/llvm-project?rev=187654&view=rev
Log:
Convert last use of st_dev in clang.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=187654&r1=187653&r2=187654&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Aug 2 10:31:35 2013
@@ -1901,17 +1901,15 @@ static bool shouldUseLeafFramePointer(co
/// If the PWD environment variable is set, add a CC1 option to specify the
/// debug compilation directory.
static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) {
- struct stat StatPWDBuf, StatDotBuf;
-
const char *pwd = ::getenv("PWD");
if (!pwd)
return;
+ llvm::sys::fs::file_status PWDStatus, DotStatus;
if (llvm::sys::path::is_absolute(pwd) &&
- stat(pwd, &StatPWDBuf) == 0 &&
- stat(".", &StatDotBuf) == 0 &&
- StatPWDBuf.st_ino == StatDotBuf.st_ino &&
- StatPWDBuf.st_dev == StatDotBuf.st_dev) {
+ !llvm::sys::fs::status(pwd, PWDStatus) &&
+ !llvm::sys::fs::status(".", DotStatus) &&
+ PWDStatus.getUniqueID() == DotStatus.getUniqueID()) {
CmdArgs.push_back("-fdebug-compilation-dir");
CmdArgs.push_back(Args.MakeArgString(pwd));
return;
More information about the cfe-commits
mailing list