Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/Basic/Features.def
Line
Count
Source
1
1.97M
//===--- Features.def - Features and Extensions database --------*- C++ -*-===//
2
1.97M
//
3
1.97M
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
1.97M
// See https://llvm.org/LICENSE.txt for license information.
5
1.97M
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
1.97M
//
7
1.97M
//===----------------------------------------------------------------------===//
8
1.97M
//
9
1.97M
// This file defines features exposed via __has_feature and extensions exposed
10
1.97M
// via __has_extension. Users of this file must either define the FEATURE or
11
1.97M
// EXTENSION macros (or both) to make use of this information. Note that these
12
1.97M
// macros expect the following declarations to be available for the Predicate:
13
1.97M
//
14
1.97M
//   const LangOptions &LangOpts;
15
1.97M
//   const Preprocessor &PP;
16
1.97M
//
17
1.97M
// The Predicate field dictates the conditions under which the feature or
18
1.97M
// extension will be made available.
19
1.97M
//
20
1.97M
// FEATURE(...) should be used to advertise support for standard language
21
1.97M
// features, whereas EXTENSION(...) should be used for clang extensions. Note
22
1.97M
// that many of the identifiers in this file don't follow this rule for backward
23
1.97M
// compatibility reasons.
24
1.97M
//
25
1.97M
//===----------------------------------------------------------------------===//
26
1.97M
27
#if !defined(FEATURE) && !defined(EXTENSION)
28
#  error Define either the FEATURE or EXTENSION macro to handle features
29
#endif
30
31
#ifndef FEATURE
32
#define FEATURE(Name, Predicate)
33
#endif
34
35
#ifndef EXTENSION
36
#define EXTENSION(Name, Predicate)
37
#endif
38
39
1.97M
FEATURE1.97M
(address_sanitizer,
40
1.97M
        LangOpts.Sanitize.hasOneOf(SanitizerKind::Address |
41
1.97M
                                   SanitizerKind::KernelAddress))
42
1.97M
FEATURE1.97M
(hwaddress_sanitizer,
43
1.97M
        LangOpts.Sanitize.hasOneOf(SanitizerKind::HWAddress |
44
1.97M
                                   SanitizerKind::KernelHWAddress))
45
1.97M
FEATURE1.97M
(memtag_sanitizer, LangOpts.Sanitize.has(SanitizerKind::MemTag))
46
1.97M
FEATURE1.97M
(xray_instrument, LangOpts.XRayInstrument)
47
1.97M
FEATURE1.97M
(undefined_behavior_sanitizer,
48
1.97M
        LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined))
49
1.97M
FEATURE1.97M
(assume_nonnull, true)
50
1.97M
FEATURE1.97M
(attribute_analyzer_noreturn, true)
51
1.97M
FEATURE1.97M
(attribute_availability, true)
52
1.97M
FEATURE1.97M
(attribute_availability_with_message, true)
53
1.97M
FEATURE1.97M
(attribute_availability_app_extension, true)
54
1.97M
FEATURE1.97M
(attribute_availability_with_version_underscores, true)
55
1.97M
FEATURE1.97M
(attribute_availability_tvos, true)
56
1.97M
FEATURE1.97M
(attribute_availability_watchos, true)
57
1.97M
FEATURE1.97M
(attribute_availability_with_strict, true)
58
1.97M
FEATURE1.97M
(attribute_availability_with_replacement, true)
59
1.97M
FEATURE1.97M
(attribute_availability_in_templates, true)
60
1.97M
FEATURE1.97M
(attribute_availability_swift, true)
61
1.97M
FEATURE1.97M
(attribute_cf_returns_not_retained, true)
62
1.97M
FEATURE1.97M
(attribute_cf_returns_retained, true)
63
1.97M
FEATURE1.97M
(attribute_cf_returns_on_parameters, true)
64
1.97M
FEATURE1.97M
(attribute_deprecated_with_message, true)
65
1.97M
FEATURE1.97M
(attribute_deprecated_with_replacement, true)
66
1.97M
FEATURE1.97M
(attribute_ext_vector_type, true)
67
1.97M
FEATURE1.97M
(attribute_ns_returns_not_retained, true)
68
1.97M
FEATURE1.97M
(attribute_ns_returns_retained, true)
69
1.97M
FEATURE1.97M
(attribute_ns_consumes_self, true)
70
1.97M
FEATURE1.97M
(attribute_ns_consumed, true)
71
1.97M
FEATURE1.97M
(attribute_cf_consumed, true)
72
1.97M
FEATURE1.97M
(attribute_objc_ivar_unused, true)
73
1.97M
FEATURE1.97M
(attribute_objc_method_family, true)
74
1.97M
FEATURE1.97M
(attribute_overloadable, true)
75
1.97M
FEATURE1.97M
(attribute_unavailable_with_message, true)
76
1.97M
FEATURE1.97M
(attribute_unused_on_fields, true)
77
1.97M
FEATURE1.97M
(attribute_diagnose_if_objc, true)
78
1.97M
FEATURE1.97M
(blocks, LangOpts.Blocks)
79
1.97M
FEATURE1.97M
(c_thread_safety_attributes, true)
80
1.97M
FEATURE1.97M
(cxx_exceptions, LangOpts.CXXExceptions)
81
1.97M
FEATURE1.97M
(cxx_rtti, LangOpts.RTTI &&LangOpts.RTTIData)
82
1.97M
FEATURE1.97M
(enumerator_attributes, true)
83
1.97M
FEATURE1.97M
(nullability, true)
84
1.97M
FEATURE1.97M
(nullability_on_arrays, true)
85
1.97M
FEATURE1.97M
(memory_sanitizer,
86
1.97M
        LangOpts.Sanitize.hasOneOf(SanitizerKind::Memory |
87
1.97M
                                   SanitizerKind::KernelMemory))
88
1.97M
FEATURE1.97M
(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread))
89
1.97M
FEATURE1.97M
(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow))
90
1.97M
FEATURE1.97M
(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo))
91
1.97M
// Objective-C features
92
1.97M
FEATURE1.97M
(objc_arr, LangOpts.ObjCAutoRefCount) // FIXME: REMOVE?
93
1.97M
FEATURE1.97M
(objc_arc, LangOpts.ObjCAutoRefCount)
94
1.97M
FEATURE1.97M
(objc_arc_fields, true)
95
1.97M
FEATURE1.97M
(objc_arc_weak, LangOpts.ObjCWeak)
96
1.97M
FEATURE1.97M
(objc_default_synthesize_properties, LangOpts.ObjC)
97
1.97M
FEATURE1.97M
(objc_fixed_enum, LangOpts.ObjC)
98
1.97M
FEATURE1.97M
(objc_instancetype, LangOpts.ObjC)
99
1.97M
FEATURE1.97M
(objc_kindof, LangOpts.ObjC)
100
1.97M
FEATURE1.97M
(objc_modules, LangOpts.ObjC && LangOpts.Modules)
101
1.97M
FEATURE1.97M
(objc_nonfragile_abi, LangOpts.ObjCRuntime.isNonFragile())
102
1.97M
FEATURE1.97M
(objc_property_explicit_atomic, true)
103
1.97M
FEATURE1.97M
(objc_protocol_qualifier_mangling, true)
104
1.97M
FEATURE1.97M
(objc_weak_class, LangOpts.ObjCRuntime.hasWeakClassImport())
105
1.97M
FEATURE1.97M
(ownership_holds, true)
106
1.97M
FEATURE1.97M
(ownership_returns, true)
107
1.97M
FEATURE1.97M
(ownership_takes, true)
108
1.97M
FEATURE1.97M
(objc_bool, true)
109
1.97M
FEATURE1.97M
(objc_subscripting, LangOpts.ObjCRuntime.isNonFragile())
110
1.97M
FEATURE1.97M
(objc_array_literals, LangOpts.ObjC)
111
1.97M
FEATURE1.97M
(objc_dictionary_literals, LangOpts.ObjC)
112
1.97M
FEATURE1.97M
(objc_boxed_expressions, LangOpts.ObjC)
113
1.97M
FEATURE1.97M
(objc_boxed_nsvalue_expressions, LangOpts.ObjC)
114
1.97M
FEATURE1.97M
(arc_cf_code_audited, true)
115
1.97M
FEATURE1.97M
(objc_bridge_id, true)
116
1.97M
FEATURE1.97M
(objc_bridge_id_on_typedefs, true)
117
1.97M
FEATURE1.97M
(objc_generics, LangOpts.ObjC)
118
1.97M
FEATURE1.97M
(objc_generics_variance, LangOpts.ObjC)
119
1.97M
FEATURE1.97M
(objc_class_property, LangOpts.ObjC)
120
1.97M
FEATURE1.97M
(objc_c_static_assert, LangOpts.C11)
121
1.97M
FEATURE1.97M
(objc_cxx_static_assert, LangOpts.CPlusPlus11)
122
1.97M
EXTENSION2.97k
(objc_c_static_assert, true)
123
1.97M
// C11 features
124
1.97M
FEATURE1.97M
(c_alignas, LangOpts.C11)
125
1.97M
FEATURE1.97M
(c_alignof, LangOpts.C11)
126
1.97M
FEATURE1.97M
(c_atomic, LangOpts.C11)
127
1.97M
FEATURE1.97M
(c_generic_selections, LangOpts.C11)
128
1.97M
FEATURE1.97M
(c_static_assert, LangOpts.C11)
129
1.97M
FEATURE1.97M
(c_thread_local, LangOpts.C11 &&PP.getTargetInfo().isTLSSupported())
130
1.97M
// C++11 features
131
1.97M
FEATURE1.97M
(cxx_access_control_sfinae, LangOpts.CPlusPlus11)
132
1.97M
FEATURE1.97M
(cxx_alias_templates, LangOpts.CPlusPlus11)
133
1.97M
FEATURE1.97M
(cxx_alignas, LangOpts.CPlusPlus11)
134
1.97M
FEATURE1.97M
(cxx_alignof, LangOpts.CPlusPlus11)
135
1.97M
FEATURE1.97M
(cxx_atomic, LangOpts.CPlusPlus11)
136
1.97M
FEATURE1.97M
(cxx_attributes, LangOpts.CPlusPlus11)
137
1.97M
FEATURE1.97M
(cxx_auto_type, LangOpts.CPlusPlus11)
138
1.97M
FEATURE1.97M
(cxx_constexpr, LangOpts.CPlusPlus11)
139
1.97M
FEATURE1.97M
(cxx_constexpr_string_builtins, LangOpts.CPlusPlus11)
140
1.97M
FEATURE1.97M
(cxx_decltype, LangOpts.CPlusPlus11)
141
1.97M
FEATURE1.97M
(cxx_decltype_incomplete_return_types, LangOpts.CPlusPlus11)
142
1.97M
FEATURE1.97M
(cxx_default_function_template_args, LangOpts.CPlusPlus11)
143
1.97M
FEATURE1.97M
(cxx_defaulted_functions, LangOpts.CPlusPlus11)
144
1.97M
FEATURE1.97M
(cxx_delegating_constructors, LangOpts.CPlusPlus11)
145
1.97M
FEATURE1.97M
(cxx_deleted_functions, LangOpts.CPlusPlus11)
146
1.97M
FEATURE1.97M
(cxx_explicit_conversions, LangOpts.CPlusPlus11)
147
1.97M
FEATURE1.97M
(cxx_generalized_initializers, LangOpts.CPlusPlus11)
148
1.97M
FEATURE1.97M
(cxx_implicit_moves, LangOpts.CPlusPlus11)
149
1.97M
FEATURE1.97M
(cxx_inheriting_constructors, LangOpts.CPlusPlus11)
150
1.97M
FEATURE1.97M
(cxx_inline_namespaces, LangOpts.CPlusPlus11)
151
1.97M
FEATURE1.97M
(cxx_lambdas, LangOpts.CPlusPlus11)
152
1.97M
FEATURE1.97M
(cxx_local_type_template_args, LangOpts.CPlusPlus11)
153
1.97M
FEATURE1.97M
(cxx_nonstatic_member_init, LangOpts.CPlusPlus11)
154
1.97M
FEATURE1.97M
(cxx_noexcept, LangOpts.CPlusPlus11)
155
1.97M
FEATURE1.97M
(cxx_nullptr, LangOpts.CPlusPlus11)
156
1.97M
FEATURE1.97M
(cxx_override_control, LangOpts.CPlusPlus11)
157
1.97M
FEATURE1.97M
(cxx_range_for, LangOpts.CPlusPlus11)
158
1.97M
FEATURE1.97M
(cxx_raw_string_literals, LangOpts.CPlusPlus11)
159
1.97M
FEATURE1.97M
(cxx_reference_qualified_functions, LangOpts.CPlusPlus11)
160
1.97M
FEATURE1.97M
(cxx_rvalue_references, LangOpts.CPlusPlus11)
161
1.97M
FEATURE1.97M
(cxx_strong_enums, LangOpts.CPlusPlus11)
162
1.97M
FEATURE1.97M
(cxx_static_assert, LangOpts.CPlusPlus11)
163
1.97M
FEATURE1.97M
(cxx_thread_local,
164
1.97M
        LangOpts.CPlusPlus11 &&PP.getTargetInfo().isTLSSupported())
165
1.97M
FEATURE1.97M
(cxx_trailing_return, LangOpts.CPlusPlus11)
166
1.97M
FEATURE1.97M
(cxx_unicode_literals, LangOpts.CPlusPlus11)
167
1.97M
FEATURE1.97M
(cxx_unrestricted_unions, LangOpts.CPlusPlus11)
168
1.97M
FEATURE1.97M
(cxx_user_literals, LangOpts.CPlusPlus11)
169
1.97M
FEATURE1.97M
(cxx_variadic_templates, LangOpts.CPlusPlus11)
170
1.97M
// C++14 features
171
1.97M
FEATURE1.97M
(cxx_aggregate_nsdmi, LangOpts.CPlusPlus14)
172
1.97M
FEATURE1.97M
(cxx_binary_literals, LangOpts.CPlusPlus14)
173
1.97M
FEATURE1.97M
(cxx_contextual_conversions, LangOpts.CPlusPlus14)
174
1.97M
FEATURE1.97M
(cxx_decltype_auto, LangOpts.CPlusPlus14)
175
1.97M
FEATURE1.97M
(cxx_generic_lambdas, LangOpts.CPlusPlus14)
176
1.97M
FEATURE1.97M
(cxx_init_captures, LangOpts.CPlusPlus14)
177
1.97M
FEATURE1.97M
(cxx_relaxed_constexpr, LangOpts.CPlusPlus14)
178
1.97M
FEATURE1.97M
(cxx_return_type_deduction, LangOpts.CPlusPlus14)
179
1.97M
FEATURE1.97M
(cxx_variable_templates, LangOpts.CPlusPlus14)
180
1.97M
// NOTE: For features covered by SD-6, it is preferable to provide *only*
181
1.97M
// the SD-6 macro and not a __has_feature check.
182
1.97M
183
1.97M
// C++ TSes
184
1.97M
// FEATURE(cxx_runtime_arrays, LangOpts.CPlusPlusTSArrays)
185
1.97M
// FEATURE(cxx_concepts, LangOpts.CPlusPlusTSConcepts)
186
1.97M
// FIXME: Should this be __has_feature or __has_extension?
187
1.97M
// FEATURE(raw_invocation_type, LangOpts.CPlusPlus)
188
1.97M
// Type traits
189
1.97M
// N.B. Additional type traits should not be added to the following list.
190
1.97M
// Instead, they should be detected by has_extension.
191
1.97M
FEATURE1.97M
(has_nothrow_assign, LangOpts.CPlusPlus)
192
1.97M
FEATURE1.97M
(has_nothrow_copy, LangOpts.CPlusPlus)
193
1.97M
FEATURE1.97M
(has_nothrow_constructor, LangOpts.CPlusPlus)
194
1.97M
FEATURE1.97M
(has_trivial_assign, LangOpts.CPlusPlus)
195
1.97M
FEATURE1.97M
(has_trivial_copy, LangOpts.CPlusPlus)
196
1.97M
FEATURE1.97M
(has_trivial_constructor, LangOpts.CPlusPlus)
197
1.97M
FEATURE1.97M
(has_trivial_destructor, LangOpts.CPlusPlus)
198
1.97M
FEATURE1.97M
(has_virtual_destructor, LangOpts.CPlusPlus)
199
1.97M
FEATURE1.97M
(is_abstract, LangOpts.CPlusPlus)
200
1.97M
FEATURE1.97M
(is_base_of, LangOpts.CPlusPlus)
201
1.97M
FEATURE1.97M
(is_class, LangOpts.CPlusPlus)
202
1.97M
FEATURE1.97M
(is_constructible, LangOpts.CPlusPlus)
203
1.97M
FEATURE1.97M
(is_convertible_to, LangOpts.CPlusPlus)
204
1.97M
FEATURE1.97M
(is_empty, LangOpts.CPlusPlus)
205
1.97M
FEATURE1.97M
(is_enum, LangOpts.CPlusPlus)
206
1.97M
FEATURE1.97M
(is_final, LangOpts.CPlusPlus)
207
1.97M
FEATURE1.97M
(is_literal, LangOpts.CPlusPlus)
208
1.97M
FEATURE1.97M
(is_standard_layout, LangOpts.CPlusPlus)
209
1.97M
FEATURE1.97M
(is_pod, LangOpts.CPlusPlus)
210
1.97M
FEATURE1.97M
(is_polymorphic, LangOpts.CPlusPlus)
211
1.97M
FEATURE1.97M
(is_sealed, LangOpts.CPlusPlus &&LangOpts.MicrosoftExt)
212
1.97M
FEATURE1.97M
(is_trivial, LangOpts.CPlusPlus)
213
1.97M
FEATURE1.97M
(is_trivially_assignable, LangOpts.CPlusPlus)
214
1.97M
FEATURE1.97M
(is_trivially_constructible, LangOpts.CPlusPlus)
215
1.97M
FEATURE1.97M
(is_trivially_copyable, LangOpts.CPlusPlus)
216
1.97M
FEATURE1.97M
(is_union, LangOpts.CPlusPlus)
217
1.97M
FEATURE1.97M
(modules, LangOpts.Modules)
218
1.97M
FEATURE1.97M
(safe_stack, LangOpts.Sanitize.has(SanitizerKind::SafeStack))
219
1.97M
FEATURE1.97M
(shadow_call_stack,
220
1.97M
        LangOpts.Sanitize.has(SanitizerKind::ShadowCallStack))
221
1.97M
FEATURE1.97M
(tls, PP.getTargetInfo().isTLSSupported())
222
1.97M
FEATURE1.97M
(underlying_type, LangOpts.CPlusPlus)
223
1.97M
224
1.97M
// C11 features supported by other languages as extensions.
225
1.97M
EXTENSION2.97k
(c_alignas, true)
226
1.97M
EXTENSION2.97k
(c_alignof, true)
227
1.97M
EXTENSION2.97k
(c_atomic, true)
228
1.97M
EXTENSION2.97k
(c_generic_selections, true)
229
1.97M
EXTENSION2.97k
(c_static_assert, true)
230
1.97M
EXTENSION2.97k
(c_thread_local, PP.getTargetInfo().isTLSSupported())
231
1.97M
// C++11 features supported by other languages as extensions.
232
1.97M
EXTENSION2.97k
(cxx_atomic, LangOpts.CPlusPlus)
233
1.97M
EXTENSION2.97k
(cxx_deleted_functions, LangOpts.CPlusPlus)
234
1.97M
EXTENSION2.97k
(cxx_explicit_conversions, LangOpts.CPlusPlus)
235
1.97M
EXTENSION2.97k
(cxx_inline_namespaces, LangOpts.CPlusPlus)
236
1.97M
EXTENSION2.97k
(cxx_local_type_template_args, LangOpts.CPlusPlus)
237
1.97M
EXTENSION2.97k
(cxx_nonstatic_member_init, LangOpts.CPlusPlus)
238
1.97M
EXTENSION2.97k
(cxx_override_control, LangOpts.CPlusPlus)
239
1.97M
EXTENSION2.97k
(cxx_range_for, LangOpts.CPlusPlus)
240
1.97M
EXTENSION2.97k
(cxx_reference_qualified_functions, LangOpts.CPlusPlus)
241
1.97M
EXTENSION2.97k
(cxx_rvalue_references, LangOpts.CPlusPlus)
242
1.97M
EXTENSION2.97k
(cxx_variadic_templates, LangOpts.CPlusPlus)
243
1.97M
EXTENSION2.97k
(cxx_fixed_enum, true)
244
1.97M
// C++14 features supported by other languages as extensions.
245
1.97M
EXTENSION2.97k
(cxx_binary_literals, true)
246
1.97M
EXTENSION2.97k
(cxx_init_captures, LangOpts.CPlusPlus11)
247
1.97M
EXTENSION2.97k
(cxx_variable_templates, LangOpts.CPlusPlus)
248
1.97M
// Miscellaneous language extensions
249
1.97M
EXTENSION2.97k
(overloadable_unmarked, true)
250
1.97M
EXTENSION2.97k
(pragma_clang_attribute_namespaces, true)
251
1.97M
EXTENSION2.97k
(pragma_clang_attribute_external_declaration, true)
252
1.97M
EXTENSION2.97k
(gnu_asm, LangOpts.GNUAsm)
253
1.97M
254
1.97M
#undef EXTENSION
255
1.97M
#undef FEATURE