mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
VS2015 had an issue with the deletion of an operator. Since VS2017 is the minimum version that LLVM uses, we can assume that VS2017+ is in use (_MSC_VER >= 1910). Clean up the now defunct workaround.
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
//===--- Compiler.h - Compiler specific definitions -------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_BASIC_COMPILER_H
|
|
#define SWIFT_BASIC_COMPILER_H
|
|
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
#define SWIFT_COMPILER_IS_MSVC 1
|
|
#else
|
|
#define SWIFT_COMPILER_IS_MSVC 0
|
|
#endif
|
|
|
|
// Workaround non-clang compilers
|
|
#ifndef __has_builtin
|
|
#define __has_builtin(x) 0
|
|
#endif
|
|
#ifndef __has_attribute
|
|
#define __has_attribute(x) 0
|
|
#endif
|
|
|
|
// __builtin_assume() is an optimization hint.
|
|
#if __has_builtin(__builtin_assume)
|
|
#define SWIFT_ASSUME(x) __builtin_assume(x)
|
|
#else
|
|
#define SWIFT_ASSUME(x)
|
|
#endif
|
|
|
|
#if __has_attribute(constructor)
|
|
#define SWIFT_CONSTRUCTOR __attribute__((constructor))
|
|
#else
|
|
#define SWIFT_CONSTRUCTOR
|
|
#endif
|
|
|
|
#endif // SWIFT_BASIC_COMPILER_H
|