Skip to content

Commit 3fc274b

Browse files
Merge branch 'main' into ftm-smart-ptr-for-overwrite
2 parents 160a33f + 3f3953a commit 3fc274b

File tree

469 files changed

+15654
-5106
lines changed

Some content is hidden

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

469 files changed

+15654
-5106
lines changed

bolt/lib/Core/HashUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ std::string hashBlockLoose(BinaryContext &BC, const BinaryBasicBlock &BB) {
145145
continue;
146146
}
147147

148-
std::string Mnemonic = BC.InstPrinter->getMnemonic(&Inst).first;
148+
std::string Mnemonic = BC.InstPrinter->getMnemonic(Inst).first;
149149
llvm::erase_if(Mnemonic, [](unsigned char ch) { return std::isspace(ch); });
150150
Opcodes.insert(Mnemonic);
151151
}

clang/Maintainers.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@ SYCL conformance
295295
| alexey.bader\@intel.com (email), bader (Phabricator), bader (GitHub)
296296
297297

298+
Issue Triage
299+
~~~~~~~~~~~~
300+
| Shafik Yaghmour
301+
| shafik.yaghmour\@intel.com (email), shafik (GitHub), shafik.yaghmour (Discord), shafik (Discourse)
302+
303+
| hstk30
304+
| hanwei62\@huawei.com (email), hstk30-hw (GitHub), hstk30(Discord), hstk30 (Discourse)
305+
306+
298307
Inactive Maintainers
299308
====================
300309
The following people have graciously spent time performing maintainership

clang/docs/APINotes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,31 @@ declaration kind), all of which are optional:
169169
to ``SWIFT_RETURNS_INDEPENDENT_VALUE``) or ``computed_property`` (equivalent to
170170
``SWIFT_COMPUTED_PROPERTY``).
171171

172+
::
173+
174+
Tags:
175+
- Name: OwnedStorage
176+
SwiftImportAs: owned
177+
178+
:SwiftRetainOp, SwiftReleaseOp:
179+
180+
Controls the lifetime operations of a class which uses custom reference
181+
counting. The class must be annotated as a reference type using
182+
``SwiftImportAs: reference``. The values are either names of global functions,
183+
each taking a single parameter of a pointer type, or ``immortal`` for a type
184+
that is considered alive for the duration of the program.
185+
172186
::
173187

174188
Tags:
175189
- Name: RefCountedStorage
176190
SwiftImportAs: reference
177191
SwiftReleaseOp: RCRelease
178192
SwiftRetainOp: RCRetain
193+
- Name: ImmortalSingleton
194+
SwiftImportAs: reference
195+
SwiftReleaseOp: immortal
196+
SwiftRetainOp: immortal
179197

180198
:SwiftCopyable:
181199

clang/docs/LanguageExtensions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3979,9 +3979,9 @@ standard:
39793979
- ``4`` - to nearest, ties away from zero
39803980
The effect of passing some other value to ``__builtin_flt_rounds`` is
39813981
implementation-defined. ``__builtin_set_flt_rounds`` is currently only supported
3982-
to work on x86, x86_64, Arm and AArch64 targets. These builtins read and modify
3983-
the floating-point environment, which is not always allowed and may have unexpected
3984-
behavior. Please see the section on `Accessing the floating point environment <https://clang.llvm.org/docs/UsersManual.html#accessing-the-floating-point-environment>`_ for more information.
3982+
to work on x86, x86_64, powerpc, powerpc64, Arm and AArch64 targets. These builtins
3983+
read and modify the floating-point environment, which is not always allowed and may
3984+
have unexpected behavior. Please see the section on `Accessing the floating point environment <https://clang.llvm.org/docs/UsersManual.html#accessing-the-floating-point-environment>`_ for more information.
39853985
39863986
String builtins
39873987
---------------

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ Bug Fixes to C++ Support
559559
- Fixed an assertion failure in debug mode, and potential crashes in release mode, when
560560
diagnosing a failed cast caused indirectly by a failed implicit conversion to the type of the constructor parameter.
561561
- Fixed an assertion failure by adjusting integral to boolean vector conversions (#GH108326)
562+
- Fixed a crash when mixture of designated and non-designated initializers in union. (#GH113855)
562563
- Fixed an issue deducing non-type template arguments of reference type. (#GH73460)
563564
- Fixed an issue in constraint evaluation, where type constraints on the lambda expression
564565
containing outer unexpanded parameters were not correctly expanded. (#GH101754)
@@ -871,6 +872,14 @@ Sanitizers
871872
This new flag should allow those projects to enable integer sanitizers with
872873
less noise.
873874

875+
- Arithmetic overflow sanitizers ``-fsanitize=signed-integer-overflow`` and
876+
``-fsanitize=unsigned-integer-overflow`` as well as the implicit integer
877+
truncation sanitizers ``-fsanitize=implicit-signed-integer-truncation`` and
878+
``-fsanitize=implicit-unsigned-integer-truncation`` now properly support the
879+
"type" prefix within `Sanitizer Special Case Lists (SSCL)
880+
<https://clang.llvm.org/docs/SanitizerSpecialCaseList.html>`_. See that link
881+
for examples.
882+
874883
Python Binding Changes
875884
----------------------
876885
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.

clang/docs/SanitizerSpecialCaseList.rst

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ file at compile-time.
1515
Goal and usage
1616
==============
1717

18-
Users of sanitizer tools, such as :doc:`AddressSanitizer`, :doc:`ThreadSanitizer`
19-
or :doc:`MemorySanitizer` may want to disable or alter some checks for
20-
certain source-level entities to:
18+
Users of sanitizer tools, such as :doc:`AddressSanitizer`,
19+
:doc:`ThreadSanitizer`, :doc:`MemorySanitizer` or :doc:`UndefinedBehaviorSanitizer`
20+
may want to disable or alter some checks for certain source-level entities to:
2121

2222
* speedup hot function, which is known to be correct;
2323
* ignore a function that does some low-level magic (e.g. walks through the
@@ -48,6 +48,61 @@ Example
4848
$ clang -fsanitize=address -fsanitize-ignorelist=ignorelist.txt foo.c ; ./a.out
4949
# No error report here.
5050
51+
Usage with UndefinedBehaviorSanitizer
52+
=====================================
53+
54+
The arithmetic overflow sanitizers ``unsigned-integer-overflow`` and
55+
``signed-integer-overflow`` as well as the implicit integer truncation
56+
sanitizers ``implicit-signed-integer-truncation`` and
57+
``implicit-unsigned-integer-truncation`` support the ability to adjust
58+
instrumentation based on type.
59+
60+
By default, supported sanitizers will have their instrumentation disabled for
61+
types specified within an ignorelist.
62+
63+
.. code-block:: bash
64+
65+
$ cat foo.c
66+
void foo() {
67+
int a = 2147483647; // INT_MAX
68+
++a; // Normally, an overflow with -fsanitize=signed-integer-overflow
69+
}
70+
$ cat ignorelist.txt
71+
[signed-integer-overflow]
72+
type:int
73+
$ clang -fsanitize=signed-integer-overflow -fsanitize-ignorelist=ignorelist.txt foo.c ; ./a.out
74+
# no signed-integer-overflow error
75+
76+
For example, supplying the above ``ignorelist.txt`` to
77+
``-fsanitize-ignorelist=ignorelist.txt`` disables overflow sanitizer
78+
instrumentation for arithmetic operations containing values of type ``int``.
79+
80+
The ``=sanitize`` category is also supported. Any types assigned to the
81+
``sanitize`` category will have their sanitizer instrumentation remain. If the
82+
same type appears within or across ignorelists with different categories the
83+
``sanitize`` category takes precedence -- regardless of order.
84+
85+
With this, one may disable instrumentation for some or all types and
86+
specifically allow instrumentation for one or many types -- including types
87+
created via ``typedef``. This is a way to achieve a sort of "allowlist" for
88+
supported sanitizers.
89+
90+
.. code-block:: bash
91+
92+
$ cat ignorelist.txt
93+
[implicit-signed-integer-truncation]
94+
type:*
95+
type:T=sanitize
96+
97+
$ cat foo.c
98+
typedef char T;
99+
typedef char U;
100+
void foo(int toobig) {
101+
T a = toobig; // instrumented
102+
U b = toobig; // not instrumented
103+
char c = toobig; // also not instrumented
104+
}
105+
51106
Format
52107
======
53108

clang/include/clang/AST/ASTContext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
838838

839839
const NoSanitizeList &getNoSanitizeList() const { return *NoSanitizeL; }
840840

841+
bool isTypeIgnoredBySanitizer(const SanitizerMask &Mask,
842+
const QualType &Ty) const;
843+
841844
const XRayFunctionFilter &getXRayFilter() const {
842845
return *XRayFilter;
843846
}

clang/include/clang/Basic/BuiltinsLoongArchLASX.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ TARGET_BUILTIN(__builtin_lasx_xvrepli_d, "V4LLiIi", "nc", "lasx")
368368

369369
TARGET_BUILTIN(__builtin_lasx_xvand_v, "V32UcV32UcV32Uc", "nc", "lasx")
370370
TARGET_BUILTIN(__builtin_lasx_xvor_v, "V32UcV32UcV32Uc", "nc", "lasx")
371-
TARGET_BUILTIN(__builtin_lasx_xvxor_v, "V32ScV32ScV32Sc", "nc", "lasx")
371+
TARGET_BUILTIN(__builtin_lasx_xvxor_v, "V32UcV32UcV32Uc", "nc", "lasx")
372372
TARGET_BUILTIN(__builtin_lasx_xvnor_v, "V32UcV32UcV32Uc", "nc", "lasx")
373373
TARGET_BUILTIN(__builtin_lasx_xvandn_v, "V32UcV32UcV32Uc", "nc", "lasx")
374374
TARGET_BUILTIN(__builtin_lasx_xvorn_v, "V32ScV32ScV32Sc", "nc", "lasx")
@@ -935,7 +935,7 @@ TARGET_BUILTIN(__builtin_lasx_xvilvh_h, "V16sV16sV16s", "nc", "lasx")
935935
TARGET_BUILTIN(__builtin_lasx_xvilvh_w, "V8iV8iV8i", "nc", "lasx")
936936
TARGET_BUILTIN(__builtin_lasx_xvilvh_d, "V4LLiV4LLiV4LLi", "nc", "lasx")
937937

938-
TARGET_BUILTIN(__builtin_lasx_xvshuf_b, "V32UcV32UcV32UcV32Uc", "nc", "lasx")
938+
TARGET_BUILTIN(__builtin_lasx_xvshuf_b, "V32ScV32ScV32ScV32Sc", "nc", "lasx")
939939

940940
TARGET_BUILTIN(__builtin_lasx_xvshuf_h, "V16sV16sV16sV16s", "nc", "lasx")
941941
TARGET_BUILTIN(__builtin_lasx_xvshuf_w, "V8iV8iV8iV8i", "nc", "lasx")

clang/include/clang/Basic/BuiltinsLoongArchLSX.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ TARGET_BUILTIN(__builtin_lsx_vrepli_d, "V2LLiIi", "nc", "lsx")
352352

353353
TARGET_BUILTIN(__builtin_lsx_vand_v, "V16UcV16UcV16Uc", "nc", "lsx")
354354
TARGET_BUILTIN(__builtin_lsx_vor_v, "V16UcV16UcV16Uc", "nc", "lsx")
355-
TARGET_BUILTIN(__builtin_lsx_vxor_v, "V16ScV16ScV16Sc", "nc", "lsx")
355+
TARGET_BUILTIN(__builtin_lsx_vxor_v, "V16UcV16UcV16Uc", "nc", "lsx")
356356
TARGET_BUILTIN(__builtin_lsx_vnor_v, "V16UcV16UcV16Uc", "nc", "lsx")
357357
TARGET_BUILTIN(__builtin_lsx_vandn_v, "V16UcV16UcV16Uc", "nc", "lsx")
358358
TARGET_BUILTIN(__builtin_lsx_vorn_v, "V16ScV16ScV16Sc", "nc", "lsx")
@@ -910,7 +910,7 @@ TARGET_BUILTIN(__builtin_lsx_vilvh_h, "V8sV8sV8s", "nc", "lsx")
910910
TARGET_BUILTIN(__builtin_lsx_vilvh_w, "V4iV4iV4i", "nc", "lsx")
911911
TARGET_BUILTIN(__builtin_lsx_vilvh_d, "V2LLiV2LLiV2LLi", "nc", "lsx")
912912

913-
TARGET_BUILTIN(__builtin_lsx_vshuf_b, "V16UcV16UcV16UcV16Uc", "nc", "lsx")
913+
TARGET_BUILTIN(__builtin_lsx_vshuf_b, "V16ScV16ScV16ScV16Sc", "nc", "lsx")
914914

915915
TARGET_BUILTIN(__builtin_lsx_vshuf_h, "V8sV8sV8sV8s", "nc", "lsx")
916916
TARGET_BUILTIN(__builtin_lsx_vshuf_w, "V4iV4iV4iV4i", "nc", "lsx")

clang/lib/AST/ASTContext.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,15 @@ ASTContext::getCanonicalTemplateTemplateParmDecl(
831831
return CanonTTP;
832832
}
833833

834+
/// Check if a type can have its sanitizer instrumentation elided based on its
835+
/// presence within an ignorelist.
836+
bool ASTContext::isTypeIgnoredBySanitizer(const SanitizerMask &Mask,
837+
const QualType &Ty) const {
838+
std::string TyName = Ty.getUnqualifiedType().getAsString(getPrintingPolicy());
839+
return NoSanitizeL->containsType(Mask, TyName) &&
840+
!NoSanitizeL->containsType(Mask, TyName, "sanitize");
841+
}
842+
834843
TargetCXXABI::Kind ASTContext::getCXXABIKind() const {
835844
auto Kind = getTargetInfo().getCXXABI().getKind();
836845
return getLangOpts().CXXABI.value_or(Kind);

0 commit comments

Comments
 (0)