[cfe-commits] r85163 - /cfe/trunk/tools/CIndex/CIndex.cpp
Ted Kremenek
kremenek at apple.com
Mon Oct 26 15:14:08 PDT 2009
Author: kremenek
Date: Mon Oct 26 17:14:08 2009
New Revision: 85163
URL: http://llvm.org/viewvc/llvm-project?rev=85163&view=rev
Log:
Unify Unix and Windows code paths when executing 'clang'.
Modified:
cfe/trunk/tools/CIndex/CIndex.cpp
Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=85163&r1=85162&r2=85163&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Mon Oct 26 17:14:08 2009
@@ -434,8 +434,9 @@
// Add the null terminator.
argv.push_back(NULL);
-#ifndef LLVM_ON_WIN32
- llvm::sys::Path DevNull("/dev/null");
+ // Invoke 'clang'.
+ llvm::sys::Path DevNull; // leave empty, causes redirection to /dev/null
+ // on Unix or NUL (Windows).
std::string ErrMsg;
const llvm::sys::Path *Redirects[] = { &DevNull, &DevNull, &DevNull, NULL };
llvm::sys::Program::ExecuteAndWait(ClangPath, &argv[0], /* env */ NULL,
@@ -452,11 +453,6 @@
}
llvm::errs() << '\n';
}
-#else
- // FIXME: I don't know what is the equivalent '/dev/null' redirect for
- // Windows for this API.
- llvm::sys::Program::ExecuteAndWait(ClangPath, &argv[0]);
-#endif
// Finally, we create the translation unit from the ast file.
ASTUnit *ATU = static_cast<ASTUnit *>(
More information about the cfe-commits
mailing list