summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-04-29 00:45:03 +0000
committerNico Weber <nicolasweber@gmx.de>2018-04-29 00:45:03 +0000
commit712e8d29c4a52abded4414f673b51dd53dd018f1 (patch)
tree4b99dbe86251f1a62c3aefd587e57aa540795ee6 /llvm/lib/Support/Path.cpp
parentd3d3d6b75d43c52eaa2bcbe5bab7be10ff329695 (diff)
downloadbcm5719-llvm-712e8d29c4a52abded4414f673b51dd53dd018f1.tar.gz
bcm5719-llvm-712e8d29c4a52abded4414f673b51dd53dd018f1.zip
s/LLVM_ON_WIN32/_WIN32/, llvm
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index ec8a5ca98e5..b73c4562771 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -37,7 +37,7 @@ namespace {
using llvm::sys::path::Style;
inline Style real_style(Style style) {
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
return (style == Style::posix) ? Style::posix : Style::windows;
#else
return (style == Style::windows) ? Style::windows : Style::posix;
@@ -1073,7 +1073,7 @@ ErrorOr<perms> getPermissions(const Twine &Path) {
#if defined(LLVM_ON_UNIX)
#include "Unix/Path.inc"
#endif
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include "Windows/Path.inc"
#endif
@@ -1095,7 +1095,7 @@ Error TempFile::discard() {
Done = true;
std::error_code RemoveEC;
// On windows closing will remove the file.
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
// Always try to close and remove.
if (!TmpName.empty()) {
RemoveEC = fs::remove(TmpName);
@@ -1119,7 +1119,7 @@ Error TempFile::keep(const Twine &Name) {
assert(!Done);
Done = true;
// Always try to close and rename.
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
// If we cant't cancel the delete don't rename.
std::error_code RenameEC = cancelDeleteOnClose(FD);
if (!RenameEC)
@@ -1151,7 +1151,7 @@ Error TempFile::keep() {
assert(!Done);
Done = true;
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
if (std::error_code EC = cancelDeleteOnClose(FD))
return errorCodeToError(EC);
#else
@@ -1177,7 +1177,7 @@ Expected<TempFile> TempFile::create(const Twine &Model, unsigned Mode) {
return errorCodeToError(EC);
TempFile Ret(ResultPath, FD);
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
if (sys::RemoveFileOnSignal(ResultPath)) {
// Make sure we delete the file when RemoveFileOnSignal fails.
consumeError(Ret.discard());
OpenPOWER on IntegriCloud