diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
| commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
| tree | ac719b5984165053bf83d71142e4d96b609b9784 /include/clang/Basic | |
| parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) | |
Diffstat (limited to 'include/clang/Basic')
| -rw-r--r-- | include/clang/Basic/Attr.td | 22 | ||||
| -rw-r--r-- | include/clang/Basic/AttrDocs.td | 116 | ||||
| -rw-r--r-- | include/clang/Basic/BuiltinsARM.def | 8 | ||||
| -rw-r--r-- | include/clang/Basic/BuiltinsNVPTX.def | 2 | ||||
| -rw-r--r-- | include/clang/Basic/BuiltinsPPC.def | 12 | ||||
| -rw-r--r-- | include/clang/Basic/BuiltinsX86.def | 117 | ||||
| -rw-r--r-- | include/clang/Basic/Diagnostic.h | 8 | ||||
| -rw-r--r-- | include/clang/Basic/DiagnosticCommonKinds.td | 22 | ||||
| -rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 59 | ||||
| -rw-r--r-- | include/clang/Basic/IdentifierTable.h | 13 | ||||
| -rw-r--r-- | include/clang/Basic/LangOptions.def | 1 | ||||
| -rw-r--r-- | include/clang/Basic/LangOptions.h | 2 | ||||
| -rw-r--r-- | include/clang/Basic/Module.h | 3 | ||||
| -rw-r--r-- | include/clang/Basic/OpenMPKinds.def | 13 | ||||
| -rw-r--r-- | include/clang/Basic/OpenMPKinds.h | 8 | ||||
| -rw-r--r-- | include/clang/Basic/Specifiers.h | 3 | ||||
| -rw-r--r-- | include/clang/Basic/StmtNodes.td | 2 | ||||
| -rw-r--r-- | include/clang/Basic/TargetInfo.h | 8 | ||||
| -rw-r--r-- | include/clang/Basic/TokenKinds.def | 9 | ||||
| -rw-r--r-- | include/clang/Basic/TypeTraits.h | 3 |
20 files changed, 357 insertions, 74 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index f36f654ff630..2bbce37e57bb 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -950,30 +950,30 @@ def NonNull : InheritableAttr { } }]; // FIXME: We should merge duplicates into a single nonnull attribute. let DuplicatesAllowedWhileMerging = 1; - let Documentation = [Undocumented]; + let Documentation = [NonNullDocs]; } def ReturnsNonNull : InheritableAttr { let Spellings = [GCC<"returns_nonnull">]; let Subjects = SubjectList<[ObjCMethod, Function], WarnDiag, "ExpectedFunctionOrMethod">; - let Documentation = [Undocumented]; + let Documentation = [ReturnsNonNullDocs]; } // Nullability type attributes. def TypeNonNull : TypeAttr { - let Spellings = [Keyword<"__nonnull">]; - let Documentation = [Undocumented]; + let Spellings = [Keyword<"_Nonnull">]; + let Documentation = [TypeNonNullDocs]; } def TypeNullable : TypeAttr { - let Spellings = [Keyword<"__nullable">]; - let Documentation = [Undocumented]; + let Spellings = [Keyword<"_Nullable">]; + let Documentation = [TypeNullableDocs]; } def TypeNullUnspecified : TypeAttr { - let Spellings = [Keyword<"__null_unspecified">]; - let Documentation = [Undocumented]; + let Spellings = [Keyword<"_Null_unspecified">]; + let Documentation = [TypeNullUnspecifiedDocs]; } def AssumeAligned : InheritableAttr { @@ -1125,6 +1125,12 @@ def ObjCRuntimeName : Attr { let Documentation = [ObjCRuntimeNameDocs]; } +def ObjCBoxable : Attr { + let Spellings = [GNU<"objc_boxable">]; + let Subjects = SubjectList<[Record], ErrorDiag, "ExpectedStructOrUnion">; + let Documentation = [Undocumented]; +} + def OptimizeNone : InheritableAttr { let Spellings = [GNU<"optnone">, CXX11<"clang", "optnone">]; let Subjects = SubjectList<[Function, ObjCMethod]>; diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index 9314c445a56b..107458e46145 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -181,6 +181,11 @@ to enforce the provided alignment assumption. def EnableIfDocs : Documentation { let Category = DocCatFunction; let Content = [{ +.. Note:: Some features of this attribute are experimental. The meaning of
+ multiple enable_if attributes on a single declaration is subject to change in
+ a future version of clang. Also, the ABI is not standardized and the name
+ mangling may change in future versions. To avoid that, use asm labels. + The ``enable_if`` attribute can be placed on function declarations to control which overload is selected based on the values of the function's arguments. When combined with the ``overloadable`` attribute, this feature is also @@ -1448,3 +1453,114 @@ private address space. Kernel function arguments of a pointer or an array type cannot point to the private address space. }]; } + +def NullabilityDocs : DocumentationCategory<"Nullability Attributes"> { + let Content = [{ +Whether a particular pointer may be "null" is an important concern when working with pointers in the C family of languages. The various nullability attributes indicate whether a particular pointer can be null or not, which makes APIs more expressive and can help static analysis tools identify bugs involving null pointers. Clang supports several kinds of nullability attributes: the ``nonnull`` and ``returns_nonnull`` attributes indicate which function or method parameters and result types can never be null, while nullability type qualifiers indicate which pointer types can be null (``_Nullable``) or cannot be null (``_Nonnull``). + +The nullability (type) qualifiers express whether a value of a given pointer type can be null (the ``_Nullable`` qualifier), doesn't have a defined meaning for null (the ``_Nonnull`` qualifier), or for which the purpose of null is unclear (the ``_Null_unspecified`` qualifier). Because nullability qualifiers are expressed within the type system, they are more general than the ``nonnull`` and ``returns_nonnull`` attributes, allowing one to express (for example) a nullable pointer to an array of nonnull pointers. Nullability qualifiers are written to the right of the pointer to which they apply. For example: + + .. code-block:: c + + // No meaningful result when 'ptr' is null (here, it happens to be undefined behavior). + int fetch(int * _Nonnull ptr) { return *ptr; } + + // 'ptr' may be null. + int fetch_or_zero(int * _Nullable ptr) { + return ptr ? *ptr : 0; + } + + // A nullable pointer to non-null pointers to const characters. + const char *join_strings(const char * _Nonnull * _Nullable strings, unsigned n); + +In Objective-C, there is an alternate spelling for the nullability qualifiers that can be used in Objective-C methods and properties using context-sensitive, non-underscored keywords. For example: + + .. code-block:: objective-c + + @interface NSView : NSResponder + - (nullable NSView *)ancestorSharedWithView:(nonnull NSView *)aView; + @property (assign, nullable) NSView *superview; + @property (readonly, nonnull) NSArray *subviews; + @end + }]; +} + +def TypeNonNullDocs : Documentation { + let Category = NullabilityDocs; + let Heading = "_Nonnull"; + let Content = [{ +The ``_Nonnull`` nullability qualifier indicates that null is not a meaningful value for a value of the ``_Nonnull`` pointer type. For example, given a declaration such as: + + .. code-block:: c + + int fetch(int * _Nonnull ptr); + +a caller of ``fetch`` should not provide a null value, and the compiler will produce a warning if it sees a literal null value passed to ``fetch``. Note that, unlike the declaration attribute ``nonnull``, the presence of ``_Nonnull`` does not imply that passing null is undefined behavior: ``fetch`` is free to consider null undefined behavior or (perhaps for backward-compatibility reasons) defensively handle null. + }]; +} + +def TypeNullableDocs : Documentation { + let Category = NullabilityDocs; + let Heading = "_Nullable"; + let Content = [{ +The ``_Nullable`` nullability qualifier indicates that a value of the ``_Nullable`` pointer type can be null. For example, given: + + .. code-block:: c + + int fetch_or_zero(int * _Nullable ptr); + +a caller of ``fetch_or_zero`` can provide null. + }]; +} + +def TypeNullUnspecifiedDocs : Documentation { + let Category = NullabilityDocs; + let Heading = "_Null_unspecified"; + let Content = [{ +The ``_Null_unspecified`` nullability qualifier indicates that neither the ``_Nonnull`` nor ``_Nullable`` qualifiers make sense for a particular pointer type. It is used primarily to indicate that the role of null with specific pointers in a nullability-annotated header is unclear, e.g., due to overly-complex implementations or historical factors with a long-lived API. + }]; +} + +def NonNullDocs : Documentation { + let Category = NullabilityDocs; + let Heading = "nonnull"; + let Content = [{ +The ``nonnull`` attribute indicates that some function parameters must not be null, and can be used in several different ways. It's original usage (`from GCC <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>`_) is as a function (or Objective-C method) attribute that specifies which parameters of the function are nonnull in a comma-separated list. For example: + + .. code-block:: c + + extern void * my_memcpy (void *dest, const void *src, size_t len) + __attribute__((nonnull (1, 2))); + +Here, the ``nonnull`` attribute indicates that parameters 1 and 2 +cannot have a null value. Omitting the parenthesized list of parameter indices means that all parameters of pointer type cannot be null: + + .. code-block:: c + + extern void * my_memcpy (void *dest, const void *src, size_t len) + __attribute__((nonnull)); + +Clang also allows the ``nonnull`` attribute to be placed directly on a function (or Objective-C method) parameter, eliminating the need to specify the parameter index ahead of type. For example: + + .. code-block:: c + + extern void * my_memcpy (void *dest __attribute__((nonnull)), + const void *src __attribute__((nonnull)), size_t len); + +Note that the ``nonnull`` attribute indicates that passing null to a non-null parameter is undefined behavior, which the optimizer may take advantage of to, e.g., remove null checks. The ``_Nonnull`` type qualifier indicates that a pointer cannot be null in a more general manner (because it is part of the type system) and does not imply undefined behavior, making it more widely applicable. + }]; +} + +def ReturnsNonNullDocs : Documentation { + let Category = NullabilityDocs; + let Heading = "returns_nonnull"; + let Content = [{ +The ``returns_nonnull`` attribute indicates that a particular function (or Objective-C method) always returns a non-null pointer. For example, a particular system ``malloc`` might be defined to terminate a process when memory is not available rather than returning a null pointer: + + .. code-block:: c + + extern void * malloc (size_t size) __attribute__((returns_nonnull)); + +The ``returns_nonnull`` attribute implies that returning a null pointer is undefined behavior, which the optimizer may take advantage of. The ``_Nonnull`` type qualifier indicates that a pointer cannot be null in a more general manner (because it is part of the type system) and does not imply undefined behavior, making it more widely applicable +}]; +} diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def index 0610d47f8ba1..c9cdb4b675bc 100644 --- a/include/clang/Basic/BuiltinsARM.def +++ b/include/clang/Basic/BuiltinsARM.def @@ -105,10 +105,10 @@ LANGBUILTIN(__dmb, "vUi", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__dsb, "vUi", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__isb, "vUi", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__ldrexd, "WiWiCD*", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveFromCoprocessor, "UiUiUiUiUiUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveFromCoprocessor2, "UiUiUiUiUiUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveToCoprocessor, "vUiUiUiUiUiUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveToCoprocessor2, "vUiUiUiUiUiUi", "", ALL_MS_LANGUAGES) +LANGBUILTIN(_MoveFromCoprocessor, "UiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) +LANGBUILTIN(_MoveFromCoprocessor2, "UiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) +LANGBUILTIN(_MoveToCoprocessor, "vUiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) +LANGBUILTIN(_MoveToCoprocessor2, "vUiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) #undef BUILTIN #undef LANGBUILTIN diff --git a/include/clang/Basic/BuiltinsNVPTX.def b/include/clang/Basic/BuiltinsNVPTX.def index 9c920dce5cab..970f55fe223c 100644 --- a/include/clang/Basic/BuiltinsNVPTX.def +++ b/include/clang/Basic/BuiltinsNVPTX.def @@ -501,7 +501,7 @@ BUILTIN(__nvvm_atom_min_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_min_gen_ui, "UiUiD*Ui", "n") BUILTIN(__nvvm_atom_min_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_min_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_min_gen_l, "LiLi10D*Li", "n") +BUILTIN(__nvvm_atom_min_gen_l, "LiLiD*Li", "n") BUILTIN(__nvvm_atom_min_g_ul, "ULiULiD*1ULi", "n") BUILTIN(__nvvm_atom_min_s_ul, "ULiULiD*3ULi", "n") BUILTIN(__nvvm_atom_min_gen_ul, "ULiULiD*ULi", "n") diff --git a/include/clang/Basic/BuiltinsPPC.def b/include/clang/Basic/BuiltinsPPC.def index 6f3bea887f59..02e52947ed6c 100644 --- a/include/clang/Basic/BuiltinsPPC.def +++ b/include/clang/Basic/BuiltinsPPC.def @@ -267,6 +267,18 @@ BUILTIN(__builtin_vsx_xsmindp, "ddd", "") BUILTIN(__builtin_vsx_xvdivdp, "V2dV2dV2d", "") BUILTIN(__builtin_vsx_xvdivsp, "V4fV4fV4f", "") +BUILTIN(__builtin_vsx_xvrdpip, "V2dV2d", "") +BUILTIN(__builtin_vsx_xvrspip, "V4fV4f", "") + +BUILTIN(__builtin_vsx_xvcmpeqdp, "V2ULLiV2dV2d", "") +BUILTIN(__builtin_vsx_xvcmpeqsp, "V4UiV4fV4f", "") + +BUILTIN(__builtin_vsx_xvcmpgedp, "V2ULLiV2dV2d", "") +BUILTIN(__builtin_vsx_xvcmpgesp, "V4UiV4fV4f", "") + +BUILTIN(__builtin_vsx_xvcmpgtdp, "V2ULLiV2dV2d", "") +BUILTIN(__builtin_vsx_xvcmpgtsp, "V4UiV4fV4f", "") + // HTM builtins BUILTIN(__builtin_tbegin, "UiUIi", "") BUILTIN(__builtin_tend, "UiUIi", "") diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 00c1340ac37f..aaf279f3713f 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -24,6 +24,11 @@ // FIXME: Are these nothrow/const? +// Miscellaneous builtin for checking x86 cpu features. +// TODO: Make this somewhat generic so that other backends +// can use it? +BUILTIN(__builtin_cpu_supports, "bcC*", "nc") + // 3DNow! // BUILTIN(__builtin_ia32_femms, "v", "") @@ -651,6 +656,12 @@ BUILTIN(__builtin_ia32_wrfsbase64, "vULLi", "") BUILTIN(__builtin_ia32_wrgsbase32, "vUi", "") BUILTIN(__builtin_ia32_wrgsbase64, "vULLi", "") +// FXSR +BUILTIN(__builtin_ia32_fxrstor, "vv*", "") +BUILTIN(__builtin_ia32_fxrstor64, "vv*", "") +BUILTIN(__builtin_ia32_fxsave, "vv*", "") +BUILTIN(__builtin_ia32_fxsave64, "vv*", "") + // ADX BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "") BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "") @@ -722,12 +733,72 @@ BUILTIN(__builtin_ia32_vfmaddsubps256, "V8fV8fV8fV8f", "") BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "") BUILTIN(__builtin_ia32_vfmsubaddps256, "V8fV8fV8fV8f", "") BUILTIN(__builtin_ia32_vfmsubaddpd256, "V4dV4dV4dV4d", "") -BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "") -BUILTIN(__builtin_ia32_vfmsubpd512_mask, "V8dV8dV8dV8dUcIi", "") -BUILTIN(__builtin_ia32_vfnmaddpd512_mask, "V8dV8dV8dV8dUcIi", "") -BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "") -BUILTIN(__builtin_ia32_vfmsubps512_mask, "V16fV16fV16fV16fUsIi", "") -BUILTIN(__builtin_ia32_vfnmaddps512_mask, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddpd128_mask, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd128_mask3, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd128_maskz, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd256_mask, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd256_mask3, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd256_maskz, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddps128_mask, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddps128_mask3, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddps128_maskz, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddps256_mask, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddps256_mask3, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddps256_maskz, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddsubpd128_mask, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd128_mask3, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd128_maskz, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd256_mask, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd256_mask3, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd256_maskz, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmaddsubps128_mask, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps128_mask3, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps128_maskz, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps256_mask, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps256_mask3, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps256_maskz, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmsubpd128_mask3, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmsubpd256_mask3, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmsubps128_mask3, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmsubps256_mask3, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfmsubaddpd128_mask3, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfmsubaddpd256_mask3, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfmsubaddps128_mask3, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfmsubaddps256_mask3, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfnmaddpd128_mask, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfnmaddpd256_mask, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfnmaddpd512_mask, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfnmaddps128_mask, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfnmaddps256_mask, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfnmaddps512_mask, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfnmsubpd128_mask, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfnmsubpd128_mask3, "V2dV2dV2dV2dUc", "") +BUILTIN(__builtin_ia32_vfnmsubpd256_mask, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfnmsubpd256_mask3, "V4dV4dV4dV4dUc", "") +BUILTIN(__builtin_ia32_vfnmsubpd512_mask, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfnmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "") +BUILTIN(__builtin_ia32_vfnmsubps128_mask, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfnmsubps128_mask3, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_vfnmsubps256_mask, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfnmsubps256_mask3, "V8fV8fV8fV8fUc", "") +BUILTIN(__builtin_ia32_vfnmsubps512_mask, "V16fV16fV16fV16fUsIi", "") +BUILTIN(__builtin_ia32_vfnmsubps512_mask3, "V16fV16fV16fV16fUsIi", "") // XOP BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "") @@ -1052,5 +1123,39 @@ BUILTIN(__builtin_ia32_orpd256_mask, "V4dV4dV4dV4dUc", "") BUILTIN(__builtin_ia32_orpd128_mask, "V2dV2dV2dV2dUc", "") BUILTIN(__builtin_ia32_orps256_mask, "V8fV8fV8fV8fUc", "") BUILTIN(__builtin_ia32_orps128_mask, "V4fV4fV4fV4fUc", "") +BUILTIN(__builtin_ia32_blendmb_512_mask, "V64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_blendmw_512_mask, "V32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pabsb512_mask, "V64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pabsw512_mask, "V32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_packssdw512_mask, "V32sV16iV16iV32sUi", "") +BUILTIN(__builtin_ia32_packsswb512_mask, "V64cV32sV32sV64cULLi", "") +BUILTIN(__builtin_ia32_packusdw512_mask, "V32sV16iV16iV32sUi", "") +BUILTIN(__builtin_ia32_packuswb512_mask, "V64cV32sV32sV64cULLi", "") +BUILTIN(__builtin_ia32_paddsb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_paddsw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_paddusb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_paddusw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pavgb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pavgw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pmaxsb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pmaxsw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pmaxub512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pmaxuw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pminsb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pminsw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pminub512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_pminuw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_pshufb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_psubsb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_psubsw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_psubusb512_mask, "V64cV64cV64cV64cULLi", "") +BUILTIN(__builtin_ia32_psubusw512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_vpermi2varhi512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_vpermt2varhi512_mask, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_vpermt2varhi512_maskz, "V32sV32sV32sV32sUi", "") +BUILTIN(__builtin_ia32_vpconflictdi_512_mask, "V8LLiV8LLiV8LLiUc", "") +BUILTIN(__builtin_ia32_vpconflictsi_512_mask, "V16iV16iV16iUs", "") +BUILTIN(__builtin_ia32_vplzcntd_512_mask, "V16iV16iV16iUs", "") +BUILTIN(__builtin_ia32_vplzcntq_512_mask, "V8LLiV8LLiV8LLiUc", "") #undef BUILTIN diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 0f3831d6007e..3b7c282d37ad 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -18,6 +18,7 @@ #include "clang/Basic/DiagnosticIDs.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/SourceLocation.h" +#include "clang/Basic/Specifiers.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" @@ -1107,6 +1108,13 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, return DB; } +/// A nullability kind paired with a bit indicating whether it used a +/// context-sensitive keyword. +typedef std::pair<NullabilityKind, bool> DiagNullabilityKind; + +const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, + DiagNullabilityKind nullability); + inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc, unsigned DiagID) { assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 82718d9255f3..24813c67c2f5 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -102,31 +102,21 @@ def err_enum_template : Error<"enumeration cannot be a template">; let CategoryName = "Nullability Issue" in { def warn_nullability_duplicate : Warning< - "duplicate nullability specifier " - "'%select{__|}1%select{nonnull|nullable|null_unspecified}0'">, + "duplicate nullability specifier %0">, InGroup<Nullability>; def warn_conflicting_nullability_attr_overriding_ret_types : Warning< - "conflicting nullability specifier on return types, " - "'%select{%select{__|}1nonnull|" - "%select{__|}1nullable|%select{__|}1null_unspecified}0' " - "conflicts with existing specifier '%select{%select{__|}3nonnull|" - "%select{__|}3nullable|%select{__|}3null_unspecified}2'">, + "conflicting nullability specifier on return types, %0 " + "conflicts with existing specifier %1">, InGroup<Nullability>; def warn_conflicting_nullability_attr_overriding_param_types : Warning< - "conflicting nullability specifier on parameter types, " - "'%select{%select{__|}1nonnull|" - "%select{__|}1nullable|%select{__|}1null_unspecified}0' " - "conflicts with existing specifier '%select{%select{__|}3nonnull|" - "%select{__|}3nullable|%select{__|}3null_unspecified}2'">, + "conflicting nullability specifier on parameter types, %0 " + "conflicts with existing specifier %1">, InGroup<Nullability>; def err_nullability_conflicting : Error< - "nullability specifier " - "'%select{__|}1%select{nonnull|nullable|null_unspecified}0' conflicts with " - "existing specifier '%select{__|}3%select{nonnull|nullable|" - "null_unspecified}2'">; + "nullability specifier %0 conflicts with existing specifier %1">; } diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 803203cc50be..750219483c6c 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -426,6 +426,7 @@ def warn_redecl_library_builtin : Warning< InGroup<DiagGroup<"incompatible-library-redeclaration">>; def err_builtin_definition : Error<"definition of builtin function %0">; def err_arm_invalid_specialreg : Error<"invalid special register for builtin">; +def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">; def warn_builtin_unknown : Warning<"use of unknown builtin %0">, InGroup<ImplicitFunctionDeclare>, DefaultError; def warn_dyn_class_memaccess : Warning< @@ -1050,6 +1051,7 @@ def ext_friend_tag_redecl_outside_namespace : ExtWarn< "unqualified friend declaration referring to type outside of the nearest " "enclosing namespace is a Microsoft extension; add a nested name specifier">, InGroup<Microsoft>; +def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">; def err_invalid_member_in_interface : Error< "%select{data member |non-public member function |static member function |" @@ -1262,6 +1264,8 @@ def ext_mutable_reference : ExtWarn< def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">; def err_mutable_nonmember : Error< "'mutable' can only be applied to member variables">; +def err_virtual_in_union : Error< + "unions cannot have virtual functions">; def err_virtual_non_function : Error< "'virtual' can only appear on non-static member functions">; def err_virtual_out_of_class : Error< @@ -2081,12 +2085,16 @@ def err_attr_objc_ownership_redundant : Error< "the type %0 is already explicitly ownership-qualified">; def err_undeclared_nsnumber : Error< "NSNumber must be available to use Objective-C literals">; +def err_undeclared_nsvalue : Error< + "NSValue must be available to use Objective-C boxed expressions">; def err_invalid_nsnumber_type : Error< "%0 is not a valid literal type for NSNumber">; def err_undeclared_nsstring : Error< "cannot box a string value because NSString has not been declared">; def err_objc_illegal_boxed_expression_type : Error< "illegal type %0 used in a boxed expression">; +def err_objc_non_trivially_copyable_boxed_expression_type : Error< + "non-trivially copyable type %0 cannot be used in a boxed expression">; def err_objc_incomplete_boxed_expression_type : Error< "incomplete type %0 used in a boxed expression">; def err_undeclared_nsarray : Error< @@ -2190,7 +2198,7 @@ def err_attribute_invalid_on_stmt : Error< "%0 attribute cannot be applied to a statement">; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after " - "\"%select{class|struct|union|interface|enum}1\" to apply attribute to " + "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " "type declaration">, InGroup<IgnoredAttributes>; def warn_attribute_precede_definition : Warning< "attribute declaration must precede definition">, @@ -4690,13 +4698,15 @@ def ext_sizeof_alignof_void_type : Extension< "invalid application of '%select{sizeof|alignof|vec_step}0' to a void " "type">, InGroup<PointerArith>; def err_opencl_sizeof_alignof_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step}0' to a void type">; + "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">; def err_sizeof_alignof_incomplete_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step}0' to an " + "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an " "incomplete type %1">; def err_sizeof_alignof_function_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step}0' to a " + "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a " "function type">; +def err_openmp_default_simd_align_expr : Error< + "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">; def err_sizeof_alignof_bitfield : Error< "invalid application of '%select{sizeof|alignof}0' to bit-field">; def err_alignof_member_of_incomplete_type : Error< @@ -6791,6 +6801,15 @@ def warn_format_non_standard_conversion_spec: Warning< def warn_printf_ignored_flag: Warning< "flag '%0' is ignored when flag '%1' is present">, InGroup<Format>; +def warn_printf_empty_objc_flag: Warning< + "missing object format flag">, + InGroup<Format>; +def warn_printf_ObjCflags_without_ObjCConversion: Warning< + "object format flags cannot be used with '%0' conversion specifier">, + InGroup<Format>; +def warn_printf_invalid_objc_flag: Warning< + "'%0' is not a valid object format flag">, + InGroup<Format>; def warn_scanf_scanlist_incomplete : Warning< "no closing ']' for '%%[' in scanf format string">, InGroup<Format>; @@ -7413,6 +7432,8 @@ def err_omp_unexpected_clause_value : Error< "expected %0 in OpenMP clause '%1'">; def err_omp_expected_var_name : Error< "expected variable name">; +def err_omp_expected_var_name_or_array_item : Error< + "expected variable name, array element or array section">; def note_omp_task_predetermined_firstprivate_here : Note< "predetermined as a firstprivate in a task construct here">; def err_omp_clause_ref_type_arg : Error< @@ -7601,6 +7622,12 @@ def err_omp_single_copyprivate_with_nowait : Error< "the 'copyprivate' clause must not be used with the 'nowait' clause">; def note_omp_nowait_clause_here : Note< "'nowait' clause is here">; +def err_omp_wrong_cancel_region : Error< + "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">; +def err_omp_parent_cancel_region_nowait : Error< + "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">; +def err_omp_parent_cancel_region_ordered : Error< + "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { @@ -7677,28 +7704,21 @@ def warn_profile_data_unprofiled : Warning< let CategoryName = "Nullability Issue" in { def warn_mismatched_nullability_attr : Warning< - "nullability specifier " - "'%select{__|}1%select{nonnull|nullable|null_unspecified}0' " - "conflicts with existing specifier " - "'%select{__|}3%select{nonnull|nullable|null_unspecified}2'">, + "nullability specifier %0 conflicts with existing specifier %1">, InGroup<Nullability>; def warn_nullability_declspec : Warning< - "nullability specifier " - "'%select{__nonnull|__nullable|__null_unspecified}0' cannot be applied " + "nullability specifier %0 cannot be applied " "to non-pointer type %1; did you mean to apply the specifier to the " "%select{pointer|block pointer|member pointer|function pointer|" "member function pointer}2?">, InGroup<NullabilityDeclSpec>, DefaultError; -def note_nullability_here : Note< - "'%select{__nonnull|__nullable|__null_unspecified}0' specified here">; +def note_nullability_here : Note<"%0 specified here">; def err_nullability_nonpointer : Error< - "nullability specifier " - "'%select{__|}1%select{nonnull|nullable|null_unspecified}0' cannot be applied " - "to non-pointer type %2">; + "nullability specifier %0 cannot be applied to non-pointer type %1">; def warn_nullability_lost : Warning< "implicit conversion from nullable pointer %0 to non-nullable pointer " @@ -7706,12 +7726,9 @@ def warn_nullability_lost : Warning< InGroup<NullableToNonNullConversion>, DefaultIgnore; def err_nullability_cs_multilevel : Error< - "nullability keyword " - "'%select{nonnull|nullable|null_unspecified}0' cannot be applied to " - "multi-level pointer type %1">; + "nullability keyword %0 cannot be applied to multi-level pointer type %1">; def note_nullability_type_specifier : Note< - "use nullability type specifier " - "'%select{__nonnull|__nullable|__null_unspecified}0' to affect the innermost " + "use nullability type specifier %0 to affect the innermost " "pointer type of %1">; def warn_null_resettable_setter : Warning< @@ -7720,7 +7737,7 @@ def warn_null_resettable_setter : Warning< def warn_nullability_missing : Warning< "%select{pointer|block pointer|member pointer}0 is missing a nullability " - "type specifier (__nonnull, __nullable, or __null_unspecified)">, + "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">, InGroup<NullabilityCompleteness>; } diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index bc586e41f854..33a8b747c62d 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -406,19 +406,6 @@ public: virtual IdentifierIterator *getIdentifiers(); }; -/// \brief An abstract class used to resolve numerical identifier -/// references (meaningful only to some external source) into -/// IdentifierInfo pointers. -class ExternalIdentifierLookup { -public: - virtual ~ExternalIdentifierLookup(); - - /// \brief Return the identifier associated with the given ID number. - /// - /// The ID 0 is associated with the NULL identifier. - virtual IdentifierInfo *GetIdentifier(unsigned ID) = 0; -}; - /// \brief Implements an efficient mapping from strings to IdentifierInfo nodes. /// /// This has no other purpose, but this is an extremely performance-critical diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def index bef122f093c4..b27605b15d28 100644 --- a/include/clang/Basic/LangOptions.def +++ b/include/clang/Basic/LangOptions.def @@ -130,6 +130,7 @@ COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "require declaration of module us BENIGN_LANGOPT(ModulesErrorRecovery, 1, 1, "automatically import modules as needed when performing error recovery") BENIGN_LANGOPT(ImplicitModules, 1, 1, "build modules that are not specified via -fmodule-file") COMPATIBLE_LANGOPT(ModulesLocalVisibility, 1, 0, "local submodule visibility") +COMPATIBLE_LANGOPT(ModulesHideInternalLinkage, 1, 1, "hiding non-visible internal linkage declarations from redeclaration lookup") COMPATIBLE_LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro") COMPATIBLE_LANGOPT(OptimizeSize , 1, 0, "__OPTIMIZE_SIZE__ predefined macro") LANGOPT(Static , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)") diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 84836eb4e5c3..3c9d23efe63b 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -102,6 +102,8 @@ public: /// \brief The names of any features to enable in module 'requires' decls /// in addition to the hard-coded list in Module.cpp and the target features. + /// + /// This list is sorted. std::vector<std::string> ModuleFeatures; /// \brief Options for parsing comments. diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index 747061074038..1bc89257d384 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -66,6 +66,9 @@ public: /// \brief The umbrella header or directory. llvm::PointerUnion<const DirectoryEntry *, const FileEntry *> Umbrella; + /// \brief The module signature. + uint64_t Signature; + /// \brief The name of the umbrella entry, as written in the module map. std::string UmbrellaAsWritten; diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index b09f012c4317..67a5068cc2cb 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -69,6 +69,9 @@ #ifndef OPENMP_SCHEDULE_KIND #define OPENMP_SCHEDULE_KIND(Name) #endif +#ifndef OPENMP_DEPEND_KIND +#define OPENMP_DEPEND_KIND(Name) +#endif // OpenMP directives. OPENMP_DIRECTIVE(threadprivate) @@ -90,10 +93,12 @@ OPENMP_DIRECTIVE(ordered) OPENMP_DIRECTIVE(atomic) OPENMP_DIRECTIVE(target) OPENMP_DIRECTIVE(teams) +OPENMP_DIRECTIVE(cancel) OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for") OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd") OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections") OPENMP_DIRECTIVE_EXT(for_simd, "for simd") +OPENMP_DIRECTIVE_EXT(cancellation_point, "cancellation point") // OpenMP clauses. OPENMP_CLAUSE(if, OMPIfClause) @@ -123,6 +128,7 @@ OPENMP_CLAUSE(write, OMPWriteClause) OPENMP_CLAUSE(update, OMPUpdateClause) OPENMP_CLAUSE(capture, OMPCaptureClause) OPENMP_CLAUSE(seq_cst, OMPSeqCstClause) +OPENMP_CLAUSE(depend, OMPDependClause) // Clauses allowed for OpenMP directive 'parallel'. OPENMP_PARALLEL_CLAUSE(if) @@ -195,6 +201,11 @@ OPENMP_SCHEDULE_KIND(guided) OPENMP_SCHEDULE_KIND(auto) OPENMP_SCHEDULE_KIND(runtime) +// Static attributes for 'depend' clause. +OPENMP_DEPEND_KIND(in) +OPENMP_DEPEND_KIND(out) +OPENMP_DEPEND_KIND(inout) + // Clauses allowed for OpenMP directive 'parallel for'. OPENMP_PARALLEL_FOR_CLAUSE(if) OPENMP_PARALLEL_FOR_CLAUSE(num_threads) @@ -248,6 +259,7 @@ OPENMP_TASK_CLAUSE(firstprivate) OPENMP_TASK_CLAUSE(shared) OPENMP_TASK_CLAUSE(untied) OPENMP_TASK_CLAUSE(mergeable) +OPENMP_TASK_CLAUSE(depend) // Clauses allowed for OpenMP directive 'atomic'. OPENMP_ATOMIC_CLAUSE(read) @@ -268,6 +280,7 @@ OPENMP_TEAMS_CLAUSE(firstprivate) OPENMP_TEAMS_CLAUSE(shared) OPENMP_TEAMS_CLAUSE(reduction) +#undef OPENMP_DEPEND_KIND #undef OPENMP_SCHEDULE_KIND #undef OPENMP_PROC_BIND_KIND #undef OPENMP_DEFAULT_KIND diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index e2f115113e20..83939bb079a8 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -62,6 +62,14 @@ enum OpenMPScheduleClauseKind { OMPC_SCHEDULE_unknown }; +/// \brief OpenMP attributes for 'depend' clause. +enum OpenMPDependClauseKind { +#define OPENMP_DEPEND_KIND(Name) \ + OMPC_DEPEND_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_DEPEND_unknown +}; + OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str); const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind); diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h index 5ce56c0ee1f8..d95a77f88e97 100644 --- a/include/clang/Basic/Specifiers.h +++ b/include/clang/Basic/Specifiers.h @@ -257,7 +257,8 @@ namespace clang { }; /// Retrieve the spelling of the given nullability kind. - llvm::StringRef getNullabilitySpelling(NullabilityKind kind); + llvm::StringRef getNullabilitySpelling(NullabilityKind kind, + bool isContextSensitive = false); } // end namespace clang #endif // LLVM_CLANG_BASIC_SPECIFIERS_H diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index 675e91d866d0..9d7b6fb0cbe2 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -205,3 +205,5 @@ def OMPOrderedDirective : DStmt<OMPExecutableDirective>; def OMPAtomicDirective : DStmt<OMPExecutableDirective>; def OMPTargetDirective : DStmt<OMPExecutableDirective>; def OMPTeamsDirective : DStmt<OMPExecutableDirective>; +def OMPCancellationPointDirective : DStmt<OMPExecutableDirective>; +def OMPCancelDirective : DStmt<OMPExecutableDirective>; diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index e415733189ab..a3bb535fa26f 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -70,6 +70,7 @@ protected: unsigned char MinGlobalAlign; unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth; unsigned short MaxVectorAlign; + unsigned short SimdDefaultAlign; const char *DescriptionString; const char *UserLabelPrefix; const char *MCountName; @@ -393,6 +394,10 @@ public: /// \brief Return the maximum vector alignment supported for the given target. unsigned getMaxVectorAlign() const { return MaxVectorAlign; } + /// \brief Return default simd alignment for the given target. Generally, this + /// value is type-specific, but this alignment can be used for most of the + /// types for the given target. + unsigned getSimdDefaultAlign() const { return SimdDefaultAlign; } /// \brief Return the size of intmax_t and uintmax_t for this target, in bits. unsigned getIntMaxTWidth() const { @@ -611,6 +616,9 @@ public: } }; + // Validate the contents of the __builtin_cpu_supports(const char*) argument. + virtual bool validateCpuSupports(StringRef Name) const { return false; } + // validateOutputConstraint, validateInputConstraint - Checks that // a constraint is valid and provides information about it. // FIXME: These should return a real error instead of just true/false. diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 67b9933562eb..ed2aa82d17e1 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -503,6 +503,9 @@ ALIAS("read_write", __read_write , KEYOPENCL) KEYWORD(__builtin_astype , KEYOPENCL) KEYWORD(vec_step , KEYOPENCL|KEYALTIVEC) +// OpenMP Type Traits +KEYWORD(__builtin_omp_required_simd_align, KEYALL) + // Borland Extensions. KEYWORD(__pascal , KEYALL) @@ -549,9 +552,9 @@ ALIAS("__volatile" , volatile , KEYALL) ALIAS("__volatile__" , volatile , KEYALL) // Type nullability. -KEYWORD(__nonnull , KEYALL) -KEYWORD(__nullable , KEYALL) -KEYWORD(__null_unspecified , KEYALL) +KEYWORD(_Nonnull , KEYALL) +KEYWORD(_Nullable , KEYALL) +KEYWORD(_Null_unspecified , KEYALL) // Microsoft extensions which should be disabled in strict conformance mode KEYWORD(__ptr64 , KEYMS) diff --git a/include/clang/Basic/TypeTraits.h b/include/clang/Basic/TypeTraits.h index ef84d2b11163..765246b4cc54 100644 --- a/include/clang/Basic/TypeTraits.h +++ b/include/clang/Basic/TypeTraits.h @@ -92,7 +92,8 @@ namespace clang { enum UnaryExprOrTypeTrait { UETT_SizeOf, UETT_AlignOf, - UETT_VecStep + UETT_VecStep, + UETT_OpenMPRequiredSimdAlign, }; } |
