Lines Matching +full:microsoft +full:- +full:prod
14 Block-ABI-Apple
23 <http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html>`_ for more information on
26 .. _langext-feature_check:
32 them. In order to allow fine-grain features checks, we support three builtin
33 function-like macros. This allows you to directly test for a feature in your
38 -----------------
40 This function-like macro takes a single identifier argument that is the name of
44 .. code-block:: c++
47 #define __has_builtin(x) 0 // Compatibility with non-clang compilers.
58 .. _langext-__has_feature-__has_extension:
61 -----------------------------------------
63 These function-like macros take a single identifier argument that is the name
66 not (but see :ref:`below <langext-has-feature-back-compat>`), while
71 .. code-block:: c++
74 #define __has_feature(x) 0 // Compatibility with non-clang compilers.
77 #define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
82 // This code will only be compiled with the -std=c++11 and -std=gnu++11
87 // This code will be compiled with the -std=c++11, -std=gnu++11, -std=c++98
88 // and -std=gnu++98 options, because rvalue references are supported as a
92 .. _langext-has-feature-back-compat:
95 for support for non-standardized features, i.e. features not prefixed ``c_``,
102 If the ``-pedantic-errors`` option is given, ``__has_extension`` is equivalent
113 -----------------------
115 This function-like macro takes a single argument that is the name of a
116 C++11-style attribute. The argument can either be a single identifier, or a
118 If the attribute is a standards-based attribute, this macro returns a nonzero
123 .. code-block:: c++
126 #define __has_cpp_attribute(x) 0 // Compatibility with non-clang compilers.
143 -------------------
145 This function-like macro takes a single identifier argument that is the name of
146 a GNU-style attribute. It evaluates to 1 if the attribute is supported by the
149 .. code-block:: c++
152 #define __has_attribute(x) 0 // Compatibility with non-clang compilers.
169 ----------------------------
171 This function-like macro takes a single identifier argument that is the name of
172 an attribute implemented as a Microsoft-style ``__declspec`` attribute. It
176 .. code-block:: c++
179 #define __has_declspec_attribute(x) 0 // Compatibility with non-clang compilers.
195 -------------------
197 This function-like macro takes a single identifier argument that might be either
200 used as the name of a user-defined function or variable. Otherwise it evaluates
203 .. code-block:: c++
206 #ifdef __is_identifier // Compatibility with non-clang compilers.
219 :ref:`langext-__has_include` and :ref:`langext-__has_include_next` macros allow
224 .. _langext-__has_include:
227 -----------------
229 This function-like macro takes a single file name string argument that is the
233 .. code-block:: c++
242 .. code-block:: c++
244 // To avoid problem with non-clang compilers not having this macro.
251 .. _langext-__has_include_next:
254 ----------------------
256 This function-like macro takes a single file name string argument that is the
262 .. code-block:: c++
269 // To avoid problem with non-clang compilers not having this macro.
278 used in the top-level compilation file. A warning will also be issued if an
282 -----------------
284 This function-like macro takes a string literal that represents a command line
287 .. code-block:: c++
289 #if __has_warning("-Wformat")
319 Instead, use the :ref:`langext-feature_check`.
325 the :ref:`langext-feature_check`.
334 .. _langext-vectors:
345 .. code-block:: c++
359 Giving ``-faltivec`` option to clang enables support for AltiVec vector syntax
362 .. code-block:: c++
373 .. code-block:: c++
385 ---------------
395 .. code-block:: c++
411 -----------------
420 [] yes yes yes --
421 unary operators +, -- yes yes yes --
422 ++, -- -- yes yes yes --
423 +,--,*,/,% yes yes yes --
424 bitwise operators &,|,^,~ yes yes yes --
425 >>,<< yes yes yes --
426 !, &&, || yes -- -- --
427 ==, !=, >, <, >=, <= yes yes -- --
429 :? yes -- -- --
431 C-style cast yes yes yes no
437 See also :ref:`langext-__builtin_shufflevector`, :ref:`langext-__builtin_convertvector`.
445 .. code-block:: c++
452 .. code-block:: none
455 [-Wdeprecated-declarations]
470 .. code-block:: c++
483 'User-Specified' System Frameworks
493 Framework developers can opt-in to this mechanism by creating a
494 "``.system_framework``" file at the top-level of their framework. That is, the
497 .. code-block:: none
518 Since Clang 3.4, the C++ SD-6 feature test macros are also supported.
522 information on the version of SD-6 supported by each Clang release, and the
526 -----
535 enabled. For example, compiling code with ``-fno-exceptions`` disables C++
542 example, compiling code with ``-fno-rtti`` disables the use of RTTI.
545 -----
548 these features are enabled with the ``-std=c++11`` or ``-std=gnu++11`` option
556 access-control errors (e.g., calling a private constructor) are considered to
558 <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170>`_.
594 ``decltype`` does not require type-completeness of a function call expression.
677 C++11 in-class non-static data member initialization
680 Use ``__has_feature(cxx_nonstatic_member_init)`` to determine whether in-class
681 initialization of non-static data members is enabled.
696 C++11 reference-qualified functions
701 for reference-qualified functions (e.g., member functions with ``&`` or ``&&``
704 C++11 range-based ``for`` loop
708 determine if support for the range-based for loop is enabled.
727 ``__has_extension(cxx_static_assert)`` to determine if support for compile-time
770 C++11 user-defined literals
774 user-defined literals is enabled.
784 -----
787 standard. As a result, all these features are enabled with the ``-std=c++1y``
788 or ``-std=gnu++1y`` option when compiling C++ code.
804 *new-expression*, the operand of a *delete-expression*, an integral constant
860 C++1y runtime-sized arrays
865 for arrays of runtime bound (a restricted form of variable-length arrays)
877 ---
880 features are enabled with the ``-std=c11`` or ``-std=gnu11`` option when
882 backward-compatible, they are available as extensions in all language modes.
898 :ref:`a set of builtins <langext-__c11_atomic>` which can be used to implement
929 to determine if support for compile-time assertions using ``_Static_assert`` is
939 -------
942 For example, compiling code with ``-fmodules`` enables the use of Modules.
951 user-facing type traits in the <type_traits> header.
954 implementation-defined and subject to change -- as such they're tied closely to
959 * The Microsoft standard C++ library
962 <http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html>`_ and a subset of the
963 `Microsoft Visual C++ Type traits
964 <http://msdn.microsoft.com/en-us/library/ms177194(v=VS.100).aspx>`_.
974 .. code-block:: c++
987 * ``__has_nothrow_assign`` (GNU, Microsoft)
988 * ``__has_nothrow_copy`` (GNU, Microsoft)
989 * ``__has_nothrow_constructor`` (GNU, Microsoft)
990 * ``__has_trivial_assign`` (GNU, Microsoft)
991 * ``__has_trivial_copy`` (GNU, Microsoft)
992 * ``__has_trivial_constructor`` (GNU, Microsoft)
993 * ``__has_trivial_destructor`` (GNU, Microsoft)
994 * ``__has_virtual_destructor`` (GNU, Microsoft)
995 * ``__is_abstract`` (GNU, Microsoft)
996 * ``__is_base_of`` (GNU, Microsoft)
997 * ``__is_class`` (GNU, Microsoft)
998 * ``__is_convertible_to`` (Microsoft)
999 * ``__is_empty`` (GNU, Microsoft)
1000 * ``__is_enum`` (GNU, Microsoft)
1001 * ``__is_interface_class`` (Microsoft)
1002 * ``__is_pod`` (GNU, Microsoft)
1003 * ``__is_polymorphic`` (GNU, Microsoft)
1004 * ``__is_union`` (GNU, Microsoft)
1007 ``final`` class-virt-specifier.
1013 that no non-trivial functions are called as part of that assignment. This
1016 value of type ``type`` can be direct-initialized with arguments of types
1017 ``argtypes...`` such that no non-trivial functions are called as part of
1032 the clang implementation are in :doc:`Block-ABI-Apple<Block-ABI-Apple>`.
1036 Objective-C Features
1040 --------------------
1042 According to Cocoa conventions, Objective-C methods with certain names
1049 .. code-block:: objc
1053 - (id)init;
1061 .. code-block:: objc
1074 that is only permitted in the result type of an Objective-C method, e.g.
1076 .. code-block:: objc
1084 camel-case selector (e.g., "``init``" in "``initWithObjects``") is considered,
1098 .. code-block:: objc
1101 - (NSUnrelated *)init; // incorrect usage: NSUnrelated is not NSString or a superclass of NSString
1112 ----------------------------
1115 <AutomaticReferenceCounting>` in Objective-C, which eliminates the need
1121 Objective-C objects.
1123 .. _objc-fixed-enum:
1126 -----------------------------------------
1129 within Objective-C. For example, one can write an enumeration type as:
1131 .. code-block:: c++
1139 underlying types is available in Objective-C.
1142 -----------------------------------
1144 Clang provides interoperability between C++11 lambdas and blocks-based APIs, by
1147 array-sorting method:
1149 .. code-block:: objc
1151 - (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr;
1159 .. code-block:: objc
1168 = [array sortedArrayUsingComparator:[=](id s1, id s2) -> NSComparisonResult {
1181 .. code-block:: objc
1195 Objective-C++, and not in C++ with blocks, due to its use of Objective-C memory
1199 --------------------------------
1202 <ObjectiveCLiterals>` in Objective-C, which simplifies common Objective-C
1211 Objective-C Autosynthesis of Properties
1212 ---------------------------------------
1220 .. _langext-objc-retain-release:
1222 Objective-C retaining behavior attributes
1223 -----------------------------------------
1225 In Objective-C, functions and methods are generally assumed to follow the
1231 `static analyzer <http://clang-analyzer.llvm.org>`_ Some exceptions may be
1237 that return Objective-C or CoreFoundation objects. They are commonly placed at
1240 .. code-block:: objc
1244 - (NSString *)bar:(int)x __attribute__((ns_returns_retained));
1256 The ``ns_consumes_self`` attribute can only be placed on an Objective-C
1260 .. code-block:: objc
1264 - (void) bar __attribute__((ns_consumes_self));
1265 - (void) baz:(id) __attribute__((ns_consumed)) x;
1268 <http://clang-analyzer.llvm.org/annotations.html#cocoa_mem>`_.
1274 Objective-C++ ABI: protocol-qualifier mangling of parameters
1275 ------------------------------------------------------------
1278 type is a qualified-``id`` (e.g., ``id<Foo>``). This mangling allows such
1282 This was a non-backward compatible mangling change to the ABI. This change
1284 parameters of protocol-qualified type.
1289 .. _langext-overloading:
1296 .. code-block:: c++
1311 .. code-block:: c++
1332 defined in target-specific header files like ``<xmmintrin.h>``, which define
1335 <langext-vectors>` instead of builtins, in order to reduce the number of
1339 ------------------------------
1346 .. code-block:: c++
1352 .. code-block:: c++
1357 // The optimizer may short-circuit this check using the invariant.
1375 ------------------------------
1378 a similar low-latency, high-accuracy clock) on those targets that support it.
1382 .. code-block:: c++
1388 .. code-block:: c++
1393 unsigned long long cycles_to_do_something = t1 - t0; // assuming no overflow
1398 which may be either global or process/thread-specific depending on the target.
1405 that even if present, its use may depend on run-time privilege or other OS
1408 .. _langext-__builtin_shufflevector:
1411 ---------------------------
1415 for the implementation of various target-specific header files like
1420 .. code-block:: c++
1426 .. code-block:: c++
1428 // identity operation - return 4-element vector v1.
1431 // "Splat" element 0 of V1 into a 4-element result.
1434 // Reverse 4-element vector V1.
1437 // Concatenate every other element of 4-element vectors V1 and V2.
1440 // Concatenate every other element of 8-element vectors V1 and V2.
1444 __builtin_shufflevector(v1, v1, 3, -1, 1, -1)
1453 ``vec1`` is a 4-element vector, index 5 would refer to the second element of
1454 ``vec2``. An index of -1 can be used to indicate that the corresponding element
1463 .. _langext-__builtin_convertvector:
1466 ---------------------------
1469 type-conversion operations. The input vector and the output vector
1474 .. code-block:: c++
1480 .. code-block:: c++
1505 C-style cast applied to each element of the first argument.
1510 ------------------------
1519 .. code-block:: c++
1525 .. code-block:: c++
1539 -------------------------
1550 .. code-block:: c++
1556 .. code-block:: c++
1574 ---------------------------
1581 .. code-block:: c++
1587 .. code-block:: c++
1601 ---------------
1607 .. code-block:: c++
1613 .. code-block:: c++
1628 -----------------------
1630 ``__builtin_addressof`` performs the functionality of the built-in ``&``
1637 .. code-block:: c++
1644 ------------------------------------------------------------
1646 ``__builtin_operator_new`` allocates memory just like a non-placement non-class
1647 *new-expression*. This is exactly like directly calling the normal
1648 non-placement ``::operator new``, except that it allows certain optimizations
1654 non-class *delete-expression*, and is exactly like directly calling the normal
1662 ----------------------------------
1667 .. code-block:: c
1674 .. code-block:: c
1687 .. code-block:: c
1701 ---------------------------
1707 .. code-block:: c
1721 .. code-block:: c
1725 bool __builtin_mul_overflow (type1 x, type2 y, type3 *prod);
1732 bool __builtin_umul_overflow (unsigned x, unsigned y, unsigned *prod);
1733 bool __builtin_umull_overflow (unsigned long x, unsigned long y, unsigned long *prod);
1734 …ol __builtin_umulll_overflow(unsigned long long x, unsigned long long y, unsigned long long *prod);
1741 bool __builtin_smul_overflow (int x, int y, int *prod);
1742 bool __builtin_smull_overflow (long x, long y, long *prod);
1743 bool __builtin_smulll_overflow(long long x, long long y, long long *prod);
1747 possible, the result will be equal to mathematically-correct result
1750 to the mathematically-correct result modulo two raised to the *k*
1752 behavior of these builtins is well-defined for all argument values.
1762 ---------------------------------------
1765 --------------------------
1767 .. code-block:: c
1776 <http://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for
1779 .. _langext-__c11_atomic:
1782 ---------------------
1811 (Note that Clang additionally provides GCC-compatible ``__atomic_*``
1814 Low-level ARM exclusive memory builtins
1815 ---------------------------------------
1820 .. code-block:: c
1831 * Floating-point types
1848 Non-temporal load/store builtins
1849 --------------------------------
1851 Clang provides overloaded builtins allowing generation of non-temporal memory
1854 .. code-block:: c
1862 * Floating-point types.
1865 Note that the compiler does not guarantee that non-temporal loads or stores
1868 Non-standard C++11 Attributes
1871 Clang's non-standard C++11 attributes live in the ``clang`` attribute
1878 <http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html>`_, `GCC variable
1879 attributes <http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html>`_, and
1881 <http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html>`_). As with the GCC
1882 implementation, these attributes must appertain to the *declarator-id* in a
1889 .. code-block:: c++
1893 Target-Specific Extensions
1899 -------------------------------
1911 X86/X86-64 Language Extensions
1912 ------------------------------
1922 relative to the X86 SS segment. Note that this is a very very low-level
1928 .. code-block:: c++
1935 Which compiles to (on X86-32):
1937 .. code-block:: gas
1949 Analyzer <http://clang-analyzer.llvm.org/>`_. These attributes are documented
1950 in the analyzer's `list of source-level annotations
1951 <http://clang-analyzer.llvm.org/annotations.html>`_.
1976 To disable optimizations in a single function definition, the GNU-style or C++11
1977 non-standard attribute ``optnone`` can be used.
1979 .. code-block:: c++
1982 // GNU-style attribute
1992 range-based pragma is provided. Its syntax is ``#pragma clang optimize``
2000 .. code-block:: c++
2025 .. code-block:: c++
2052 subsequent for, while, do-while, or c++11 range-based for loop. The directive
2058 ------------------------------
2068 improve instruction-level parallelism (ILP) using advanced hardware features,
2069 such as multiple execution units and out-of-order execution. The vectorizer uses
2074 by ``interleave(enable)``. This is useful when compiling with ``-Os`` to
2077 .. code-block:: c++
2090 .. code-block:: c++
2102 --------------
2117 .. code-block:: c++
2129 .. code-block:: c++
2141 .. code-block:: c++
2151 -----------------
2162 .. code-block:: c++
2174 it can hurt performance in some cases. For example, instruction-level
2179 ``-mllvm -enable-loop-distribution``, specifying ``distribute(disable)`` can
2180 be used the disable it on a per-loop basis.
2183 ----------------------
2187 .. code-block:: c++
2197 `-Rpass`, `-Rpass-missed`, and `-Rpass-analysis` command line options. See the