]> granicus.if.org Git - clang/commitdiff
Check for LLVM_ON_WIN32 instead of _WIN32.
authorHans Wennborg <hans@hanshq.net>
Wed, 12 Mar 2014 16:07:46 +0000 (16:07 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 12 Mar 2014 16:07:46 +0000 (16:07 +0000)
This is a follow-up to r203624 to address Anton's comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitHeaderSearch.cpp
lib/Rewrite/Core/Rewriter.cpp
lib/Tooling/Tooling.cpp
tools/driver/driver.cpp
unittests/Basic/FileManagerTest.cpp
unittests/Tooling/ToolingTest.cpp

index bb1fe2db6b491ba294b958db589ce5b70bf8de5a..7356d4ab4a9f701f3c2b7aae13220ac740b8a3e0 100644 (file)
@@ -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");
index 69f039baf5885d556085ccc2016ca24109e3ba3f..08352a24d8f21ae72c1a3cea558148349d5c0ee9 100644 (file)
@@ -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
index c720bf4e8516a127bac3a3e1ae2fa5a327576367..8ad2675ee9fd9bcc8eb932083713eba9ba03bfdf 100644 (file)
@@ -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>
index e8860a21567b540d0a336fea05330fff846df5d6..beb271f810e54e6c33a4dd759a09396b4b534afd 100644 (file)
@@ -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.
index a9fd466a02b5d93915d2f8849d8d08c3b16451d0..9df85329a4d471eed915b9e2d780c35610b3ca28 100644 (file)
@@ -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
index f99321c617ce56d015d073aa383331acb4cbc61c..1eff6d064fcd3f57d773376e6e2a16e4439aea2b 100644 (file)
@@ -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>());