Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / include / llvm-c / Deprecated.h
blob1ed5d11550d20c8924ad624e6bedbfa1c19b63f4
1 /*===-- llvm-c/Deprecated.h - Deprecation macro -------------------*- C -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header declares LLVM_ATTRIBUTE_C_DEPRECATED() macro, which can be *|
11 |* used to deprecate functions in the C interface. *|
12 |* *|
13 \*===----------------------------------------------------------------------===*/
15 #ifndef LLVM_C_DEPRECATED_H
16 #define LLVM_C_DEPRECATED_H
18 #ifndef __has_feature
19 # define __has_feature(x) 0
20 #endif
22 // This is a variant of LLVM_ATTRIBUTE_DEPRECATED() that is compatible with
23 // C compilers.
24 #if __has_feature(attribute_deprecated_with_message)
25 # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
26 decl __attribute__((deprecated(message)))
27 #elif defined(__GNUC__)
28 # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
29 decl __attribute__((deprecated))
30 #elif defined(_MSC_VER)
31 # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
32 __declspec(deprecated(message)) decl
33 #else
34 # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
35 decl
36 #endif
38 #endif /* LLVM_C_DEPRECATED_H */