Skip to content

Commit 956bcf2

Browse files
committed
rebase
Created using spr 1.3.4
2 parents e7bce6d + 2502434 commit 956bcf2

File tree

226 files changed

+4999
-3677
lines changed

Some content is hidden

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

226 files changed

+4999
-3677
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
/clang/tools/clang-installapi/ @cyndyishida
142142

143143
# ExtractAPI
144-
/clang/**/ExtractAPI @daniel-grumberg
144+
/clang/**/ExtractAPI @daniel-grumberg @QuietMisdreavus
145145

146146
# DWARFLinker, dwarfutil, dsymutil
147147
/llvm/**/DWARFLinker/ @JDevlieghere

clang/docs/AMDGPUSupport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ Predefined Macros
5050
* - ``__AMDGCN_UNSAFE_FP_ATOMICS__``
5151
- Defined if unsafe floating-point atomics are allowed.
5252
* - ``__AMDGCN_WAVEFRONT_SIZE__``
53-
- Defines the wavefront size. Allowed values are 32 and 64 (deprecated).
53+
- Defines the wavefront size. Allowed values are 32 and 64.
5454
* - ``__AMDGCN_WAVEFRONT_SIZE``
55-
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated).
55+
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__``. To be deprecated.
5656
* - ``__HAS_FMAF__``
5757
- Defined if FMAF instruction is available (deprecated).
5858
* - ``__HAS_LDEXPF__``

clang/docs/HIPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Predefined Macros
178178

179179
Note that some architecture specific AMDGPU macros will have default values when
180180
used from the HIP host compilation. Other :doc:`AMDGPU macros <AMDGPUSupport>`
181-
like ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated) will default to 64 for example.
181+
like ``__AMDGCN_WAVEFRONT_SIZE__`` will default to 64 for example.
182182

183183
Compilation Modes
184184
=================

clang/docs/LanguageExtensions.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5974,3 +5974,31 @@ Clang guarantees the following behaviors:
59745974
padding bits are initialized to zero.
59755975
59765976
Currently, the above extension only applies to C source code, not C++.
5977+
5978+
5979+
Empty Objects in C
5980+
==================
5981+
The declaration of a structure or union type which has no named members is
5982+
undefined behavior (C23 and earlier) or implementation-defined behavior (C2y).
5983+
Clang allows the declaration of a structure or union type with no named members
5984+
in all C language modes. `sizeof` for such a type returns `0`, which is
5985+
different behavior than in C++ (where the size of such an object is typically
5986+
`1`).
5987+
5988+
5989+
Qualified function types in C
5990+
=============================
5991+
Declaring a function with a qualified type in C is undefined behavior (C23 and
5992+
earlier) or implementation-defined behavior (C2y). Clang allows a function type
5993+
to be specified with the ``const`` and ``volatile`` qualifiers, but ignores the
5994+
qualifications.
5995+
5996+
.. code-block:: c
5997+
5998+
typedef int f(void);
5999+
const volatile f func; // Qualifier on function type has no effect.
6000+
6001+
6002+
Note, Clang does not allow an ``_Atomic`` function type because
6003+
of explicit constraints against atomically qualified (arrays and) function
6004+
types.

clang/docs/ReleaseNotes.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,22 @@ C2y Feature Support
298298
paper adopts Clang's existing practice, so there were no changes to compiler
299299
behavior.
300300

301+
- Implemented support for `N3341 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3341.pdf>`_
302+
which makes empty structure and union objects implementation-defined in C.
303+
``-Wgnu-empty-struct`` will be emitted in C23 and earlier modes because the
304+
behavior is a conforming GNU extension in those modes, but will no longer
305+
have an effect in C2y mode.
306+
307+
- Updated conformance for `N3342 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3342.pdf>`_
308+
which made qualified function types implementation-defined rather than
309+
undefined. Clang has always accepted ``const`` and ``volatile`` qualified
310+
function types by ignoring the qualifiers.
311+
312+
- Updated conformance for `N3346 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3346.pdf>`_
313+
which changes some undefined behavior around initialization to instead be
314+
constraint violations. This paper adopts Clang's existing practice, so there
315+
were no changes to compiler behavior.
316+
301317
C23 Feature Support
302318
^^^^^^^^^^^^^^^^^^^
303319

clang/include/clang/AST/StmtOpenACC.h

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class OpenACCAssociatedStmtConstruct : public OpenACCConstructStmt {
114114
}
115115
};
116116

117-
class OpenACCLoopConstruct;
118117
/// This class represents a compute construct, representing a 'Kind' of
119118
/// `parallel', 'serial', or 'kernel'. These constructs are associated with a
120119
/// 'structured block', defined as:
@@ -183,8 +182,7 @@ class OpenACCComputeConstruct final
183182
static OpenACCComputeConstruct *
184183
Create(const ASTContext &C, OpenACCDirectiveKind K, SourceLocation BeginLoc,
185184
SourceLocation DirectiveLoc, SourceLocation EndLoc,
186-
ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock,
187-
ArrayRef<OpenACCLoopConstruct *> AssociatedLoopConstructs);
185+
ArrayRef<const OpenACCClause *> Clauses, Stmt *StructuredBlock);
188186

189187
Stmt *getStructuredBlock() { return getAssociatedStmt(); }
190188
const Stmt *getStructuredBlock() const {
@@ -198,12 +196,10 @@ class OpenACCLoopConstruct final
198196
: public OpenACCAssociatedStmtConstruct,
199197
public llvm::TrailingObjects<OpenACCLoopConstruct,
200198
const OpenACCClause *> {
201-
// The compute construct this loop is associated with, or nullptr if this is
202-
// an orphaned loop construct, or if it hasn't been set yet. Because we
203-
// construct the directives at the end of their statement, the 'parent'
204-
// construct is not yet available at the time of construction, so this needs
205-
// to be set 'later'.
206-
const OpenACCComputeConstruct *ParentComputeConstruct = nullptr;
199+
// The compute/combined construct kind this loop is associated with, or
200+
// invalid if this is an orphaned loop construct.
201+
OpenACCDirectiveKind ParentComputeConstructKind =
202+
OpenACCDirectiveKind::Invalid;
207203

208204
friend class ASTStmtWriter;
209205
friend class ASTStmtReader;
@@ -212,15 +208,9 @@ class OpenACCLoopConstruct final
212208

213209
OpenACCLoopConstruct(unsigned NumClauses);
214210

215-
OpenACCLoopConstruct(SourceLocation Start, SourceLocation DirLoc,
216-
SourceLocation End,
211+
OpenACCLoopConstruct(OpenACCDirectiveKind ParentKind, SourceLocation Start,
212+
SourceLocation DirLoc, SourceLocation End,
217213
ArrayRef<const OpenACCClause *> Clauses, Stmt *Loop);
218-
void setLoop(Stmt *Loop);
219-
220-
void setParentComputeConstruct(OpenACCComputeConstruct *CC) {
221-
assert(!ParentComputeConstruct && "Parent already set?");
222-
ParentComputeConstruct = CC;
223-
}
224214

225215
public:
226216
static bool classof(const Stmt *T) {
@@ -231,9 +221,9 @@ class OpenACCLoopConstruct final
231221
unsigned NumClauses);
232222

233223
static OpenACCLoopConstruct *
234-
Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation DirLoc,
235-
SourceLocation EndLoc, ArrayRef<const OpenACCClause *> Clauses,
236-
Stmt *Loop);
224+
Create(const ASTContext &C, OpenACCDirectiveKind ParentKind,
225+
SourceLocation BeginLoc, SourceLocation DirLoc, SourceLocation EndLoc,
226+
ArrayRef<const OpenACCClause *> Clauses, Stmt *Loop);
237227

238228
Stmt *getLoop() { return getAssociatedStmt(); }
239229
const Stmt *getLoop() const {
@@ -246,10 +236,11 @@ class OpenACCLoopConstruct final
246236
/// loop construct is the nearest compute construct that lexically contains
247237
/// the loop construct.
248238
bool isOrphanedLoopConstruct() const {
249-
return ParentComputeConstruct == nullptr;
239+
return ParentComputeConstructKind == OpenACCDirectiveKind::Invalid;
250240
}
251-
const OpenACCComputeConstruct *getParentComputeConstruct() const {
252-
return ParentComputeConstruct;
241+
242+
OpenACCDirectiveKind getParentComputeConstructKind() const {
243+
return ParentComputeConstructKind;
253244
}
254245
};
255246
} // namespace clang

clang/include/clang/Basic/AttrDocs.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3858,8 +3858,7 @@ def LifetimeBoundDocs : Documentation {
38583858
The ``lifetimebound`` attribute on a function parameter or implicit object
38593859
parameter indicates that objects that are referred to by that parameter may
38603860
also be referred to by the return value of the annotated function (or, for a
3861-
parameter of a constructor, by the value of the constructed object). It is only
3862-
supported in C++.
3861+
parameter of a constructor, by the value of the constructed object).
38633862

38643863
By default, a reference is considered to refer to its referenced object, a
38653864
pointer is considered to refer to its pointee, a ``std::initializer_list<T>``

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6241,8 +6241,9 @@ def err_typecheck_negative_array_size : Error<"array size is negative">;
62416241
def warn_typecheck_function_qualifiers_ignored : Warning<
62426242
"'%0' qualifier on function type %1 has no effect">,
62436243
InGroup<IgnoredQualifiers>;
6244-
def warn_typecheck_function_qualifiers_unspecified : Warning<
6245-
"'%0' qualifier on function type %1 has unspecified behavior">;
6244+
def ext_typecheck_function_qualifiers_unspecified : ExtWarn<
6245+
"'%0' qualifier on function type %1 has no effect and is a Clang extension">,
6246+
InGroup<IgnoredQualifiers>;
62466247
def warn_typecheck_reference_qualifiers : Warning<
62476248
"'%0' qualifier on reference type %1 has no effect">,
62486249
InGroup<IgnoredReferenceQualifiers>;

clang/include/clang/Basic/MacroBuilder.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,8 @@ class MacroBuilder {
2626
MacroBuilder(raw_ostream &Output) : Out(Output) {}
2727

2828
/// Append a \#define line for macro of the form "\#define Name Value\n".
29-
/// If DeprecationMsg is provided, also append a pragma to deprecate the
30-
/// defined macro.
31-
void defineMacro(const Twine &Name, const Twine &Value = "1",
32-
Twine DeprecationMsg = "") {
29+
void defineMacro(const Twine &Name, const Twine &Value = "1") {
3330
Out << "#define " << Name << ' ' << Value << '\n';
34-
if (!DeprecationMsg.isTriviallyEmpty())
35-
Out << "#pragma clang deprecated(" << Name << ", \"" << DeprecationMsg
36-
<< "\")\n";
3731
}
3832

3933
/// Append a \#undef line for Name. Name should be of the form XXX

clang/include/clang/Basic/arm_sve.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = "sme2,lut,bf16" in {
19621962
////////////////////////////////////////////////////////////////////////////////
19631963
// SVE2 - Optional
19641964

1965-
let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
1965+
let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
19661966
def SVAESD : SInst<"svaesd[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aesd", [IsOverloadNone]>;
19671967
def SVAESIMC : SInst<"svaesimc[_{d}]", "dd", "Uc", MergeNone, "aarch64_sve_aesimc", [IsOverloadNone]>;
19681968
def SVAESE : SInst<"svaese[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aese", [IsOverloadNone]>;

0 commit comments

Comments
 (0)