Prefix COMPILER_IS_MSVC with SWIFT_

This commit is contained in:
Hugh Bellamy
2017-01-16 22:09:53 +00:00
parent 4dfa6389b0
commit 201ad5d594
8 changed files with 16 additions and 16 deletions

View File

@@ -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

View File

@@ -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 \

View File

@@ -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);

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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
};

View File

@@ -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
}