Skip to content

Commit 201ad5d

Browse files
committed
Prefix COMPILER_IS_MSVC with SWIFT_
1 parent 4dfa638 commit 201ad5d

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

include/swift/AST/AnyFunctionRef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class AnyFunctionRef {
152152
}
153153

154154
// Disable "only for use within the debugger" warning.
155-
#if COMPILER_IS_MSVC
155+
#if SWIFT_COMPILER_IS_MSVC
156156
#pragma warning(push)
157157
#pragma warning(disable: 4996)
158158
#endif
@@ -177,7 +177,7 @@ class AnyFunctionRef {
177177
llvm_unreachable("unexpected AnyFunctionRef representation");
178178
}
179179
};
180-
#if COMPILER_IS_MSVC
180+
#if SWIFT_COMPILER_IS_MSVC
181181
#pragma warning(pop)
182182
#endif
183183

include/swift/Basic/Compiler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
#define SWIFT_BASIC_COMPILER_H
1515

1616
#if defined(_MSC_VER) && !defined(__clang__)
17-
#define COMPILER_IS_MSVC 1
17+
#define SWIFT_COMPILER_IS_MSVC 1
1818
#else
19-
#define COMPILER_IS_MSVC 0
19+
#define SWIFT_COMPILER_IS_MSVC 0
2020
#endif
2121

22-
#if COMPILER_IS_MSVC
22+
#if SWIFT_COMPILER_IS_MSVC
2323
// Work around MSVC bug: attempting to reference a deleted function
2424
// https://connect.microsoft.com/VisualStudio/feedback/details/3116505
2525
#define SWIFT_DELETE_OPERATOR_DELETED \

include/swift/Basic/EncodedSequence.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class EncodedSequence : public EncodedSequenceBase {
340340
template <class ValueType> class Map {
341341
// Hack: MSVC isn't able to resolve the InlineKeyCapacity part of the
342342
// template of PrefixMap, so we have to split it up and pass it manually.
343-
#if COMPILER_IS_MSVC
343+
#if SWIFT_COMPILER_IS_MSVC
344344
static const size_t Size = (sizeof(void*) - 1) / sizeof(Chunk);
345345
static const size_t ActualSize = max<size_t>(Size, 1);
346346

include/swift/Basic/type_traits.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace swift {
3030
/// is not intended to be specialized.
3131
template<typename T>
3232
struct IsTriviallyCopyable {
33-
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
33+
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
3434
// libc++ and MSVC implement is_trivially_copyable.
3535
static const bool value = std::is_trivially_copyable<T>::value;
3636
#elif __has_feature(is_trivially_copyable)
@@ -42,7 +42,7 @@ struct IsTriviallyCopyable {
4242

4343
template<typename T>
4444
struct IsTriviallyConstructible {
45-
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
45+
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
4646
// libc++ and MSVC implement is_trivially_constructible.
4747
static const bool value = std::is_trivially_constructible<T>::value;
4848
#elif __has_feature(has_trivial_constructor)
@@ -54,7 +54,7 @@ struct IsTriviallyConstructible {
5454

5555
template<typename T>
5656
struct IsTriviallyDestructible {
57-
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
57+
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
5858
// libc++ and MSVC implement is_trivially_destructible.
5959
static const bool value = std::is_trivially_destructible<T>::value;
6060
#elif __has_feature(has_trivial_destructor)

include/swift/SIL/SILOpenedArchetypesTracker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace swift {
2323

2424
// Disable MSVC warning: multiple copy constructors specified.
2525
// TODO: silence this warning.
26-
#if COMPILER_IS_MSVC
26+
#if SWIFT_COMPILER_IS_MSVC
2727
#pragma warning(push)
2828
#pragma warning(disable: 4521)
2929
#endif
@@ -136,7 +136,7 @@ class SILOpenedArchetypesTracker : public DeleteNotificationHandler {
136136
OpenedArchetypeDefsMap LocalOpenedArchetypeDefs;
137137
};
138138

139-
#if COMPILER_IS_MSVC
139+
#if SWIFT_COMPILER_IS_MSVC
140140
#pragma warning(pop)
141141
#endif
142142

lib/AST/ASTContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ struct ASTContext::Implementation {
278278
conformance.~SpecializedProtocolConformance();
279279
// Work around MSVC warning: local variable is initialized but
280280
// not referenced.
281-
#if COMPILER_IS_MSVC
281+
#if SWIFT_COMPILER_IS_MSVC
282282
#pragma warning (disable: 4189)
283283
#endif
284284
for (auto &conformance : InheritedConformances)
285285
conformance.~InheritedProtocolConformance();
286-
#if COMPILER_IS_MSVC
286+
#if SWIFT_COMPILER_IS_MSVC
287287
#pragma warning (default: 4189)
288288
#endif
289289

lib/AST/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ namespace {
843843
template <typename T>
844844
struct OperatorLookup {
845845
// TODO: this assertion fails in MSVC, but not clang-cl.
846-
#if !COMPILER_IS_MSVC
846+
#if !SWIFT_COMPILER_IS_MSVC
847847
static_assert(static_cast<T*>(nullptr), "Only usable with operators");
848848
#endif
849849
};

lib/Sema/Constraint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ void Constraint::dump(ConstraintSystem *CS) const {
334334
llvm::SaveAndRestore<bool> X(CS->getASTContext().LangOpts.
335335
DebugConstraintSolver, true);
336336
// Disable MSVC warning: only for use within the debugger.
337-
#if COMPILER_IS_MSVC
337+
#if SWIFT_COMPILER_IS_MSVC
338338
#pragma warning(push)
339339
#pragma warning(disable: 4996)
340340
#endif
341341
dump(&CS->getASTContext().SourceMgr);
342-
#if COMPILER_IS_MSVC
342+
#if SWIFT_COMPILER_IS_MSVC
343343
#pragma warning(pop)
344344
#endif
345345
}

0 commit comments

Comments
 (0)