r203668 - Check for LLVM_ON_WIN32 instead of _WIN32.
Hans Wennborg
hans at hanshq.net
Wed Mar 12 09:07:46 PDT 2014
Author: hans
Date: Wed Mar 12 11:07:46 2014
New Revision: 203668
URL: http://llvm.org/viewvc/llvm-project?rev=203668&view=rev
Log:
Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment.
Modified:
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
cfe/trunk/lib/Tooling/Tooling.cpp
cfe/trunk/tools/driver/driver.cpp
cfe/trunk/unittests/Basic/FileManagerTest.cpp
cfe/trunk/unittests/Tooling/ToolingTest.cpp
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Wed Mar 12 11:07:46 2014
@@ -110,7 +110,7 @@ public:
} // end anonymous namespace.
static bool CanPrefixSysroot(StringRef Path) {
-#if defined(_WIN32)
+#if defined(LLVM_ON_WIN32)
return !Path.empty() && llvm::sys::path::is_separator(Path[0]);
#else
return llvm::sys::path::is_absolute(Path);
@@ -328,7 +328,7 @@ void InitHeaderSearch::AddDefaultCInclud
llvm::sys::path::append(P, "../../../include");
AddPath(P.str(), System, false);
AddPath("/mingw/include", System, false);
-#if defined(_WIN32)
+#if defined(LLVM_ON_WIN32)
AddPath("c:/mingw/include", System, false);
#endif
}
@@ -403,7 +403,7 @@ AddDefaultCPlusPlusIncludePaths(const ll
AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.8.1");
AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.8.2");
// mingw.org C++ include paths
-#if defined(_WIN32)
+#if defined(LLVM_ON_WIN32)
AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.0");
AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.1");
AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.2");
Modified: cfe/trunk/lib/Rewrite/Core/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Core/Rewriter.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Core/Rewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Core/Rewriter.cpp Wed Mar 12 11:07:46 2014
@@ -21,6 +21,7 @@
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/Config/config.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
@@ -449,7 +450,7 @@ public:
if (!ok()) return;
FileStream->flush();
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
// Win32 does not allow rename/removing opened files.
FileStream.reset();
#endif
Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Wed Mar 12 11:07:46 2014
@@ -24,6 +24,7 @@
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Config/config.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
@@ -31,7 +32,7 @@
#include "llvm/Support/raw_ostream.h"
// For chdir, see the comment in ClangTool::run for more information.
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
# include <direct.h>
#else
# include <unistd.h>
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Wed Mar 12 11:07:46 2014
@@ -25,6 +25,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Config/config.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
@@ -227,7 +228,7 @@ static void ParseProgName(SmallVectorImp
{ "++", "--driver-mode=g++" },
};
std::string ProgName(llvm::sys::path::stem(ArgVector[0]));
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
// Transform to lowercase for case insensitive file systems.
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(),
toLowercase);
@@ -445,7 +446,7 @@ int main(int argc_, const char **argv_)
llvm::llvm_shutdown();
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
// Exit status should not be negative on Win32, unless abnormal termination.
// Once abnormal termiation was caught, negative status should not be
// propagated.
Modified: cfe/trunk/unittests/Basic/FileManagerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/FileManagerTest.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/FileManagerTest.cpp (original)
+++ cfe/trunk/unittests/Basic/FileManagerTest.cpp Wed Mar 12 11:07:46 2014
@@ -11,6 +11,7 @@
#include "clang/Basic/FileSystemOptions.h"
#include "clang/Basic/FileSystemStatCache.h"
#include "gtest/gtest.h"
+#include "llvm/Config/config.h"
using namespace llvm;
using namespace clang;
@@ -126,7 +127,7 @@ TEST_F(FileManagerTest, getFileReturnsVa
statCache->InjectDirectory("/tmp", 42);
statCache->InjectFile("/tmp/test", 43);
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
const char *DirName = "C:.";
const char *FileName = "C:test";
statCache->InjectDirectory(DirName, 44);
@@ -143,7 +144,7 @@ TEST_F(FileManagerTest, getFileReturnsVa
ASSERT_TRUE(dir != NULL);
EXPECT_STREQ("/tmp", dir->getName());
-#ifdef _WIN32
+#ifdef LLVM_ON_WIN32
file = manager.getFile(FileName);
ASSERT_TRUE(file != NULL);
@@ -204,7 +205,7 @@ TEST_F(FileManagerTest, getFileReturnsNU
// The following tests apply to Unix-like system only.
-#ifndef _WIN32
+#ifndef LLVM_ON_WIN32
// getFile() returns the same FileEntry for real files that are aliases.
TEST_F(FileManagerTest, getFileReturnsSameFileEntryForAliasedRealFiles) {
@@ -234,6 +235,6 @@ TEST_F(FileManagerTest, getFileReturnsSa
EXPECT_EQ(manager.getFile("abc/foo.cpp"), manager.getFile("abc/bar.cpp"));
}
-#endif // !_WIN32
+#endif // !LLVM_ON_WIN32
} // anonymous namespace
Modified: cfe/trunk/unittests/Tooling/ToolingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ToolingTest.cpp?rev=203668&r1=203667&r2=203668&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/ToolingTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/ToolingTest.cpp Wed Mar 12 11:07:46 2014
@@ -17,6 +17,7 @@
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Config/config.h"
#include "gtest/gtest.h"
#include <string>
@@ -192,7 +193,7 @@ struct VerifyEndCallback : public Source
bool Matched;
};
-#if !defined(_WIN32)
+#if !defined(LLVM_ON_WIN32)
TEST(newFrontendActionFactory, InjectsSourceFileCallbacks) {
VerifyEndCallback EndCallback;
@@ -292,7 +293,7 @@ TEST(ClangToolTest, ArgumentAdjusters) {
EXPECT_FALSE(Found);
}
-#ifndef _WIN32
+#ifndef LLVM_ON_WIN32
TEST(ClangToolTest, BuildASTs) {
FixedCompilationDatabase Compilations("/", std::vector<std::string>());
More information about the cfe-commits
mailing list