mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Prefix COMPILER_IS_MSVC with SWIFT_
This commit is contained in:
@@ -152,7 +152,7 @@ public:
|
||||
}
|
||||
|
||||
// Disable "only for use within the debugger" warning.
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
llvm_unreachable("unexpected AnyFunctionRef representation");
|
||||
}
|
||||
};
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#define SWIFT_BASIC_COMPILER_H
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define COMPILER_IS_MSVC 1
|
||||
#define SWIFT_COMPILER_IS_MSVC 1
|
||||
#else
|
||||
#define COMPILER_IS_MSVC 0
|
||||
#define SWIFT_COMPILER_IS_MSVC 0
|
||||
#endif
|
||||
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
// Work around MSVC bug: attempting to reference a deleted function
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/3116505
|
||||
#define SWIFT_DELETE_OPERATOR_DELETED \
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
template <class ValueType> class Map {
|
||||
// Hack: MSVC isn't able to resolve the InlineKeyCapacity part of the
|
||||
// template of PrefixMap, so we have to split it up and pass it manually.
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
static const size_t Size = (sizeof(void*) - 1) / sizeof(Chunk);
|
||||
static const size_t ActualSize = max<size_t>(Size, 1);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace swift {
|
||||
/// is not intended to be specialized.
|
||||
template<typename T>
|
||||
struct IsTriviallyCopyable {
|
||||
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
|
||||
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
|
||||
// libc++ and MSVC implement is_trivially_copyable.
|
||||
static const bool value = std::is_trivially_copyable<T>::value;
|
||||
#elif __has_feature(is_trivially_copyable)
|
||||
@@ -42,7 +42,7 @@ struct IsTriviallyCopyable {
|
||||
|
||||
template<typename T>
|
||||
struct IsTriviallyConstructible {
|
||||
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
|
||||
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
|
||||
// libc++ and MSVC implement is_trivially_constructible.
|
||||
static const bool value = std::is_trivially_constructible<T>::value;
|
||||
#elif __has_feature(has_trivial_constructor)
|
||||
@@ -54,7 +54,7 @@ struct IsTriviallyConstructible {
|
||||
|
||||
template<typename T>
|
||||
struct IsTriviallyDestructible {
|
||||
#if _LIBCPP_VERSION || COMPILER_IS_MSVC
|
||||
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
|
||||
// libc++ and MSVC implement is_trivially_destructible.
|
||||
static const bool value = std::is_trivially_destructible<T>::value;
|
||||
#elif __has_feature(has_trivial_destructor)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace swift {
|
||||
|
||||
// Disable MSVC warning: multiple copy constructors specified.
|
||||
// TODO: silence this warning.
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4521)
|
||||
#endif
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
OpenedArchetypeDefsMap LocalOpenedArchetypeDefs;
|
||||
};
|
||||
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -278,12 +278,12 @@ struct ASTContext::Implementation {
|
||||
conformance.~SpecializedProtocolConformance();
|
||||
// Work around MSVC warning: local variable is initialized but
|
||||
// not referenced.
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning (disable: 4189)
|
||||
#endif
|
||||
for (auto &conformance : InheritedConformances)
|
||||
conformance.~InheritedProtocolConformance();
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning (default: 4189)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -843,7 +843,7 @@ namespace {
|
||||
template <typename T>
|
||||
struct OperatorLookup {
|
||||
// TODO: this assertion fails in MSVC, but not clang-cl.
|
||||
#if !COMPILER_IS_MSVC
|
||||
#if !SWIFT_COMPILER_IS_MSVC
|
||||
static_assert(static_cast<T*>(nullptr), "Only usable with operators");
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -334,12 +334,12 @@ void Constraint::dump(ConstraintSystem *CS) const {
|
||||
llvm::SaveAndRestore<bool> X(CS->getASTContext().LangOpts.
|
||||
DebugConstraintSolver, true);
|
||||
// Disable MSVC warning: only for use within the debugger.
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
dump(&CS->getASTContext().SourceMgr);
|
||||
#if COMPILER_IS_MSVC
|
||||
#if SWIFT_COMPILER_IS_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user