summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-03-12 16:07:46 +0000
committerHans Wennborg <hans@hanshq.net>2014-03-12 16:07:46 +0000
commit501eadb42919f8312a55d78455a44b39e16762ed (patch)
tree14b5f66134c9d25db988268b6d8a3f663a16ea86
parent3e699d419eebdd287e34c22d8abffa237fc1bf33 (diff)
downloadbcm5719-llvm-501eadb42919f8312a55d78455a44b39e16762ed.tar.gz
bcm5719-llvm-501eadb42919f8312a55d78455a44b39e16762ed.zip
Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment. llvm-svn: 203668
-rw-r--r--clang/lib/Frontend/InitHeaderSearch.cpp6
-rw-r--r--clang/lib/Rewrite/Core/Rewriter.cpp3
-rw-r--r--clang/lib/Tooling/Tooling.cpp3
-rw-r--r--clang/tools/driver/driver.cpp5
-rw-r--r--clang/unittests/Basic/FileManagerTest.cpp9
-rw-r--r--clang/unittests/Tooling/ToolingTest.cpp5
6 files changed, 18 insertions, 13 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp
index bb1fe2db6b4..7356d4ab4a9 100644
--- a/clang/lib/Frontend/InitHeaderSearch.cpp
+++ b/clang/lib/Frontend/InitHeaderSearch.cpp
@@ -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::AddDefaultCIncludePaths(const llvm::Triple &triple,
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 llvm::Triple &triple, const HeaderSearchOp
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");
diff --git a/clang/lib/Rewrite/Core/Rewriter.cpp b/clang/lib/Rewrite/Core/Rewriter.cpp
index 69f039baf58..08352a24d8f 100644
--- a/clang/lib/Rewrite/Core/Rewriter.cpp
+++ b/clang/lib/Rewrite/Core/Rewriter.cpp
@@ -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
diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp
index c720bf4e851..8ad2675ee9f 100644
--- a/clang/lib/Tooling/Tooling.cpp
+++ b/clang/lib/Tooling/Tooling.cpp
@@ -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>
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index e8860a21567..beb271f810e 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -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(SmallVectorImpl<const char *> &ArgVector,
{ "++", "--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.
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp
index a9fd466a02b..9df85329a4d 100644
--- a/clang/unittests/Basic/FileManagerTest.cpp
+++ b/clang/unittests/Basic/FileManagerTest.cpp
@@ -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, getFileReturnsValidFileEntryForExistingRealFile) {
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, getFileReturnsValidFileEntryForExistingRealFile) {
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, getFileReturnsNULLForNonexistentFile) {
// 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, getFileReturnsSameFileEntryForAliasedVirtualFiles) {
EXPECT_EQ(manager.getFile("abc/foo.cpp"), manager.getFile("abc/bar.cpp"));
}
-#endif // !_WIN32
+#endif // !LLVM_ON_WIN32
} // anonymous namespace
diff --git a/clang/unittests/Tooling/ToolingTest.cpp b/clang/unittests/Tooling/ToolingTest.cpp
index f99321c617c..1eff6d064fc 100644
--- a/clang/unittests/Tooling/ToolingTest.cpp
+++ b/clang/unittests/Tooling/ToolingTest.cpp
@@ -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 SourceFileCallbacks {
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>());
OpenPOWER on IntegriCloud