diff options
Diffstat (limited to 'include/clang/Basic')
30 files changed, 744 insertions, 363 deletions
diff --git a/include/clang/Basic/AlignedAllocation.h b/include/clang/Basic/AlignedAllocation.h index 9751f41184..c995f47a7d 100644 --- a/include/clang/Basic/AlignedAllocation.h +++ b/include/clang/Basic/AlignedAllocation.h @@ -27,8 +27,8 @@ inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) { default: break; case llvm::Triple::Darwin: - case llvm::Triple::MacOSX: // Earliest supporting version is 10.13. - return llvm::VersionTuple(10U, 13U); + case llvm::Triple::MacOSX: // Earliest supporting version is 10.14. + return llvm::VersionTuple(10U, 14U); case llvm::Triple::IOS: case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0. return llvm::VersionTuple(11U); diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 04125e67b2..1fe1dd3994 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -300,6 +300,7 @@ def OpenCL : LangOpt<"OpenCL">; def RenderScript : LangOpt<"RenderScript">; def ObjC : LangOpt<"ObjC">; def BlocksSupported : LangOpt<"Blocks">; +def ObjCAutoRefCount : LangOpt<"ObjCAutoRefCount">; // Defines targets for target-specific attributes. Empty lists are unchecked. class TargetSpec { @@ -840,13 +841,25 @@ def OSConsumed : InheritableParamAttr { def OSReturnsRetained : InheritableAttr { let Spellings = [Clang<"os_returns_retained">]; - let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty]>; + let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty, ParmVar]>; let Documentation = [RetainBehaviorDocs]; } def OSReturnsNotRetained : InheritableAttr { let Spellings = [Clang<"os_returns_not_retained">]; - let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty]>; + let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty, ParmVar]>; + let Documentation = [RetainBehaviorDocs]; +} + +def OSReturnsRetainedOnZero : InheritableAttr { + let Spellings = [Clang<"os_returns_retained_on_zero">]; + let Subjects = SubjectList<[ParmVar]>; + let Documentation = [RetainBehaviorDocs]; +} + +def OSReturnsRetainedOnNonZero : InheritableAttr { + let Spellings = [Clang<"os_returns_retained_on_non_zero">]; + let Subjects = SubjectList<[ParmVar]>; let Documentation = [RetainBehaviorDocs]; } @@ -2867,7 +2880,9 @@ def LoopHint : Attr { /// unroll_count: unrolls loop 'Value' times. /// unroll_and_jam: attempt to unroll and jam loop if State == Enable. /// unroll_and_jam_count: unroll and jams loop 'Value' times. - /// distribute: attempt to distribute loop if State == Enable + /// distribute: attempt to distribute loop if State == Enable. + /// pipeline: disable pipelining loop if State == Disable. + /// pipeline_initiation_interval: create loop schedule with initiation interval equal to 'Value'. /// #pragma unroll <argument> directive /// <no arg>: fully unrolls loop. @@ -2882,10 +2897,10 @@ def LoopHint : Attr { let Args = [EnumArgument<"Option", "OptionType", ["vectorize", "vectorize_width", "interleave", "interleave_count", "unroll", "unroll_count", "unroll_and_jam", "unroll_and_jam_count", - "distribute"], + "pipeline", "pipeline_initiation_interval", "distribute"], ["Vectorize", "VectorizeWidth", "Interleave", "InterleaveCount", "Unroll", "UnrollCount", "UnrollAndJam", "UnrollAndJamCount", - "Distribute"]>, + "PipelineDisabled", "PipelineInitiationInterval", "Distribute"]>, EnumArgument<"State", "LoopHintState", ["enable", "disable", "numeric", "assume_safety", "full"], ["Enable", "Disable", "Numeric", "AssumeSafety", "Full"]>, @@ -2902,6 +2917,8 @@ def LoopHint : Attr { case UnrollCount: return "unroll_count"; case UnrollAndJam: return "unroll_and_jam"; case UnrollAndJamCount: return "unroll_and_jam_count"; + case PipelineDisabled: return "pipeline"; + case PipelineInitiationInterval: return "pipeline_initiation_interval"; case Distribute: return "distribute"; } llvm_unreachable("Unhandled LoopHint option."); @@ -3131,3 +3148,16 @@ def SpeculativeLoadHardening : InheritableAttr { let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>; let Documentation = [SpeculativeLoadHardeningDocs]; } + +def Uninitialized : InheritableAttr { + let Spellings = [Clang<"uninitialized", 0>]; + let Subjects = SubjectList<[LocalVar]>; + let Documentation = [UninitializedDocs]; +} + +def ObjCExternallyRetained : InheritableAttr { + let LangOpts = [ObjCAutoRefCount]; + let Spellings = [Clang<"objc_externally_retained">]; + let Subjects = SubjectList<[NonParmVar, Function, Block, ObjCMethod]>; + let Documentation = [ObjCExternallyRetainedDocs]; +} diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index e72ef253f0..5773a92c9c 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -554,9 +554,9 @@ certain user-defined criteria. For example: .. code-block:: c - void abs(int a) + int abs(int a) __attribute__((diagnose_if(a >= 0, "Redundant abs call", "warning"))); - void must_abs(int a) + int must_abs(int a) __attribute__((diagnose_if(a >= 0, "Redundant abs call", "error"))); int val = abs(1); // warning: Redundant abs call @@ -888,6 +888,21 @@ Similar to ``__attribute__((ns_consumes_self))``, ``__attribute__((os_consumes_this))`` specifies that the method call consumes the reference to "this" (e.g., when attaching it to a different object supplied as a parameter). +Out parameters (parameters the function is meant to write into, +either via pointers-to-pointers or references-to-pointers) +may be annotated with ``__attribute__((os_returns_retained))`` +or ``__attribute__((os_returns_not_retained))`` which specifies that the object +written into the out parameter should (or respectively should not) be released +after use. +Since often out parameters may or may not be written depending on the exit +code of the function, +annotations ``__attribute__((os_returns_retained_on_zero))`` +and ``__attribute__((os_returns_retained_on_non_zero))`` specify that +an out parameter at ``+1`` is written if and only if the function returns a zero +(respectively non-zero) error code. +Observe that return-code-dependent out parameter annotations are only +available for retained out parameters, as non-retained object do not have to be +released by the callee. These attributes are only used by the Clang Static Analyzer. The family of attributes ``X_returns_X_retained`` can be added to functions, @@ -2578,10 +2593,10 @@ def LoopHintDocs : Documentation { let Heading = "#pragma clang loop"; let Content = [{ The ``#pragma clang loop`` directive allows loop optimization hints to be -specified for the subsequent loop. The directive allows vectorization, -interleaving, and unrolling to be enabled or disabled. Vector width as well -as interleave and unrolling count can be manually specified. See -`language extensions +specified for the subsequent loop. The directive allows pipelining to be +disabled, or vectorization, interleaving, and unrolling to be enabled or disabled. +Vector width, interleave count, unrolling count, and the initiation interval +for pipelining can be explicitly specified. See `language extensions <http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations>`_ for details. }]; @@ -2642,6 +2657,56 @@ for further details including limitations of the unroll hints. }]; } +def PipelineHintDocs : Documentation { + let Category = DocCatStmt; + let Heading = "#pragma clang loop pipeline, #pragma clang loop pipeline_initiation_interval"; + let Content = [{ + Software Pipelining optimization is a technique used to optimize loops by + utilizing instruction-level parallelism. It reorders loop instructions to + overlap iterations. As a result, the next iteration starts before the previous + iteration has finished. The module scheduling technique creates a schedule for + one iteration such that when repeating at regular intervals, no inter-iteration + dependencies are violated. This constant interval(in cycles) between the start + of iterations is called the initiation interval. i.e. The initiation interval + is the number of cycles between two iterations of an unoptimized loop in the + newly created schedule. A new, optimized loop is created such that a single iteration + of the loop executes in the same number of cycles as the initiation interval. + For further details see <https://llvm.org/pubs/2005-06-17-LattnerMSThesis-book.pdf>. + + ``#pragma clang loop pipeline and #pragma loop pipeline_initiation_interval`` + could be used as hints for the software pipelining optimization. The pragma is + placed immediately before a for, while, do-while, or a C++11 range-based for + loop. + + Using ``#pragma clang loop pipeline(disable)`` avoids the software pipelining + optimization. The disable state can only be specified: + + .. code-block:: c++ + + #pragma clang loop pipeline(disable) + for (...) { + ... + } + + Using ``#pragma loop pipeline_initiation_interval`` instructs + the software pipeliner to try the specified initiation interval. + If a schedule was found then the resulting loop iteration would have + the specified cycle count. If a schedule was not found then loop + remains unchanged. The initiation interval must be a positive number + greater than zero: + + .. code-block:: c++ + + #pragma loop pipeline_initiation_interval(10) + for (...) { + ... + } + + }]; +} + + + def OpenCLUnrollHintDocs : Documentation { let Category = DocCatStmt; let Content = [{ @@ -3704,6 +3769,18 @@ invoking clang with -fno-c++-static-destructors. }]; } +def UninitializedDocs : Documentation { + let Category = DocCatVariable; + let Content = [{ +The command-line parameter ``-ftrivial-auto-var-init=*`` can be used to +initialize trivial automatic stack variables. By default, trivial automatic +stack variables are uninitialized. This attribute is used to override the +command-line parameter, forcing variables to remain uninitialized. It has no +semantic meaning in that using uninitialized values is undefined behavior, +it rather documents the programmer's intent. + }]; +} + def GnuInlineDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -3762,3 +3839,31 @@ def SpeculativeLoadHardeningDocs : Documentation { (even after inlining) end up hardened. }]; } + +def ObjCExternallyRetainedDocs : Documentation { + let Category = DocCatVariable; + let Content = [{ +The ``objc_externally_retained`` attribute can be applied to strong local +variables, functions, methods, or blocks to opt into +`externally-retained semantics +<https://clang.llvm.org/docs/AutomaticReferenceCounting.html#externally-retained-variables>`_. + +When applied to the definition of a function, method, or block, every parameter +of the function with implicit strong retainable object pointer type is +considered externally-retained, and becomes ``const``. By explicitly annotating +a parameter with ``__strong``, you can opt back into the default +non-externally-retained behaviour for that parameter. For instance, +``first_param`` is externally-retained below, but not ``second_param``: + +.. code-block:: objc + + __attribute__((objc_externally_retained)) + void f(NSArray *first_param, __strong NSArray *second_param) { + // ... + } + +Likewise, when applied to a strong local variable, that variable becomes +``const`` and is considered externally-retained. + +When compiled without ``-fobjc-arc``, this attribute is ignored. +}]; } diff --git a/include/clang/Basic/BuiltinsAMDGPU.def b/include/clang/Basic/BuiltinsAMDGPU.def index 1ee43cb5ee..a25e45fe3f 100644 --- a/include/clang/Basic/BuiltinsAMDGPU.def +++ b/include/clang/Basic/BuiltinsAMDGPU.def @@ -135,13 +135,13 @@ TARGET_BUILTIN(__builtin_amdgcn_fmed3h, "hhhh", "nc", "gfx9-insts") // Deep learning builtins. //===----------------------------------------------------------------------===// -TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hfIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSiIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUiIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSiIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUiIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSiIb", "nc", "dl-insts") -TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUiIb", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hfIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSiIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUiIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSiIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUiIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSiIb", "nc", "dot-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUiIb", "nc", "dot-insts") //===----------------------------------------------------------------------===// // Special builtins. diff --git a/include/clang/Basic/BuiltinsNios2.def b/include/clang/Basic/BuiltinsNios2.def deleted file mode 100644 index d9697e795c..0000000000 --- a/include/clang/Basic/BuiltinsNios2.def +++ /dev/null @@ -1,70 +0,0 @@ -//===-- BuiltinsNios2.def - Nios2 Builtin function database --------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the Nios2-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -#if defined(BUILTIN) && !defined(TARGET_BUILTIN) -# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) -#endif - -// Nios2 R1 builtins: - -//int __builtin_ldbio(volatile const void *); -BUILTIN(__builtin_ldbio, "ivDC*", "") -//int __builtin_ldbuio(volatile const void *); -BUILTIN(__builtin_ldbuio, "ivDC*", "") -//int __builtin_ldhio(volatile const void *); -BUILTIN(__builtin_ldhio, "ivDC*", "") -//int __builtin_ldhuio(volatile const void *); -BUILTIN(__builtin_ldhuio, "ivDC*", "") -//int __builtin_ldwio(volatile const void *); -BUILTIN(__builtin_ldwio, "ivDC*", "") -//int __builtin_ldwuio(int); -BUILTIN(__builtin_ldwuio, "ii", "") -// int __builtin_rdctl(int); -BUILTIN(__builtin_rdctl, "iIi", "") -// void __builtin_wrctl(int, int); -BUILTIN(__builtin_wrctl, "vIii", "") -// int __builtin_rdprs(int, int); -BUILTIN(__builtin_rdprs, "iii", "") -//void __builtin_stbio(volatile void *, int); -BUILTIN(__builtin_stbio, "vvD*i", "") -//void __builtin_sthio(volatile void *, int); -BUILTIN(__builtin_sthio, "vvD*i", "") -//void __builtin_stwio(volatile void *, int); -BUILTIN(__builtin_stwio, "vvD*i", "") -//void __builtin_sync(void); -BUILTIN(__builtin_sync, "v", "") -// void __builtin_flushd(volatile void *); -BUILTIN(__builtin_flushd, "vvD*", "") -// void __builtin_flushda(volatile void *); -BUILTIN(__builtin_flushda, "vvD*", "") - -// Nios2 R2 builtins: - -// int __builtin_wrpie(int); -TARGET_BUILTIN(__builtin_wrpie, "ii", "", "nios2r2mandatory") -// void __builtin_eni(int); -TARGET_BUILTIN(__builtin_eni, "vi", "", "nios2r2mandatory") -// int __builtin_ldex(volatile const void *); -TARGET_BUILTIN(__builtin_ldex, "ivDC*", "", "nios2r2mandatory") -// int __builtin_stex(volatile void *, int); -TARGET_BUILTIN(__builtin_stex, "ivD*i", "", "nios2r2mandatory") -// int __builtin_ldsex(volatile const void *); -TARGET_BUILTIN(__builtin_ldsex, "ivDC*", "", "nios2r2mpx") -// int __builtin_stsex(volatile void *, int); -TARGET_BUILTIN(__builtin_stsex, "ivDC*i", "", "nios2r2mpx") - -#undef BUILTIN -#undef TARGET_BUILTIN diff --git a/include/clang/Basic/BuiltinsWebAssembly.def b/include/clang/Basic/BuiltinsWebAssembly.def index e1e97fe26a..55931edc5c 100644 --- a/include/clang/Basic/BuiltinsWebAssembly.def +++ b/include/clang/Basic/BuiltinsWebAssembly.def @@ -16,23 +16,25 @@ // The format of this database matches clang/Basic/Builtins.def. +#if defined(BUILTIN) && !defined(TARGET_BUILTIN) +# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) +#endif + // Query the current memory size, and increase the current memory size. // Note that memory.size is not "c" (readnone) because it must be sequenced // with respect to memory.grow calls. BUILTIN(__builtin_wasm_memory_size, "zIi", "n") BUILTIN(__builtin_wasm_memory_grow, "zIiz", "n") -// These are the old names. -BUILTIN(__builtin_wasm_mem_size, "zIi", "n") -BUILTIN(__builtin_wasm_mem_grow, "zIiz", "n") - -// These are the old old names. They also lack the immediate field. -BUILTIN(__builtin_wasm_current_memory, "z", "n") -BUILTIN(__builtin_wasm_grow_memory, "zz", "n") +// Floating point min/max +BUILTIN(__builtin_wasm_min_f32, "fff", "nc") +BUILTIN(__builtin_wasm_max_f32, "fff", "nc") +BUILTIN(__builtin_wasm_min_f64, "ddd", "nc") +BUILTIN(__builtin_wasm_max_f64, "ddd", "nc") // Exception handling builtins. -BUILTIN(__builtin_wasm_throw, "vUiv*", "r") -BUILTIN(__builtin_wasm_rethrow, "v", "r") +TARGET_BUILTIN(__builtin_wasm_throw, "vUiv*", "r", "exception-handling") +TARGET_BUILTIN(__builtin_wasm_rethrow, "v", "r", "exception-handling") // Atomic wait and notify. BUILTIN(__builtin_wasm_atomic_wait_i32, "ii*iLLi", "n") @@ -40,73 +42,68 @@ BUILTIN(__builtin_wasm_atomic_wait_i64, "iLLi*LLiLLi", "n") BUILTIN(__builtin_wasm_atomic_notify, "Uii*Ui", "n") // Saturating fp-to-int conversions -BUILTIN(__builtin_wasm_trunc_saturate_s_i32_f32, "if", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i32_f32, "if", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_s_i32_f64, "id", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i32_f64, "id", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f32, "LLif", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f32, "LLif", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f64, "LLid", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f64, "LLid", "nc") - -// Floating point min/max -BUILTIN(__builtin_wasm_min_f32, "fff", "nc") -BUILTIN(__builtin_wasm_max_f32, "fff", "nc") -BUILTIN(__builtin_wasm_min_f64, "ddd", "nc") -BUILTIN(__builtin_wasm_max_f64, "ddd", "nc") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i32_f32, "if", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i32_f32, "if", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i32_f64, "id", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i32_f64, "id", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f32, "LLif", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f32, "LLif", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f64, "LLid", "nc", "nontrapping-fptoint") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f64, "LLid", "nc", "nontrapping-fptoint") // SIMD builtins -BUILTIN(__builtin_wasm_extract_lane_s_i8x16, "iV16cIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_u_i8x16, "iV16cIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_s_i16x8, "iV8sIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_u_i16x8, "iV8sIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_i32x4, "iV4iIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_i64x2, "LLiV2LLiIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_f32x4, "fV4fIi", "nc") -BUILTIN(__builtin_wasm_extract_lane_f64x2, "dV2dIi", "nc") - -BUILTIN(__builtin_wasm_replace_lane_i8x16, "V16cV16cIii", "nc") -BUILTIN(__builtin_wasm_replace_lane_i16x8, "V8sV8sIii", "nc") -BUILTIN(__builtin_wasm_replace_lane_i32x4, "V4iV4iIii", "nc") -BUILTIN(__builtin_wasm_replace_lane_i64x2, "V2LLiV2LLiIiLLi", "nc") -BUILTIN(__builtin_wasm_replace_lane_f32x4, "V4fV4fIif", "nc") -BUILTIN(__builtin_wasm_replace_lane_f64x2, "V2dV2dIid", "nc") - -BUILTIN(__builtin_wasm_add_saturate_s_i8x16, "V16cV16cV16c", "nc") -BUILTIN(__builtin_wasm_add_saturate_u_i8x16, "V16cV16cV16c", "nc") -BUILTIN(__builtin_wasm_add_saturate_s_i16x8, "V8sV8sV8s", "nc") -BUILTIN(__builtin_wasm_add_saturate_u_i16x8, "V8sV8sV8s", "nc") - -BUILTIN(__builtin_wasm_sub_saturate_s_i8x16, "V16cV16cV16c", "nc") -BUILTIN(__builtin_wasm_sub_saturate_u_i8x16, "V16cV16cV16c", "nc") -BUILTIN(__builtin_wasm_sub_saturate_s_i16x8, "V8sV8sV8s", "nc") -BUILTIN(__builtin_wasm_sub_saturate_u_i16x8, "V8sV8sV8s", "nc") - -BUILTIN(__builtin_wasm_bitselect, "V4iV4iV4iV4i", "nc") - -BUILTIN(__builtin_wasm_any_true_i8x16, "iV16c", "nc") -BUILTIN(__builtin_wasm_any_true_i16x8, "iV8s", "nc") -BUILTIN(__builtin_wasm_any_true_i32x4, "iV4i", "nc") -BUILTIN(__builtin_wasm_any_true_i64x2, "iV2LLi", "nc") -BUILTIN(__builtin_wasm_all_true_i8x16, "iV16c", "nc") -BUILTIN(__builtin_wasm_all_true_i16x8, "iV8s", "nc") -BUILTIN(__builtin_wasm_all_true_i32x4, "iV4i", "nc") -BUILTIN(__builtin_wasm_all_true_i64x2, "iV2LLi", "nc") - -BUILTIN(__builtin_wasm_abs_f32x4, "V4fV4f", "nc") -BUILTIN(__builtin_wasm_abs_f64x2, "V2dV2d", "nc") - -BUILTIN(__builtin_wasm_min_f32x4, "V4fV4fV4f", "nc") -BUILTIN(__builtin_wasm_max_f32x4, "V4fV4fV4f", "nc") -BUILTIN(__builtin_wasm_min_f64x2, "V2dV2dV2d", "nc") -BUILTIN(__builtin_wasm_max_f64x2, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_wasm_sqrt_f32x4, "V4fV4f", "nc") -BUILTIN(__builtin_wasm_sqrt_f64x2, "V2dV2d", "nc") - -BUILTIN(__builtin_wasm_trunc_saturate_s_i32x4_f32x4, "V4iV4f", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i32x4_f32x4, "V4iV4f", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_s_i64x2_f64x2, "V2LLiV2d", "nc") -BUILTIN(__builtin_wasm_trunc_saturate_u_i64x2_f64x2, "V2LLiV2d", "nc") +TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i8x16, "iV16cIi", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i8x16, "iV16cIi", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i16x8, "iV8sIi", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i16x8, "iV8sIi", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_i32x4, "iV4iIi", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_i64x2, "LLiV2LLiIi", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_f32x4, "fV4fIi", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_extract_lane_f64x2, "dV2dIi", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_replace_lane_i8x16, "V16cV16cIii", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_replace_lane_i16x8, "V8sV8sIii", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_replace_lane_i32x4, "V4iV4iIii", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_replace_lane_i64x2, "V2LLiV2LLiIiLLi", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_replace_lane_f32x4, "V4fV4fIif", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_replace_lane_f64x2, "V2dV2dIid", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_add_saturate_s_i8x16, "V16cV16cV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i8x16, "V16cV16cV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_add_saturate_s_i16x8, "V8sV8sV8s", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_add_saturate_u_i16x8, "V8sV8sV8s", "nc", "simd128") + +TARGET_BUILTIN(__builtin_wasm_sub_saturate_s_i8x16, "V16cV16cV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i8x16, "V16cV16cV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_sub_saturate_s_i16x8, "V8sV8sV8s", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_sub_saturate_u_i16x8, "V8sV8sV8s", "nc", "simd128") + +TARGET_BUILTIN(__builtin_wasm_bitselect, "V4iV4iV4iV4i", "nc", "simd128") + +TARGET_BUILTIN(__builtin_wasm_any_true_i8x16, "iV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_any_true_i16x8, "iV8s", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_any_true_i32x4, "iV4i", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_any_true_i64x2, "iV2LLi", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_all_true_i8x16, "iV16c", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_all_true_i16x8, "iV8s", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_all_true_i32x4, "iV4i", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_all_true_i64x2, "iV2LLi", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_abs_f32x4, "V4fV4f", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_abs_f64x2, "V2dV2d", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_min_f32x4, "V4fV4fV4f", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_max_f32x4, "V4fV4fV4f", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_min_f64x2, "V2dV2dV2d", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_max_f64x2, "V2dV2dV2d", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_sqrt_f32x4, "V4fV4f", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_sqrt_f64x2, "V2dV2d", "nc", "unimplemented-simd128") + +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i32x4_f32x4, "V4iV4f", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i32x4_f32x4, "V4iV4f", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64x2_f64x2, "V2LLiV2d", "nc", "unimplemented-simd128") +TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64x2_f64x2, "V2LLiV2d", "nc", "unimplemented-simd128") #undef BUILTIN +#undef TARGET_BUILTIN diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index d97ec58916..b3564b957e 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -968,47 +968,47 @@ TARGET_BUILTIN(__builtin_ia32_vpdpwssds128, "V4iV4iV4iV4i", "ncV:128:", "avx512v TARGET_BUILTIN(__builtin_ia32_vpdpwssds256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni") TARGET_BUILTIN(__builtin_ia32_vpdpwssds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2ddC*V2LLiUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2LLiV2LLiLLiC*V2LLiUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4ddC*V4LLiUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4di, "V4LLiV4LLiLLiC*V4LLiUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4sf, "V4fV4ffC*V2LLiUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4si, "V4iV4iiC*V2LLiUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div8sf, "V4fV4ffC*V4LLiUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div8si, "V4iV4iiC*V4LLiUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv2df, "V2dV2ddC*V4iUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv2di, "V2LLiV2LLiLLiC*V4iUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4df, "V4dV4ddC*V4iUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4di, "V4LLiV4LLiLLiC*V4iUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4sf, "V4fV4ffC*V4iUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4si, "V4iV4iiC*V4iUcIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv8sf, "V8fV8ffC*V8iUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv8si, "V8iV8iiC*V8iUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8ddC*V8iUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16ffC*V16fUsIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8ddC*V8LLiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8ffC*V8LLiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8LLiV8LLiLLiC*V8iUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16iiC*V16iUsIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8LLiV8LLiLLiC*V8LLiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8iiC*V8LLiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vd*UcV8iV8dIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vf*UsV16iV16fIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vd*UcV8LLiV8dIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vf*UcV8LLiV8fIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vLLi*UcV8iV8LLiIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vi*UsV16iV16iIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vLLi*UcV8LLiV8LLiIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vi*UcV8LLiV8iIi", "nV:512:", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8iLLiC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16iiC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8LLiLLiC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8LLiiC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iLLi*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16ii*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiLLi*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLii*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2dvC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2LLiV2LLivC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4dvC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4di, "V4LLiV4LLivC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4sf, "V4fV4fvC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4si, "V4iV4ivC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div8sf, "V4fV4fvC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div8si, "V4iV4ivC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv2df, "V2dV2dvC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv2di, "V2LLiV2LLivC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4df, "V4dV4dvC*V4iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4di, "V4LLiV4LLivC*V4iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4sf, "V4fV4fvC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4si, "V4iV4ivC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv8sf, "V8fV8fvC*V8iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv8si, "V8iV8ivC*V8iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8dvC*V8iUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16fvC*V16iUsIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8dvC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8fvC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8LLiV8LLivC*V8iUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16ivC*V16iUsIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8LLiV8LLivC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8ivC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vv*UcV8iV8dIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vv*UsV16iV16fIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vv*UcV8LLiV8dIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vv*UcV8LLiV8fIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vv*UcV8iV8LLiIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vv*UsV16iV16iIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vv*UcV8LLiV8LLiIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vv*UcV8LLiV8iIi", "nV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8ivC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16ivC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8LLivC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8LLivC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iv*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16iv*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiv*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLiv*IiIi", "nV:512:", "avx512pf") TARGET_BUILTIN(__builtin_ia32_knotqi, "UcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "nc", "avx512f") @@ -1210,22 +1210,22 @@ TARGET_BUILTIN(__builtin_ia32_scalefpd256_mask, "V4dV4dV4dV4dUc", "ncV:256:", "a TARGET_BUILTIN(__builtin_ia32_scalefps128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_scalefps256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv2df, "vd*UcV2LLiV2dIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv2di, "vLLi*UcV2LLiV2LLiIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4df, "vd*UcV4LLiV4dIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4di, "vLLi*UcV4LLiV4LLiIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4sf, "vf*UcV2LLiV4fIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4si, "vi*UcV2LLiV4iIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8sf, "vf*UcV4LLiV4fIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8si, "vi*UcV4LLiV4iIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2df, "vd*UcV4iV2dIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2di, "vLLi*UcV4iV2LLiIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4df, "vd*UcV4iV4dIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4di, "vLLi*UcV4iV4LLiIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4sf, "vf*UcV4iV4fIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4si, "vi*UcV4iV4iIi", "nV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vf*UcV8iV8fIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vi*UcV8iV8iIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv2df, "vv*UcV2LLiV2dIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv2di, "vv*UcV2LLiV2LLiIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4df, "vv*UcV4LLiV4dIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4di, "vv*UcV4LLiV4LLiIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4sf, "vv*UcV2LLiV4fIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4si, "vv*UcV2LLiV4iIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8sf, "vv*UcV4LLiV4fIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8si, "vv*UcV4LLiV4iIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv2df, "vv*UcV4iV2dIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv2di, "vv*UcV4iV2LLiIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4df, "vv*UcV4iV4dIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4di, "vv*UcV4iV4LLiIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4sf, "vv*UcV4iV4fIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4si, "vv*UcV4iV4iIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vv*UcV8iV8fIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vv*UcV8iV8iIi", "nV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2vard128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2vard256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl") @@ -1256,43 +1256,25 @@ TARGET_BUILTIN(__builtin_ia32_vpshldw128, "V8sV8sV8sIi", "ncV:128:", "avx512vl,a TARGET_BUILTIN(__builtin_ia32_vpshldw256, "V16sV16sV16sIi", "ncV:256:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd128_mask, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd256_mask, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd512_mask, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw128_mask, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw256_mask, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd128_maskz, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd256_maskz, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd512_maskz, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw128_maskz, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw256_maskz, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw512_maskz, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_mask, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_mask, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_mask, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_mask, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_mask, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_maskz, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_maskz, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_maskz, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_maskz, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_maskz, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_maskz, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq128, "V2LLiV2LLiV2LLiV2LLi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq256, "V4LLiV4LLiV4LLiV4LLi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512, "V8LLiV8LLiV8LLiV8LLi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshrdvd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq128, "V2LLiV2LLiV2LLiV2LLi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq256, "V4LLiV4LLiV4LLiV4LLi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512, "V8LLiV8LLiV8LLiV8LLi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl,avx512vbmi2") @@ -1839,9 +1821,9 @@ TARGET_BUILTIN(__builtin_ia32_cvtsd2ss_round_mask, "V4fV4fV2dV4fUcIi", "ncV:128: TARGET_BUILTIN(__builtin_ia32_cvtsi2ss32, "V4fV4fiIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cvtss2sd_round_mask, "V2dV2dV4fV2dUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, "V16cV16cV16cV16cUs", "ncV:128:", "avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, "V32cV32cV32cV32cUi", "ncV:256:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512, "V64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128, "V16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256, "V32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") // generic select intrinsics TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "ncV:128:", "avx512bw,avx512vl") diff --git a/include/clang/Basic/CodeGenOptions.def b/include/clang/Basic/CodeGenOptions.def index 952aa588b6..ed2387b9a2 100644 --- a/include/clang/Basic/CodeGenOptions.def +++ b/include/clang/Basic/CodeGenOptions.def @@ -116,6 +116,10 @@ CODEGENOPT(PrepareForThinLTO , 1, 0) ///< Set when -flto=thin is enabled on the ///< compile step. CODEGENOPT(LTOUnit, 1, 0) ///< Emit IR to support LTO unit features (CFI, whole ///< program vtable opt). +CODEGENOPT(EnableSplitLTOUnit, 1, 0) ///< Enable LTO unit splitting to support + /// CFI and traditional whole program + /// devirtualization that require whole + /// program IR support. CODEGENOPT(IncrementalLinkerCompatible, 1, 0) ///< Emit an object file which can ///< be used with an incremental ///< linker. diff --git a/include/clang/Basic/CodeGenOptions.h b/include/clang/Basic/CodeGenOptions.h index a12744ee3d..ec6eda7fb7 100644 --- a/include/clang/Basic/CodeGenOptions.h +++ b/include/clang/Basic/CodeGenOptions.h @@ -286,6 +286,8 @@ public: /// Set of XRay instrumentation kinds to emit. XRayInstrSet XRayInstrumentationBundle; + std::vector<std::string> DefaultFunctionAttrs; + public: // Define accessors/mutators for code generation options of enumeration type. #define CODEGENOPT(Name, Bits, Default) diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index d7e1c62890..a516721ace 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -177,6 +177,9 @@ public: /// IdentifierInfo ak_identifierinfo, + /// Qualifiers + ak_qual, + /// QualType ak_qualtype, diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 5a3378c869..34ce489e50 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -290,4 +290,10 @@ def err_openclcxx_not_supported : Error< // OpenMP def err_omp_more_one_clause : Error< "directive '#pragma omp %0' cannot contain more than one '%1' clause%select{| with '%3' name modifier| with 'source' dependence}2">; + +// Static Analyzer Core +def err_unknown_analyzer_checker : Error< + "no analyzer checkers are associated with '%0'">; +def note_suggest_disabling_all_checkers : Note< + "use -analyzer-disable-all-checks to disable all static analyzer checkers">; } diff --git a/include/clang/Basic/DiagnosticCrossTUKinds.td b/include/clang/Basic/DiagnosticCrossTUKinds.td index 9c432457df..89e261c84b 100644 --- a/include/clang/Basic/DiagnosticCrossTUKinds.td +++ b/include/clang/Basic/DiagnosticCrossTUKinds.td @@ -12,7 +12,7 @@ let Component = "CrossTU" in { def err_ctu_error_opening : Error< "error opening '%0': required by the CrossTU functionality">; -def err_fnmap_parsing : Error< +def err_extdefmap_parsing : Error< "error parsing index file: '%0' line: %1 'UniqueID filename' format " "expected">; diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index af528e1718..5475e28ed7 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -405,4 +405,24 @@ def warn_drv_experimental_isel_incomplete_opt : Warning< def warn_drv_moutline_unsupported_opt : Warning< "The '%0' architecture does not support -moutline; flag ignored">, InGroup<OptionIgnored>; + +def warn_drv_darwin_sdk_invalid_settings : Warning< + "SDK settings were ignored as 'SDKSettings.json' could not be parsed">, + InGroup<DiagGroup<"darwin-sdk-settings">>; + +def err_drv_trivial_auto_var_init_zero_disabled : Error< + "-ftrivial-auto-var-init=zero hasn't been enabled. Enable it at your own peril for benchmarking purpose only with " + "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">; + +def warn_drv_msp430_hwmult_unsupported : Warning<"the given MCU does not " + "support hardware multiply, but -mhwmult is set to %0.">, + InGroup<InvalidCommandLineArgument>; +def warn_drv_msp430_hwmult_mismatch : Warning<"the given MCU supports %0 " + "hardware multiply, but -mhwmult is set to %1.">, + InGroup<InvalidCommandLineArgument>; +def warn_drv_msp430_hwmult_no_device : Warning<"no MCU device specified, but " + "'-mhwmult' is set to 'auto', assuming no hardware multiply. Use -mmcu to " + "specify a MSP430 device, or -mhwmult to set hardware multiply type " + "explicitly.">, InGroup<InvalidCommandLineArgument>; + } diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index b2fcb9ca14..927b8cbc24 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -160,11 +160,6 @@ def warn_unknown_warning_specifier : Warning< "unknown %0 warning specifier: '%1'">, InGroup<UnknownWarningOption>; -def err_unknown_analyzer_checker : Error< - "no analyzer checkers are associated with '%0'">; -def note_suggest_disabling_all_checkers : Note< - "use -analyzer-disable-all-checks to disable all static analyzer checkers">; - def warn_incompatible_analyzer_plugin_api : Warning< "checker plugin '%0' is not compatible with this version of the analyzer">, InGroup<DiagGroup<"analyzer-incompatible-plugin"> >; diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 6ba6c19a28..19e187cc5d 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -104,7 +104,11 @@ def UndefinedFuncTemplate : DiagGroup<"undefined-func-template">; def MissingNoEscape : DiagGroup<"missing-noescape">; def DeleteIncomplete : DiagGroup<"delete-incomplete">; -def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">; +def DeleteNonAbstractNonVirtualDtor : DiagGroup<"delete-non-abstract-non-virtual-dtor">; +def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor">; +def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor", + [DeleteNonAbstractNonVirtualDtor, + DeleteAbstractNonVirtualDtor]>; def AbstractFinalClass : DiagGroup<"abstract-final-class">; def CXX11CompatDeprecatedWritableStr : @@ -361,6 +365,8 @@ def NullArithmetic : DiagGroup<"null-arithmetic">; def NullCharacter : DiagGroup<"null-character">; def NullDereference : DiagGroup<"null-dereference">; def InitializerOverrides : DiagGroup<"initializer-overrides">; +// For compatibility with GCC; -Woverride-init = -Winitializer-overrides +def : DiagGroup<"override-init", [InitializerOverrides]>; def NonNull : DiagGroup<"nonnull">; def NonPODVarargs : DiagGroup<"non-pod-varargs">; def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>; diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index ec07bb5c4f..06281e2904 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -1100,6 +1100,13 @@ def err_pragma_attribute_unknown_subject_sub_rule : Error< "sub-rules: %3}2">; def err_pragma_attribute_duplicate_subject : Error< "duplicate attribute subject matcher '%0'">; +def err_pragma_attribute_expected_period : Error< + "expected '.' after pragma attribute namespace %0">; +def err_pragma_attribute_namespace_on_attribute : Error< + "namespace can only apply to 'push' or 'pop' directives">; +def note_pragma_attribute_namespace_on_attribute : Note< + "omit the namespace to add attributes to the most-recently" + " pushed attribute group">; def err_opencl_unroll_hint_on_non_loop : Error< "OpenCL only supports 'opencl_unroll_hint' attribute on for, while, and do statements">; @@ -1157,9 +1164,11 @@ def err_omp_decl_in_declare_simd : Error< def err_omp_unknown_map_type : Error< "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">; def err_omp_unknown_map_type_modifier : Error< - "incorrect map type modifier, expected 'always'">; + "incorrect map type modifier, expected 'always' or 'close'">; def err_omp_map_type_missing : Error< "missing map type">; +def err_omp_map_type_modifier_missing : Error< + "missing map type modifier">; def err_omp_declare_simd_inbranch_notinbranch : Error< "unexpected '%0' clause, '%1' is specified already">; def err_expected_end_declare_target : Error< @@ -1175,7 +1184,8 @@ def err_pragma_loop_missing_argument : Error< "'enable'%select{|, 'full'}1%select{|, 'assume_safety'}2 or 'disable'}0">; def err_pragma_loop_invalid_option : Error< "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, " - "vectorize_width, interleave, interleave_count, unroll, unroll_count, or distribute">; + "vectorize_width, interleave, interleave_count, unroll, unroll_count, " + "pipeline, pipeline_initiation_interval, or distribute">; def err_pragma_fp_invalid_option : Error< "%select{invalid|missing}0 option%select{ %1|}0; expected contract">; @@ -1188,6 +1198,8 @@ def err_pragma_fp_scope : Error< def err_pragma_invalid_keyword : Error< "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">; +def err_pragma_pipeline_invalid_keyword : Error< + "invalid argument; expected 'disable'">; // Pragma unroll support. def warn_pragma_unroll_cuda_value_in_parens : Warning< diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 2e84f5fedf..5feb877e46 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -815,7 +815,8 @@ def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error< def err_pragma_attribute_invalid_matchers : Error< "attribute %0 can't be applied to %1">; def err_pragma_attribute_stack_mismatch : Error< - "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">; + "'#pragma clang attribute %select{%1.|}0pop' with no matching" + " '#pragma clang attribute %select{%1.|}0push'">; def warn_pragma_attribute_unused : Warning< "unused attribute %0 in '#pragma clang attribute push' region">, InGroup<PragmaClangAttribute>; @@ -1297,8 +1298,8 @@ def ext_unelaborated_friend_type : ExtWarn< def warn_cxx98_compat_unelaborated_friend_type : Warning< "befriending %1 without '%select{struct|interface|union|class|enum}0' " "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def err_qualified_friend_not_found : Error< - "no function named %0 with type %1 was found in the specified scope">; +def err_qualified_friend_no_match : Error< + "friend declaration of %0 does not match any declaration in %1">; def err_introducing_special_friend : Error< "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0" " a %select{constructor|destructor|conversion operator|deduction guide}0 " @@ -1808,11 +1809,7 @@ def err_init_conversion_failed : Error< "|: different number of parameters (%5 vs %6)" "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" "|: different return type%diff{ ($ vs $)|}5,6" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}5 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)" + "|: different qualifiers (%5 vs %6)" "|: different exception specifications}4">; def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot " @@ -3428,7 +3425,7 @@ def err_ns_attribute_wrong_parameter_type : Error< "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">; def warn_ns_attribute_wrong_parameter_type : Warning< "%0 attribute only applies to " - "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">, + "%select{Objective-C object|pointer|pointer-to-CF-pointer|pointer/reference-to-OSObject-pointer}1 parameters">, InGroup<IgnoredAttributes>; def warn_objc_requires_super_protocol : Warning< "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">, @@ -3488,6 +3485,11 @@ def err_objc_bridged_related_known_method : Error< def err_objc_attr_protocol_requires_definition : Error< "attribute %0 can only be applied to @protocol definitions, not forward declarations">; +def warn_ignored_objc_externally_retained : Warning< + "'objc_externally_retained' can only be applied to local variables " + "%select{of retainable type|with strong ownership}0">, + InGroup<IgnoredAttributes>; + // Function Parameter Semantic Analysis. def err_param_with_void_type : Error<"argument may not have 'void' type">; def err_void_only_param : Error< @@ -3592,11 +3594,7 @@ def note_ovl_candidate : Note< "| has type mismatch at %ordinal5 parameter" "%diff{ (expected $ but has $)|}6,7" "| has different return type%diff{ ($ expected but has $)|}5,6" - "| has different qualifiers (expected " - "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}5 but found " - "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}6)" + "| has different qualifiers (expected %5 but found %6)" "| has different exception specification}4">; def note_ovl_candidate_inherited_constructor : Note< @@ -4567,7 +4565,10 @@ def warn_unavailable_fwdclass_message : Warning< InGroup<UnavailableDeclarations>; def note_availability_specified_here : Note< "%0 has been explicitly marked " - "%select{unavailable|deleted|deprecated|partial}1 here">; + "%select{unavailable|deleted|deprecated}1 here">; +def note_partial_availability_specified_here : Note< + "%0 has been marked as being introduced in %1 %2 here, " + "but the deployment target is %1 %3">; def note_implicitly_deleted : Note< "explicitly defaulted function was implicitly deleted here">; def warn_not_enough_argument : Warning< @@ -4880,7 +4881,7 @@ def warn_braces_around_scalar_init : Warning< "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>; def ext_many_braces_around_scalar_init : ExtWarn< "too many braces around scalar initializer">, - InGroup<DiagGroup<"many-braces-around-scalar-init">>; + InGroup<DiagGroup<"many-braces-around-scalar-init">>, SFINAEFailure; def ext_complex_component_init : Extension< "complex initialization specifying real and imaginary components " "is an extension">, InGroup<DiagGroup<"complex-component-init">>; @@ -5261,6 +5262,9 @@ def err_typecheck_arc_assign_self_class_method : Error< def err_typecheck_arr_assign_enumeration : Error< "fast enumeration variables cannot be modified in ARC by default; " "declare the variable __strong to allow this">; +def err_typecheck_arc_assign_externally_retained : Error< + "variable declared with 'objc_externally_retained' " + "cannot be modified in ARC">; def warn_arc_retained_assign : Warning< "assigning retained object to %select{weak|unsafe_unretained}0 " "%select{property|variable}1" @@ -5874,7 +5878,8 @@ def ext_typecheck_comparison_of_fptr_to_void : Extension< def err_typecheck_comparison_of_fptr_to_void : Error< "equality comparison between function pointer and void pointer (%0 and %1)">; def ext_typecheck_comparison_of_pointer_integer : ExtWarn< - "comparison between pointer and integer (%0 and %1)">; + "comparison between pointer and integer (%0 and %1)">, + InGroup<DiagGroup<"pointer-integer-compare">>; def err_typecheck_comparison_of_pointer_integer : Error< "comparison between pointer and integer (%0 and %1)">; def ext_typecheck_comparison_of_distinct_pointers : ExtWarn< @@ -6454,12 +6459,12 @@ def warn_non_virtual_dtor : Warning< def warn_delete_non_virtual_dtor : Warning< "%select{delete|destructor}0 called on non-final %1 that has " "virtual functions but non-virtual destructor">, - InGroup<DeleteNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader; + InGroup<DeleteNonAbstractNonVirtualDtor>, DefaultIgnore, ShowInSystemHeader; def note_delete_non_virtual : Note< "qualify call to silence this warning">; def warn_delete_abstract_non_virtual_dtor : Warning< "%select{delete|destructor}0 called on %1 that is abstract but has " - "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>, ShowInSystemHeader; + "non-virtual destructor">, InGroup<DeleteAbstractNonVirtualDtor>, ShowInSystemHeader; def warn_overloaded_virtual : Warning< "%q0 hides overloaded virtual %select{function|functions}1">, InGroup<OverloadedVirtual>, DefaultIgnore; @@ -6469,11 +6474,7 @@ def note_hidden_overloaded_virtual_declared_here : Note< "|: different number of parameters (%2 vs %3)" "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4" "|: different return type%diff{ ($ vs $)|}2,3" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}2 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}3)" + "|: different qualifiers (%2 vs %3)" "|: different exception specifications}1">; def warn_using_directive_in_header : Warning< "using namespace directive in global context in header">, @@ -6747,11 +6748,7 @@ def err_typecheck_convert_incompatible : Error< "|: different number of parameters (%5 vs %6)" "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" "|: different return type%diff{ ($ vs $)|}5,6" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}5 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)" + "|: different qualifiers (%5 vs %6)" "|: different exception specifications}4">; def err_typecheck_missing_return_type_incompatible : Error< "%diff{return type $ must match previous return type $|" @@ -8725,6 +8722,8 @@ def err_omp_expected_access_to_data_field : Error< "expected access to data field">; def err_omp_multiple_array_items_in_map_clause : Error< "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">; +def err_omp_duplicate_map_type_modifier : Error< + "same map type modifier has been specified more than once">; def err_omp_pointer_mapped_along_with_derived_section : Error< "pointer cannot be mapped along with a section derived from itself">; def err_omp_original_storage_is_shared_and_does_not_contain : Error< @@ -8783,8 +8782,10 @@ def err_omp_required_access : Error< "%0 variable must be %1">; def err_omp_const_variable : Error< "const-qualified variable cannot be %0">; -def err_omp_const_reduction_list_item : Error< - "const-qualified list item cannot be reduction">; +def err_omp_const_not_mutable_variable : Error< + "const-qualified variable without mutable fields cannot be %0">; +def err_omp_const_list_item : Error< + "const-qualified list item cannot be %0">; def err_omp_linear_incomplete_type : Error< "a linear variable with incomplete type %0">; def err_omp_linear_expected_int_or_ptr : Error< @@ -9073,6 +9074,14 @@ def note_omp_requires_previous_clause : Note < "%0 clause previously used here">; def err_omp_invalid_scope : Error < "'#pragma omp %0' directive must appear only in file scope">; +def note_omp_invalid_length_on_this_ptr_mapping : Note < + "expected length on mapping of 'this' array section expression to be '1'">; +def note_omp_invalid_lower_bound_on_this_ptr_mapping : Note < + "expected lower bound on mapping of 'this' array section expression to be '0' or not specified">; +def note_omp_invalid_subscript_on_this_ptr_map : Note < + "expected 'this' subscript expression on map clause to be 'this[0]'">; +def err_omp_invalid_map_this_expr : Error < + "invalid 'this' expression on 'map' clause">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { diff --git a/include/clang/Basic/Features.def b/include/clang/Basic/Features.def index 0cece27eef..05464ed85f 100644 --- a/include/clang/Basic/Features.def +++ b/include/clang/Basic/Features.def @@ -17,6 +17,12 @@ // // The Predicate field dictates the conditions under which the feature or // extension will be made available. +// +// FEATURE(...) should be used to advertise support for standard language +// features, whereas EXTENSION(...) should be used for clang extensions. Note +// that many of the identifiers in this file don't follow this rule for backward +// compatibility reasons. +// //===----------------------------------------------------------------------===// #if !defined(FEATURE) && !defined(EXTENSION) @@ -240,6 +246,7 @@ EXTENSION(cxx_init_captures, LangOpts.CPlusPlus11) EXTENSION(cxx_variable_templates, LangOpts.CPlusPlus) // Miscellaneous language extensions EXTENSION(overloadable_unmarked, true) +EXTENSION(pragma_clang_attribute_namespaces, true) #undef EXTENSION #undef FEATURE diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 8e021f41c1..e7891baf53 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -192,18 +192,10 @@ public: /// /// \param statCache the new stat cache to install. Ownership of this /// object is transferred to the FileManager. - /// - /// \param AtBeginning whether this new stat cache must be installed at the - /// beginning of the chain of stat caches. Otherwise, it will be added to - /// the end of the chain. - void addStatCache(std::unique_ptr<FileSystemStatCache> statCache, - bool AtBeginning = false); - - /// Removes the specified FileSystemStatCache object from the manager. - void removeStatCache(FileSystemStatCache *statCache); + void setStatCache(std::unique_ptr<FileSystemStatCache> statCache); - /// Removes all FileSystemStatCache objects from the manager. - void clearStatCaches(); + /// Removes the FileSystemStatCache object from the manager. + void clearStatCache(); /// Lookup, cache, and verify the specified directory (real or /// virtual). diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index a0277009d7..f93170c754 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -60,9 +60,6 @@ struct FileData { class FileSystemStatCache { virtual void anchor(); -protected: - std::unique_ptr<FileSystemStatCache> NextStatCache; - public: virtual ~FileSystemStatCache() = default; @@ -88,22 +85,6 @@ public: std::unique_ptr<llvm::vfs::File> *F, FileSystemStatCache *Cache, llvm::vfs::FileSystem &FS); - /// Sets the next stat call cache in the chain of stat caches. - /// Takes ownership of the given stat cache. - void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) { - NextStatCache = std::move(Cache); - } - - /// Retrieve the next stat call cache in the chain. - FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); } - - /// Retrieve the next stat call cache in the chain, transferring - /// ownership of this cache (and, transitively, all of the remaining caches) - /// to the caller. - std::unique_ptr<FileSystemStatCache> takeNextStatCache() { - return std::move(NextStatCache); - } - protected: // FIXME: The pointer here is a non-owning/optional reference to the // unique_ptr. Optional<unique_ptr<vfs::File>&> might be nicer, but @@ -111,17 +92,6 @@ protected: virtual LookupResult getStat(StringRef Path, FileData &Data, bool isFile, std::unique_ptr<llvm::vfs::File> *F, llvm::vfs::FileSystem &FS) = 0; - - LookupResult statChained(StringRef Path, FileData &Data, bool isFile, - std::unique_ptr<llvm::vfs::File> *F, - llvm::vfs::FileSystem &FS) { - if (FileSystemStatCache *Next = getNextStatCache()) - return Next->getStat(Path, Data, isFile, F, FS); - - // If we hit the end of the list of stat caches to try, just compute and - // return it without a cache. - return get(Path, Data, isFile, F, nullptr, FS) ? CacheMissing : CacheExists; - } }; /// A stat "cache" that can be used by FileManager to keep diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def index be4491d512..49961856c9 100644 --- a/include/clang/Basic/LangOptions.def +++ b/include/clang/Basic/LangOptions.def @@ -207,6 +207,7 @@ LANGOPT(OpenMPCUDAForceFullRuntime , 1, 0, "Force to use full runtime in all con LANGOPT(OpenMPHostCXXExceptions , 1, 0, "C++ exceptions handling in the host code.") LANGOPT(OpenMPCUDANumSMs , 32, 0, "Number of SMs for CUDA devices.") LANGOPT(OpenMPCUDABlocksPerSM , 32, 0, "Number of blocks per SM for CUDA devices.") +LANGOPT(OpenMPOptimisticCollapse , 1, 0, "Use at most 32 bits to represent the collapsed loop nest counter.") LANGOPT(RenderScript , 1, 0, "RenderScript") LANGOPT(CUDAIsDevice , 1, 0, "compiling for CUDA device") @@ -263,6 +264,8 @@ ENUM_LANGOPT(TypeVisibilityMode, Visibility, 3, DefaultVisibility, "type symbol visibility") ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff, "stack protector mode") +ENUM_LANGOPT(TrivialAutoVarInit, TrivialAutoVarInitKind, 2, TrivialAutoVarInitKind::Uninitialized, + "trivial automatic variable initialization") ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined, "signed integer overflow handling") diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 34f510f5ca..9cff7c5160 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -54,6 +54,11 @@ public: enum GCMode { NonGC, GCOnly, HybridGC }; enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq }; + // Automatic variables live on the stack, and when trivial they're usually + // uninitialized because it's undefined behavior to use them without + // initializing them. + enum class TrivialAutoVarInitKind { Uninitialized, Zero, Pattern }; + enum SignedOverflowBehaviorTy { // Default C standard behavior. SOB_Undefined, @@ -98,11 +103,14 @@ public: enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off }; + // Corresponds to _MSC_VER enum MSVCMajorVersion { - MSVC2010 = 16, - MSVC2012 = 17, - MSVC2013 = 18, - MSVC2015 = 19 + MSVC2010 = 1600, + MSVC2012 = 1700, + MSVC2013 = 1800, + MSVC2015 = 1900, + MSVC2017 = 1910, + MSVC2017_5 = 1912 }; /// Clang versions with different platform ABI conformance. @@ -271,7 +279,7 @@ public: } bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const { - return MSCompatibilityVersion >= MajorVersion * 10000000U; + return MSCompatibilityVersion >= MajorVersion * 100000U; } /// Reset all of the options that are not considered when building a diff --git a/include/clang/Basic/MSP430Target.def b/include/clang/Basic/MSP430Target.def new file mode 100644 index 0000000000..758113c5f5 --- /dev/null +++ b/include/clang/Basic/MSP430Target.def @@ -0,0 +1,247 @@ +//===--- MSP430Target.def - MSP430 Feature/Processor Database----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the MSP430 devices and their features. +// +//===----------------------------------------------------------------------===// + +#ifndef MSP430_MCU_FEAT +#define MSP430_MCU_FEAT(NAME, HWMULT) MSP430_MCU(NAME) +#endif + +#ifndef MSP430_MCU +#define MSP430_MCU(NAME) +#endif + +MSP430_MCU("msp430c111") +MSP430_MCU("msp430c1111") +MSP430_MCU("msp430c112") +MSP430_MCU("msp430c1121") +MSP430_MCU("msp430c1331") +MSP430_MCU("msp430c1351") +MSP430_MCU("msp430e112") +MSP430_MCU("msp430f110") +MSP430_MCU("msp430f1101") +MSP430_MCU("msp430f1101a") +MSP430_MCU("msp430f1111") +MSP430_MCU("msp430f1111a") +MSP430_MCU("msp430f112") +MSP430_MCU("msp430f1121") +MSP430_MCU("msp430f1121a") +MSP430_MCU("msp430f1122") +MSP430_MCU("msp430f1132") +MSP430_MCU("msp430f122") +MSP430_MCU("msp430f1222") +MSP430_MCU("msp430f123") +MSP430_MCU("msp430f1232") +MSP430_MCU("msp430f133") +MSP430_MCU("msp430f135") +MSP430_MCU("msp430f155") +MSP430_MCU("msp430f156") +MSP430_MCU("msp430f157") +MSP430_MCU("msp430p112") +MSP430_MCU("msp430f2001") +MSP430_MCU("msp430f2011") +MSP430_MCU("msp430f2002") +MSP430_MCU("msp430f2012") +MSP430_MCU("msp430f2003") +MSP430_MCU("msp430f2013") +MSP430_MCU("msp430f2101") +MSP430_MCU("msp430f2111") +MSP430_MCU("msp430f2121") +MSP430_MCU("msp430f2131") +MSP430_MCU("msp430f2112") +MSP430_MCU("msp430f2122") +MSP430_MCU("msp430f2132") +MSP430_MCU("msp430f2232") +MSP430_MCU("msp430f2252") +MSP430_MCU("msp430f2272") +MSP430_MCU("msp430f2234") +MSP430_MCU("msp430f2254") +MSP430_MCU("msp430f2274") +MSP430_MCU("msp430g2211") +MSP430_MCU("msp430g2201") +MSP430_MCU("msp430g2111") +MSP430_MCU("msp430g2101") +MSP430_MCU("msp430g2001") +MSP430_MCU("msp430g2231") +MSP430_MCU("msp430g2221") +MSP430_MCU("msp430g2131") +MSP430_MCU("msp430g2121") +MSP430_MCU("msp430g2102") +MSP430_MCU("msp430g2202") +MSP430_MCU("msp430g2302") +MSP430_MCU("msp430g2402") +MSP430_MCU("msp430g2132") +MSP430_MCU("msp430g2232") +MSP430_MCU("msp430g2332") +MSP430_MCU("msp430g2432") +MSP430_MCU("msp430g2112") +MSP430_MCU("msp430g2212") +MSP430_MCU("msp430g2312") +MSP430_MCU("msp430g2412") +MSP430_MCU("msp430g2152") +MSP430_MCU("msp430g2252") +MSP430_MCU("msp430g2352") +MSP430_MCU("msp430g2452") +MSP430_MCU("msp430g2113") +MSP430_MCU("msp430g2213") +MSP430_MCU("msp430g2313") +MSP430_MCU("msp430g2413") +MSP430_MCU("msp430g2513") +MSP430_MCU("msp430g2153") +MSP430_MCU("msp430g2253") +MSP430_MCU("msp430g2353") +MSP430_MCU("msp430g2453") +MSP430_MCU("msp430g2553") +MSP430_MCU("msp430g2203") +MSP430_MCU("msp430g2303") +MSP430_MCU("msp430g2403") +MSP430_MCU("msp430g2233") +MSP430_MCU("msp430g2333") +MSP430_MCU("msp430g2433") +MSP430_MCU("msp430g2533") +MSP430_MCU("msp430tch5e") +MSP430_MCU("msp430g2444") +MSP430_MCU("msp430g2544") +MSP430_MCU("msp430g2744") +MSP430_MCU("msp430g2755") +MSP430_MCU("msp430g2855") +MSP430_MCU("msp430g2955") +MSP430_MCU("msp430g2230") +MSP430_MCU("msp430g2210") +MSP430_MCU("msp430c311s") +MSP430_MCU("msp430c312") +MSP430_MCU("msp430c313") +MSP430_MCU("msp430c314") +MSP430_MCU("msp430c315") +MSP430_MCU("msp430c323") +MSP430_MCU("msp430c325") +MSP430_MCU("msp430c412") +MSP430_MCU("msp430c413") +MSP430_MCU("msp430e313") +MSP430_MCU("msp430e315") +MSP430_MCU("msp430e325") +MSP430_MCU("msp430p313") +MSP430_MCU("msp430p315") +MSP430_MCU("msp430p315s") +MSP430_MCU("msp430p325") +MSP430_MCU("msp430f412") +MSP430_MCU("msp430f413") +MSP430_MCU("msp430f415") +MSP430_MCU("msp430f417") +MSP430_MCU("msp430f4132") +MSP430_MCU("msp430f4152") +MSP430_MCU("msp430f435") +MSP430_MCU("msp430f436") +MSP430_MCU("msp430f437") +MSP430_MCU("msp430f4351") +MSP430_MCU("msp430f4361") +MSP430_MCU("msp430f4371") +MSP430_MCU("msp430fe423") +MSP430_MCU("msp430fe425") +MSP430_MCU("msp430fe427") +MSP430_MCU("msp430fe423a") +MSP430_MCU("msp430fe425a") +MSP430_MCU("msp430fe427a") +MSP430_MCU("msp430fe4232") +MSP430_MCU("msp430fe4242") +MSP430_MCU("msp430fe4252") +MSP430_MCU("msp430fe4272") +MSP430_MCU("msp430f4250") +MSP430_MCU("msp430f4260") +MSP430_MCU("msp430f4270") +MSP430_MCU("msp430fg4250") +MSP430_MCU("msp430fg4260") +MSP430_MCU("msp430fg4270") +MSP430_MCU("msp430fw423") +MSP430_MCU("msp430fw425") +MSP430_MCU("msp430fw427") +MSP430_MCU("msp430fw428") +MSP430_MCU("msp430fw429") +MSP430_MCU("msp430fg437") +MSP430_MCU("msp430fg438") +MSP430_MCU("msp430fg439") +MSP430_MCU("msp430f438") +MSP430_MCU("msp430f439") +MSP430_MCU("msp430f477") +MSP430_MCU("msp430f478") +MSP430_MCU("msp430f479") +MSP430_MCU("msp430fg477") +MSP430_MCU("msp430fg478") +MSP430_MCU("msp430fg479") + +// With 16-bit hardware multiplier +MSP430_MCU_FEAT("msp430f147", "16bit") +MSP430_MCU_FEAT("msp430f148", "16bit") +MSP430_MCU_FEAT("msp430f149", "16bit") +MSP430_MCU_FEAT("msp430f1471", "16bit") +MSP430_MCU_FEAT("msp430f1481", "16bit") +MSP430_MCU_FEAT("msp430f1491", "16bit") +MSP430_MCU_FEAT("msp430f167", "16bit") +MSP430_MCU_FEAT("msp430f168", "16bit") +MSP430_MCU_FEAT("msp430f169", "16bit") +MSP430_MCU_FEAT("msp430f1610", "16bit") +MSP430_MCU_FEAT("msp430f1611", "16bit") +MSP430_MCU_FEAT("msp430f1612", "16bit") +MSP430_MCU_FEAT("msp430c336", "16bit") +MSP430_MCU_FEAT("msp430c337", "16bit") +MSP430_MCU_FEAT("msp430e337", "16bit") +MSP430_MCU_FEAT("msp430p337", "16bit") +MSP430_MCU_FEAT("msp430f423", "16bit") +MSP430_MCU_FEAT("msp430f425", "16bit") +MSP430_MCU_FEAT("msp430f427", "16bit") +MSP430_MCU_FEAT("msp430f423a", "16bit") +MSP430_MCU_FEAT("msp430f425a", "16bit") +MSP430_MCU_FEAT("msp430f427a", "16bit") +MSP430_MCU_FEAT("msp430f4481", "16bit") +MSP430_MCU_FEAT("msp430f4491", "16bit") +MSP430_MCU_FEAT("msp430f447", "16bit") +MSP430_MCU_FEAT("msp430f448", "16bit") +MSP430_MCU_FEAT("msp430f449", "16bit") +MSP430_MCU_FEAT("msp430f2330", "16bit") +MSP430_MCU_FEAT("msp430f2350", "16bit") +MSP430_MCU_FEAT("msp430f2370", "16bit") +MSP430_MCU_FEAT("msp430f233", "16bit") +MSP430_MCU_FEAT("msp430f235", "16bit") +MSP430_MCU_FEAT("msp430f247", "16bit") +MSP430_MCU_FEAT("msp430f248", "16bit") +MSP430_MCU_FEAT("msp430f249", "16bit") +MSP430_MCU_FEAT("msp430f2410", "16bit") +MSP430_MCU_FEAT("msp430f2471", "16bit") +MSP430_MCU_FEAT("msp430f2481", "16bit") +MSP430_MCU_FEAT("msp430f2491", "16bit") +MSP430_MCU_FEAT("msp430i2020", "16bit") +MSP430_MCU_FEAT("msp430i2021", "16bit") +MSP430_MCU_FEAT("msp430i2030", "16bit") +MSP430_MCU_FEAT("msp430i2031", "16bit") +MSP430_MCU_FEAT("msp430i2040", "16bit") +MSP430_MCU_FEAT("msp430i2041", "16bit") +MSP430_MCU_FEAT("msp430afe221", "16bit") +MSP430_MCU_FEAT("msp430afe231", "16bit") +MSP430_MCU_FEAT("msp430afe251", "16bit") +MSP430_MCU_FEAT("msp430afe222", "16bit") +MSP430_MCU_FEAT("msp430afe232", "16bit") +MSP430_MCU_FEAT("msp430afe252", "16bit") +MSP430_MCU_FEAT("msp430afe223", "16bit") +MSP430_MCU_FEAT("msp430afe233", "16bit") +MSP430_MCU_FEAT("msp430afe253", "16bit") + +// With 32 Bit Hardware Multiplier +MSP430_MCU_FEAT("msp430f4783", "32bit") +MSP430_MCU_FEAT("msp430f4793", "32bit") +MSP430_MCU_FEAT("msp430f4784", "32bit") +MSP430_MCU_FEAT("msp430f4794", "32bit") + +// Generic MSUs +MSP430_MCU("msp430") +MSP430_MCU("msp430i2xxgeneric") + +#undef MSP430_MCU +#undef MSP430_MCU_FEAT diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index f8b4826d3d..fcfbe56b49 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -173,6 +173,43 @@ public: llvm_unreachable("bad kind"); } + /// Does this runtime provide ARC entrypoints that are likely to be faster + /// than an ordinary message send of the appropriate selector? + /// + /// The ARC entrypoints are guaranteed to be equivalent to just sending the + /// corresponding message. If the entrypoint is implemented naively as just a + /// message send, using it is a trade-off: it sacrifices a few cycles of + /// overhead to save a small amount of code. However, it's possible for + /// runtimes to detect and special-case classes that use "standard" + /// retain/release behavior; if that's dynamically a large proportion of all + /// retained objects, using the entrypoint will also be faster than using a + /// message send. + /// + /// When this method returns true, Clang will turn non-super message sends of + /// certain selectors into calls to the correspond entrypoint: + /// retain => objc_retain + /// release => objc_release + /// autorelease => objc_autorelease + bool shouldUseARCFunctionsForRetainRelease() const { + switch (getKind()) { + case FragileMacOSX: + return false; + case MacOSX: + return getVersion() >= VersionTuple(10, 10); + case iOS: + return getVersion() >= VersionTuple(8); + case WatchOS: + return true; + case GCC: + return false; + case GNUstep: + return false; + case ObjFW: + return false; + } + llvm_unreachable("bad kind"); + } + /// Does this runtime provide entrypoints that are likely to be faster /// than an ordinary message send of the "alloc" selector? /// diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index eb9881115c..f86721b1b0 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -120,6 +120,9 @@ #ifndef OPENMP_MAP_KIND #define OPENMP_MAP_KIND(Name) #endif +#ifndef OPENMP_MAP_MODIFIER_KIND +#define OPENMP_MAP_MODIFIER_KIND(Name) +#endif #ifndef OPENMP_DIST_SCHEDULE_KIND #define OPENMP_DIST_SCHEDULE_KIND(Name) #endif @@ -559,14 +562,17 @@ OPENMP_ORDERED_CLAUSE(threads) OPENMP_ORDERED_CLAUSE(simd) OPENMP_ORDERED_CLAUSE(depend) -// Map types and map type modifier for 'map' clause. +// Map types for 'map' clause. OPENMP_MAP_KIND(alloc) OPENMP_MAP_KIND(to) OPENMP_MAP_KIND(from) OPENMP_MAP_KIND(tofrom) OPENMP_MAP_KIND(delete) OPENMP_MAP_KIND(release) -OPENMP_MAP_KIND(always) + +// Map-type-modifiers for 'map' clause. +OPENMP_MAP_MODIFIER_KIND(always) +OPENMP_MAP_MODIFIER_KIND(close) // Clauses allowed for OpenMP directive 'taskloop'. OPENMP_TASKLOOP_CLAUSE(if) @@ -919,6 +925,7 @@ OPENMP_TASKGROUP_CLAUSE(task_reduction) #undef OPENMP_FOR_CLAUSE #undef OPENMP_FOR_SIMD_CLAUSE #undef OPENMP_MAP_KIND +#undef OPENMP_MAP_MODIFIER_KIND #undef OPENMP_DISTRIBUTE_CLAUSE #undef OPENMP_DIST_SCHEDULE_KIND #undef OPENMP_DEFAULTMAP_KIND diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index b0fab5ab11..3e03a48cf6 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -96,6 +96,15 @@ enum OpenMPMapClauseKind { OMPC_MAP_unknown }; +/// OpenMP modifier kind for 'map' clause. +enum OpenMPMapModifierKind { + OMPC_MAP_MODIFIER_unknown = OMPC_MAP_unknown, +#define OPENMP_MAP_MODIFIER_KIND(Name) \ + OMPC_MAP_MODIFIER_##Name, +#include "clang/Basic/OpenMPKinds.def" + OMPC_MAP_MODIFIER_last +}; + /// OpenMP attributes for 'dist_schedule' clause. enum OpenMPDistScheduleClauseKind { #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name, diff --git a/include/clang/Basic/Sanitizers.h b/include/clang/Basic/Sanitizers.h index 2ecbde8215..fe9e76a1e3 100644 --- a/include/clang/Basic/Sanitizers.h +++ b/include/clang/Basic/Sanitizers.h @@ -66,7 +66,7 @@ struct SanitizerSet { /// Disable the sanitizers specified in \p K. void clear(SanitizerMask K = SanitizerKind::All) { Mask &= ~K; } - /// Returns true if at least one sanitizer is enabled. + /// Returns true if no sanitizers are enabled. bool empty() const { return Mask == 0; } /// Bitmask of enabled sanitizers. diff --git a/include/clang/Basic/TargetBuiltins.h b/include/clang/Basic/TargetBuiltins.h index 75a3811007..ab4b1c43f7 100644 --- a/include/clang/Basic/TargetBuiltins.h +++ b/include/clang/Basic/TargetBuiltins.h @@ -150,16 +150,6 @@ namespace clang { }; } - /// Nios2 builtins - namespace Nios2 { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsNios2.def" - LastTSBuiltin - }; - } - /// MIPS builtins namespace Mips { enum { diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 4a7254e02c..786b1c251c 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -1321,6 +1321,12 @@ public: return None; } + /// \returns The version of the SDK which was used during the compilation if + /// one was specified, or an empty version otherwise. + const llvm::VersionTuple &getSDKVersion() const { + return getTargetOpts().SDKVersion; + } + /// Check the target is valid after it is fully initialized. virtual bool validateTarget(DiagnosticsEngine &Diags) const { return true; diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h index 7559e3169e..fcccc5331a 100644 --- a/include/clang/Basic/TargetOptions.h +++ b/include/clang/Basic/TargetOptions.h @@ -15,10 +15,11 @@ #ifndef LLVM_CLANG_BASIC_TARGETOPTIONS_H #define LLVM_CLANG_BASIC_TARGETOPTIONS_H -#include <string> -#include <vector> #include "clang/Basic/OpenCLOptions.h" +#include "llvm/Support/VersionTuple.h" #include "llvm/Target/TargetOptions.h" +#include <string> +#include <vector> namespace clang { @@ -73,6 +74,9 @@ public: // "default" for the case when the user has not explicitly specified a // code model. std::string CodeModel; + + /// The version of the SDK which was used during the compilation. + llvm::VersionTuple SDKVersion; }; } // end namespace clang |