Skip to content

Commit 377af0d

Browse files
authored
Merge branch 'llvm:main' into gh-101657
2 parents 9660ecd + de89575 commit 377af0d

File tree

1,237 files changed

+29440
-20894
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,237 files changed

+29440
-20894
lines changed

bolt/lib/Passes/AsmDump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void dumpFunction(const BinaryFunction &BF) {
143143
std::move(MCEInstance.MCE), std::move(MAB)));
144144
AsmStreamer->initSections(true, *BC.STI);
145145
std::unique_ptr<TargetMachine> TM(BC.TheTarget->createTargetMachine(
146-
BC.TripleName, "", "", TargetOptions(), std::nullopt));
146+
*BC.TheTriple, "", "", TargetOptions(), std::nullopt));
147147
std::unique_ptr<AsmPrinter> MAP(
148148
BC.TheTarget->createAsmPrinter(*TM, std::move(AsmStreamer)));
149149

clang/AreaTeamMembers.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
This is a list of the current Clang Area Team members.
2+
3+
Chair
4+
-----
5+
Aaron Ballman
6+
[email protected] (email), AaronBallman (Discourse), AaronBallman (GitHub), AaronBallman (Discord)
7+
8+
Secretary
9+
---------
10+
Reid Kleckner
11+
[email protected] (email), rnk (Discourse), rnk (GitHub), rnk (Discord)
12+
13+
Other Members
14+
-------------
15+
Eli Friedman
16+
[email protected]> (email), efriedma-quic (Discourse), efriedma-quic (GitHub)
17+

clang/Maintainers.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Clang Maintainers
44

55
This file is a list of the
66
`maintainers <https://llvm.org/docs/DeveloperPolicy.html#maintainers>`_ for
7-
Clang.
7+
Clang. The list of current Clang Area Team members can be found
8+
`here <https://github.com/llvm/llvm-project/blob/main/clang/AreaTeamMembers.txt>`_.
89

910
.. contents::
1011
:depth: 2

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ of different sizes and signs is forbidden in binary and ternary builtins.
786786
T __builtin_elementwise_bitreverse(T x) return the integer represented after reversing the bits of x integer types
787787
T __builtin_elementwise_exp(T x) returns the base-e exponential, e^x, of the specified value floating point types
788788
T __builtin_elementwise_exp2(T x) returns the base-2 exponential, 2^x, of the specified value floating point types
789+
T __builtin_elementwise_exp10(T x) returns the base-10 exponential, 10^x, of the specified value floating point types
789790

790791
T __builtin_elementwise_sqrt(T x) return the square root of a floating-point number floating point types
791792
T __builtin_elementwise_roundeven(T x) round x to the nearest integer value in floating point format, floating point types

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Non-comprehensive list of changes in this release
128128
-------------------------------------------------
129129

130130
- Support parsing the `cc` operand modifier and alias it to the `c` modifier (#GH127719).
131+
- Added `__builtin_elementwise_exp10`.
131132

132133
New Compiler Flags
133134
------------------
@@ -235,8 +236,6 @@ Improvements to Clang's diagnostics
235236
under the subgroup ``-Wunsafe-buffer-usage-in-libc-call``.
236237
- Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
237238
``-Wno-error=parentheses``.
238-
- Adds an error diagnostic for out of bounds vector accesses; produces an error
239-
for compile time statically provable out of bounds vector accesses.
240239
- The ``-Wshift-bool`` warning has been added to warn about shifting a boolean. (#GH28334)
241240
- Fixed diagnostics adding a trailing ``::`` when printing some source code
242241
constructs, like base classes.
@@ -293,6 +292,7 @@ Bug Fixes to Attribute Support
293292
Bug Fixes to C++ Support
294293
^^^^^^^^^^^^^^^^^^^^^^^^
295294

295+
- Clang now diagnoses copy constructors taking the class by value in template instantiations. (#GH130866)
296296
- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)
297297
- Clang now prints the correct instantiation context for diagnostics suppressed
298298
by template argument deduction.
@@ -309,6 +309,7 @@ Bug Fixes to C++ Support
309309
not in the last position.
310310
- Clang now correctly parses ``if constexpr`` expressions in immediate function context. (#GH123524)
311311
- Fixed an assertion failure affecting code that uses C++23 "deducing this". (#GH130272)
312+
- Clang now properly instantiates destructors for initialized members within non-delegating constructors. (#GH93251)
312313

313314
Bug Fixes to AST Handling
314315
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -358,7 +359,9 @@ Android Support
358359
Windows Support
359360
^^^^^^^^^^^^^^^
360361

361-
- Clang now supports MSVC vector deleting destructors (GH19772).
362+
- Clang now defines ``_CRT_USE_BUILTIN_OFFSETOF`` macro in MSVC-compatible mode,
363+
which makes ``offsetof`` provided by Microsoft's ``<stddef.h>`` to be defined
364+
correctly. (#GH59689)
362365

363366
LoongArch Support
364367
^^^^^^^^^^^^^^^^^

clang/docs/analyzer/checkers.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,6 +3476,24 @@ Limitations:
34763476
alpha.WebKit
34773477
^^^^^^^^^^^^
34783478
3479+
alpha.webkit.ForwardDeclChecker
3480+
"""""""""""""""""""""""""""""""
3481+
Check for local variables, member variables, and function arguments that are forward declared.
3482+
3483+
.. code-block:: cpp
3484+
3485+
struct Obj;
3486+
Obj* provide();
3487+
3488+
struct Foo {
3489+
Obj* ptr; // warn
3490+
};
3491+
3492+
void foo() {
3493+
Obj* obj = provide(); // warn
3494+
consume(obj); // warn
3495+
}
3496+
34793497
.. _alpha-webkit-NoUncheckedPtrMemberChecker:
34803498
34813499
alpha.webkit.MemoryUnsafeCastChecker
@@ -3642,6 +3660,12 @@ The goal of this rule is to make sure that lifetime of any dynamically allocated
36423660
36433661
The rules of when to use and not to use CheckedPtr / CheckedRef are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
36443662
3663+
alpha.webkit.UnretainedCallArgsChecker
3664+
""""""""""""""""""""""""""""""""""""""
3665+
The goal of this rule is to make sure that lifetime of any dynamically allocated NS or CF objects passed as a call argument keeps its memory region past the end of the call. This applies to call to any function, method, lambda, function pointer or functor. NS or CF objects aren't supposed to be allocated on stack so we check arguments for parameters of raw pointers and references to unretained types.
3666+
3667+
The rules of when to use and not to use RetainPtr are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
3668+
36453669
alpha.webkit.UncountedLocalVarsChecker
36463670
""""""""""""""""""""""""""""""""""""""
36473671
The goal of this rule is to make sure that any uncounted local variable is backed by a ref-counted object with lifetime that is strictly larger than the scope of the uncounted local variable. To be on the safe side we require the scope of an uncounted variable to be embedded in the scope of ref-counted object that backs it.
@@ -3773,6 +3797,26 @@ Here are some examples of situations that we warn about as they *might* be poten
37733797
NSObject* unretained = retained.get(); // warn
37743798
}
37753799
3800+
webkit.RetainPtrCtorAdoptChecker
3801+
""""""""""""""""""""""""""""""""
3802+
The goal of this rule is to make sure the constructor of RetainPtr as well as adoptNS and adoptCF are used correctly.
3803+
When creating a RetainPtr with +1 semantics, adoptNS or adoptCF should be used, and in +0 semantics, RetainPtr constructor should be used.
3804+
Warn otherwise.
3805+
3806+
These are examples of cases that we consider correct:
3807+
3808+
.. code-block:: cpp
3809+
3810+
RetainPtr ptr = adoptNS([[NSObject alloc] init]); // ok
3811+
RetainPtr ptr = CGImageGetColorSpace(image); // ok
3812+
3813+
Here are some examples of cases that we consider incorrect use of RetainPtr constructor and adoptCF
3814+
3815+
.. code-block:: cpp
3816+
3817+
RetainPtr ptr = [[NSObject alloc] init]; // warn
3818+
auto ptr = adoptCF(CGImageGetColorSpace(image)); // warn
3819+
37763820
Debug Checkers
37773821
---------------
37783822

clang/include/clang/AST/Expr.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,18 +3005,6 @@ class CallExpr : public Expr {
30053005
FPOptionsOverride FPFeatures, unsigned MinNumArgs = 0,
30063006
ADLCallKind UsesADL = NotADL);
30073007

3008-
/// Create a temporary call expression with no arguments in the memory
3009-
/// pointed to by Mem. Mem must points to at least sizeof(CallExpr)
3010-
/// + sizeof(Stmt *) bytes of storage, aligned to alignof(CallExpr):
3011-
///
3012-
/// \code{.cpp}
3013-
/// alignas(CallExpr) char Buffer[sizeof(CallExpr) + sizeof(Stmt *)];
3014-
/// CallExpr *TheCall = CallExpr::CreateTemporary(Buffer, etc);
3015-
/// \endcode
3016-
static CallExpr *CreateTemporary(void *Mem, Expr *Fn, QualType Ty,
3017-
ExprValueKind VK, SourceLocation RParenLoc,
3018-
ADLCallKind UsesADL = NotADL);
3019-
30203008
/// Create an empty call expression, for deserialization.
30213009
static CallExpr *CreateEmpty(const ASTContext &Ctx, unsigned NumArgs,
30223010
bool HasFPFeatures, EmptyShell Empty);

clang/include/clang/AST/VTableBuilder.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class VTableComponent {
150150

151151
bool isRTTIKind() const { return isRTTIKind(getKind()); }
152152

153-
GlobalDecl getGlobalDecl(bool HasVectorDeletingDtors) const {
153+
GlobalDecl getGlobalDecl() const {
154154
assert(isUsedFunctionPointerKind() &&
155155
"GlobalDecl can be created only from virtual function");
156156

@@ -161,9 +161,7 @@ class VTableComponent {
161161
case CK_CompleteDtorPointer:
162162
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Complete);
163163
case CK_DeletingDtorPointer:
164-
return GlobalDecl(DtorDecl, (HasVectorDeletingDtors)
165-
? CXXDtorType::Dtor_VectorDeleting
166-
: CXXDtorType::Dtor_Deleting);
164+
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Deleting);
167165
case CK_VCallOffset:
168166
case CK_VBaseOffset:
169167
case CK_OffsetToTop:

clang/include/clang/Basic/ABI.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ enum CXXCtorType {
3131

3232
/// C++ destructor types.
3333
enum CXXDtorType {
34-
Dtor_Deleting, ///< Deleting dtor
35-
Dtor_Complete, ///< Complete object dtor
36-
Dtor_Base, ///< Base object dtor
37-
Dtor_Comdat, ///< The COMDAT used for dtors
38-
Dtor_VectorDeleting ///< Vector deleting dtor
34+
Dtor_Deleting, ///< Deleting dtor
35+
Dtor_Complete, ///< Complete object dtor
36+
Dtor_Base, ///< Base object dtor
37+
Dtor_Comdat ///< The COMDAT used for dtors
3938
};
4039

4140
} // end namespace clang

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,12 @@ def ElementwiseExp2 : Builtin {
13401340
let Prototype = "void(...)";
13411341
}
13421342

1343+
def ElementwiseExp10 : Builtin {
1344+
let Spellings = ["__builtin_elementwise_exp10"];
1345+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1346+
let Prototype = "void(...)";
1347+
}
1348+
13431349
def ElementwiseFloor : Builtin {
13441350
let Spellings = ["__builtin_elementwise_floor"];
13451351
let Attributes = [NoThrow, Const, CustomTypeChecking];

0 commit comments

Comments
 (0)