Skip to content

Commit ac168fe

Browse files
committed
Merge from 'main' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaType.cpp CONFLICT (content): Merge conflict in clang/lib/Sema/SemaDecl.cpp
2 parents e18f25a + f9bc1b3 commit ac168fe

File tree

1,616 files changed

+36471
-20746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,616 files changed

+36471
-20746
lines changed

clang/docs/ClangFormatStyleOptions.rst

+59-34
Original file line numberDiff line numberDiff line change
@@ -646,22 +646,8 @@ the configuration (without a prefix: ``Auto``).
646646
d);
647647

648648
**AllowAllConstructorInitializersOnNextLine** (``bool``)
649-
If a constructor definition with a member initializer list doesn't
650-
fit on a single line, allow putting all member initializers onto the next
651-
line, if ```ConstructorInitializerAllOnOneLineOrOnePerLine``` is true.
652-
Note that this parameter has no effect if
653-
```ConstructorInitializerAllOnOneLineOrOnePerLine``` is false.
654-
655-
.. code-block:: c++
656-
657-
true:
658-
MyClass::MyClass() :
659-
member0(0), member1(2) {}
660-
661-
false:
662-
MyClass::MyClass() :
663-
member0(0),
664-
member1(2) {}
649+
This option is **deprecated**. See ``NextLine`` of
650+
``PackConstructorInitializers``.
665651

666652
**AllowAllParametersOfDeclarationOnNextLine** (``bool``)
667653
If the function declaration doesn't fit on a line,
@@ -2002,7 +1988,7 @@ the configuration (without a prefix: ``Auto``).
20021988
SecondValueVeryVeryVeryVeryLong;
20031989

20041990
**BreakConstructorInitializers** (``BreakConstructorInitializersStyle``)
2005-
The constructor initializers style to use.
1991+
The break constructor initializers style to use.
20061992

20071993
Possible values:
20081994

@@ -2140,23 +2126,8 @@ the configuration (without a prefix: ``Auto``).
21402126
}}}
21412127

21422128
**ConstructorInitializerAllOnOneLineOrOnePerLine** (``bool``)
2143-
If the constructor initializers don't fit on a line, put each
2144-
initializer on its own line.
2145-
2146-
.. code-block:: c++
2147-
2148-
true:
2149-
SomeClass::Constructor()
2150-
: aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
2151-
return 0;
2152-
}
2153-
2154-
false:
2155-
SomeClass::Constructor()
2156-
: aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa),
2157-
aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
2158-
return 0;
2159-
}
2129+
This option is **deprecated**. See ``CurrentLine`` of
2130+
``PackConstructorInitializers``.
21602131

21612132
**ConstructorInitializerIndentWidth** (``unsigned``)
21622133
The number of characters to use for indentation of constructor
@@ -3143,6 +3114,60 @@ the configuration (without a prefix: ``Auto``).
31433114
# define BAR
31443115
#endif
31453116

3117+
**PackConstructorInitializers** (``PackConstructorInitializersStyle``)
3118+
The pack constructor initializers style to use.
3119+
3120+
Possible values:
3121+
3122+
* ``PCIS_Never`` (in configuration: ``Never``)
3123+
Always put each constructor initializer on its own line.
3124+
3125+
.. code-block:: c++
3126+
3127+
Constructor()
3128+
: a(),
3129+
b()
3130+
3131+
* ``PCIS_BinPack`` (in configuration: ``BinPack``)
3132+
Bin-pack constructor initializers.
3133+
3134+
.. code-block:: c++
3135+
3136+
Constructor()
3137+
: aaaaaaaaaaaaaaaaaaaa(), bbbbbbbbbbbbbbbbbbbb(),
3138+
cccccccccccccccccccc()
3139+
3140+
* ``PCIS_CurrentLine`` (in configuration: ``CurrentLine``)
3141+
Put all constructor initializers on the current line if they fit.
3142+
Otherwise, put each one on its own line.
3143+
3144+
.. code-block:: c++
3145+
3146+
Constructor() : a(), b()
3147+
3148+
Constructor()
3149+
: aaaaaaaaaaaaaaaaaaaa(),
3150+
bbbbbbbbbbbbbbbbbbbb(),
3151+
ddddddddddddd()
3152+
3153+
* ``PCIS_NextLine`` (in configuration: ``NextLine``)
3154+
Same as ``PCIS_CurrentLine`` except that if all constructor initializers
3155+
do not fit on the current line, try to fit them on the next line.
3156+
3157+
.. code-block:: c++
3158+
3159+
Constructor() : a(), b()
3160+
3161+
Constructor()
3162+
: aaaaaaaaaaaaaaaaaaaa(), bbbbbbbbbbbbbbbbbbbb(), ddddddddddddd()
3163+
3164+
Constructor()
3165+
: aaaaaaaaaaaaaaaaaaaa(),
3166+
bbbbbbbbbbbbbbbbbbbb(),
3167+
cccccccccccccccccccc()
3168+
3169+
3170+
31463171
**PenaltyBreakAssignment** (``unsigned``)
31473172
The penalty for breaking around an assignment operator.
31483173

clang/docs/LibASTMatchersReference.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7463,7 +7463,7 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
74637463
}
74647464
}
74657465

7466-
cxxRcordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
7466+
cxxRecordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
74677467
declaration of class D.
74687468
</pre></td></tr>
74697469

clang/docs/analyzer/checkers.rst

-4
Original file line numberDiff line numberDiff line change
@@ -2190,10 +2190,6 @@ Limitations:
21902190
not tighten the domain to prevent the overflow in the subsequent
21912191
multiplication operation.
21922192
2193-
- If the variable ``n`` participates in a comparison anywhere in the enclosing
2194-
function's scope, even after the ``malloc()``, the report will be still
2195-
suppressed.
2196-
21972193
- It is an AST-based checker, thus it does not make use of the
21982194
path-sensitive taint-analysis.
21992195

clang/include/clang/AST/ASTContext.h

+30-8
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,46 @@ namespace serialization {
164164
template <class> class AbstractTypeReader;
165165
} // namespace serialization
166166

167+
enum class AlignRequirementKind {
168+
/// The alignment was not explicit in code.
169+
None,
170+
171+
/// The alignment comes from an alignment attribute on a typedef.
172+
RequiredByTypedef,
173+
174+
/// The alignment comes from an alignment attribute on a record type.
175+
RequiredByRecord,
176+
177+
/// The alignment comes from an alignment attribute on a enum type.
178+
RequiredByEnum,
179+
};
180+
167181
struct TypeInfo {
168182
uint64_t Width = 0;
169183
unsigned Align = 0;
170-
bool AlignIsRequired : 1;
184+
AlignRequirementKind AlignRequirement;
171185

172-
TypeInfo() : AlignIsRequired(false) {}
173-
TypeInfo(uint64_t Width, unsigned Align, bool AlignIsRequired)
174-
: Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
186+
TypeInfo() : AlignRequirement(AlignRequirementKind::None) {}
187+
TypeInfo(uint64_t Width, unsigned Align,
188+
AlignRequirementKind AlignRequirement)
189+
: Width(Width), Align(Align), AlignRequirement(AlignRequirement) {}
190+
bool isAlignRequired() {
191+
return AlignRequirement != AlignRequirementKind::None;
192+
}
175193
};
176194

177195
struct TypeInfoChars {
178196
CharUnits Width;
179197
CharUnits Align;
180-
bool AlignIsRequired : 1;
198+
AlignRequirementKind AlignRequirement;
181199

182-
TypeInfoChars() : AlignIsRequired(false) {}
183-
TypeInfoChars(CharUnits Width, CharUnits Align, bool AlignIsRequired)
184-
: Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
200+
TypeInfoChars() : AlignRequirement(AlignRequirementKind::None) {}
201+
TypeInfoChars(CharUnits Width, CharUnits Align,
202+
AlignRequirementKind AlignRequirement)
203+
: Width(Width), Align(Align), AlignRequirement(AlignRequirement) {}
204+
bool isAlignRequired() {
205+
return AlignRequirement != AlignRequirementKind::None;
206+
}
185207
};
186208

187209
/// Holds long-lived AST nodes (such as types and decls) that can be

clang/include/clang/Basic/BuiltinsX86.def

+26
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,32 @@ TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_maskz, "V8xV8xV8xV8xUcIi", "ncV:128:", "
20142014
TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_mask3, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
20152015
TARGET_BUILTIN(__builtin_ia32_vfmsubsh3_mask3, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
20162016

2017+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2018+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2019+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2020+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2021+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2022+
TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2023+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2024+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2025+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2026+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2027+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2028+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2029+
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2030+
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2031+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2032+
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2033+
2034+
TARGET_BUILTIN(__builtin_ia32_vfmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2035+
TARGET_BUILTIN(__builtin_ia32_vfcmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
2036+
TARGET_BUILTIN(__builtin_ia32_vfmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2037+
TARGET_BUILTIN(__builtin_ia32_vfmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2038+
TARGET_BUILTIN(__builtin_ia32_vfmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2039+
TARGET_BUILTIN(__builtin_ia32_vfcmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
2040+
TARGET_BUILTIN(__builtin_ia32_vfcmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
2041+
TARGET_BUILTIN(__builtin_ia32_vfcmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
2042+
20172043
// generic select intrinsics
20182044
TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "ncV:128:", "avx512bw,avx512vl")
20192045
TARGET_BUILTIN(__builtin_ia32_selectb_256, "V32cUiV32cV32c", "ncV:256:", "avx512bw,avx512vl")

clang/include/clang/Basic/LangOptions.h

+3
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ class LangOptions : public LangOptionsBase {
462462
/// Return the OpenCL C or C++ version as a VersionTuple.
463463
VersionTuple getOpenCLVersionTuple() const;
464464

465+
/// Return the OpenCL version that kernel language is compatible with
466+
unsigned getOpenCLCompatibleVersion() const;
467+
465468
/// Return the OpenCL C or C++ for OpenCL language name and version
466469
/// as a string.
467470
std::string getOpenCLVersionString() const;

clang/include/clang/Basic/OpenCLOptions.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static inline OpenCLVersionID encodeOpenCLVersion(unsigned OpenCLVersion) {
5858
// mask.
5959
static inline bool isOpenCLVersionContainedInMask(const LangOptions &LO,
6060
unsigned Mask) {
61-
auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
61+
auto CLVer = LO.getOpenCLCompatibleVersion();
6262
OpenCLVersionID Code = encodeOpenCLVersion(CLVer);
6363
return Mask & Code;
6464
}
@@ -79,7 +79,7 @@ class OpenCLOptions {
7979
// the __opencl_c_program_scope_global_variables feature is supported
8080
// C++ for OpenCL inherits rule from OpenCL C v2.0.
8181
bool areProgramScopeVariablesSupported(const LangOptions &Opts) const {
82-
return Opts.OpenCLCPlusPlus || Opts.OpenCLVersion == 200 ||
82+
return Opts.getOpenCLCompatibleVersion() == 200 ||
8383
(Opts.OpenCLVersion == 300 &&
8484
isSupported("__opencl_c_program_scope_global_variables", Opts));
8585
}
@@ -115,8 +115,7 @@ class OpenCLOptions {
115115
// Is option available in OpenCL version \p LO.
116116
bool isAvailableIn(const LangOptions &LO) const {
117117
// In C++ mode all extensions should work at least as in v2.0.
118-
auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
119-
return CLVer >= Avail;
118+
return LO.getOpenCLCompatibleVersion() >= Avail;
120119
}
121120

122121
// Is core option in OpenCL version \p LO.

0 commit comments

Comments
 (0)