Skip to content

Commit debfbf0

Browse files
authored
Merge branch 'main' into task_mergeable
2 parents 94c9964 + 7767aa4 commit debfbf0

File tree

469 files changed

+12414
-6800
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

+12414
-6800
lines changed

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/ReleaseNotes.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,9 @@ Sanitizers
872872
This new flag should allow those projects to enable integer sanitizers with
873873
less noise.
874874

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
875+
- ``-fsanitize=signed-integer-overflow``, ``-fsanitize=unsigned-integer-overflow``,
876+
``-fsanitize=implicit-signed-integer-truncation``, ``-fsanitize=implicit-unsigned-integer-truncation``,
877+
``-fsanitize=enum`` now properly support the
879878
"type" prefix within `Sanitizer Special Case Lists (SSCL)
880879
<https://clang.llvm.org/docs/SanitizerSpecialCaseList.html>`_. See that link
881880
for examples.

clang/docs/SanitizerSpecialCaseList.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Goal and usage
1616
==============
1717

1818
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:
19+
:doc:`HardwareAssistedAddressSanitizerDesign`, :doc:`ThreadSanitizer`,
20+
:doc:`MemorySanitizer` or :doc:`UndefinedBehaviorSanitizer` may want to disable
21+
or alter some checks for certain source-level entities to:
2122

2223
* speedup hot function, which is known to be correct;
2324
* ignore a function that does some low-level magic (e.g. walks through the
@@ -51,11 +52,10 @@ Example
5152
Usage with UndefinedBehaviorSanitizer
5253
=====================================
5354

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.
55+
``unsigned-integer-overflow``, ``signed-integer-overflow``,
56+
``implicit-signed-integer-truncation``,
57+
``implicit-unsigned-integer-truncation``, and ``enum`` sanitizers support the
58+
ability to adjust instrumentation based on type.
5959

6060
By default, supported sanitizers will have their instrumentation disabled for
6161
types specified within an ignorelist.

clang/docs/analyzer/checkers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3459,8 +3459,8 @@ Raw pointers and references to an object which supports CheckedPtr or CheckedRef
34593459
.. code-block:: cpp
34603460
34613461
struct CheckableObj {
3462-
void incrementPtrCount() {}
3463-
void decrementPtrCount() {}
3462+
void incrementCheckedPtrCount() {}
3463+
void decrementCheckedPtrCount() {}
34643464
};
34653465
34663466
struct Foo {

clang/include/clang/APINotes/Types.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,24 @@ class ParamInfo : public VariableInfo {
425425
LLVM_PREFERRED_TYPE(bool)
426426
unsigned NoEscape : 1;
427427

428+
/// Whether lifetimebound was specified.
429+
LLVM_PREFERRED_TYPE(bool)
430+
unsigned LifetimeboundSpecified : 1;
431+
432+
/// Whether the this parameter has the 'lifetimebound' attribute.
433+
LLVM_PREFERRED_TYPE(bool)
434+
unsigned Lifetimebound : 1;
435+
428436
/// A biased RetainCountConventionKind, where 0 means "unspecified".
429437
///
430438
/// Only relevant for out-parameters.
431439
unsigned RawRetainCountConvention : 3;
432440

433441
public:
434442
ParamInfo()
435-
: NoEscapeSpecified(false), NoEscape(false), RawRetainCountConvention() {}
443+
: NoEscapeSpecified(false), NoEscape(false),
444+
LifetimeboundSpecified(false), Lifetimebound(false),
445+
RawRetainCountConvention() {}
436446

437447
std::optional<bool> isNoEscape() const {
438448
if (!NoEscapeSpecified)
@@ -444,6 +454,16 @@ class ParamInfo : public VariableInfo {
444454
NoEscape = Value.value_or(false);
445455
}
446456

457+
std::optional<bool> isLifetimebound() const {
458+
if (!LifetimeboundSpecified)
459+
return std::nullopt;
460+
return Lifetimebound;
461+
}
462+
void setLifetimebound(std::optional<bool> Value) {
463+
LifetimeboundSpecified = Value.has_value();
464+
Lifetimebound = Value.value_or(false);
465+
}
466+
447467
std::optional<RetainCountConventionKind> getRetainCountConvention() const {
448468
if (!RawRetainCountConvention)
449469
return std::nullopt;
@@ -463,6 +483,11 @@ class ParamInfo : public VariableInfo {
463483
NoEscape = RHS.NoEscape;
464484
}
465485

486+
if (!LifetimeboundSpecified && RHS.LifetimeboundSpecified) {
487+
LifetimeboundSpecified = true;
488+
Lifetimebound = RHS.Lifetimebound;
489+
}
490+
466491
if (!RawRetainCountConvention)
467492
RawRetainCountConvention = RHS.RawRetainCountConvention;
468493

@@ -478,6 +503,8 @@ inline bool operator==(const ParamInfo &LHS, const ParamInfo &RHS) {
478503
return static_cast<const VariableInfo &>(LHS) == RHS &&
479504
LHS.NoEscapeSpecified == RHS.NoEscapeSpecified &&
480505
LHS.NoEscape == RHS.NoEscape &&
506+
LHS.LifetimeboundSpecified == RHS.LifetimeboundSpecified &&
507+
LHS.Lifetimebound == RHS.Lifetimebound &&
481508
LHS.RawRetainCountConvention == RHS.RawRetainCountConvention;
482509
}
483510

clang/lib/APINotes/APINotesFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const uint16_t VERSION_MAJOR = 0;
2424
/// API notes file minor version number.
2525
///
2626
/// When the format changes IN ANY WAY, this number should be incremented.
27-
const uint16_t VERSION_MINOR = 30; // fields
27+
const uint16_t VERSION_MINOR = 31; // lifetimebound
2828

2929
const uint8_t kSwiftCopyable = 1;
3030
const uint8_t kSwiftNonCopyable = 2;

clang/lib/APINotes/APINotesReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ void ReadParamInfo(const uint8_t *&Data, ParamInfo &Info) {
331331
Info.setRetainCountConvention(Convention);
332332
}
333333
Payload >>= 3;
334+
if (Payload & 0x01)
335+
Info.setLifetimebound(Payload & 0x02);
336+
Payload >>= 2;
334337
if (Payload & 0x01)
335338
Info.setNoEscape(Payload & 0x02);
336339
Payload >>= 2;

clang/lib/APINotes/APINotesTypes.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ LLVM_DUMP_METHOD void ParamInfo::dump(llvm::raw_ostream &OS) const {
6565
static_cast<const VariableInfo &>(*this).dump(OS);
6666
if (NoEscapeSpecified)
6767
OS << (NoEscape ? "[NoEscape] " : "");
68+
if (LifetimeboundSpecified)
69+
OS << (Lifetimebound ? "[Lifetimebound] " : "");
6870
OS << "RawRetainCountConvention: " << RawRetainCountConvention << ' ';
6971
OS << '\n';
7072
}

clang/lib/APINotes/APINotesWriter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,12 @@ void emitParamInfo(raw_ostream &OS, const ParamInfo &PI) {
10521052
if (*noescape)
10531053
flags |= 0x02;
10541054
}
1055+
flags <<= 2;
1056+
if (auto lifetimebound = PI.isLifetimebound()) {
1057+
flags |= 0x01;
1058+
if (*lifetimebound)
1059+
flags |= 0x02;
1060+
}
10551061
flags <<= 3;
10561062
if (auto RCC = PI.getRetainCountConvention())
10571063
flags |= static_cast<uint8_t>(RCC.value()) + 1;

clang/lib/APINotes/APINotesYAMLCompiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ namespace {
7070
struct Param {
7171
unsigned Position;
7272
std::optional<bool> NoEscape = false;
73+
std::optional<bool> Lifetimebound = false;
7374
std::optional<NullabilityKind> Nullability;
7475
std::optional<RetainCountConventionKind> RetainCountConvention;
7576
StringRef Type;
@@ -121,6 +122,7 @@ template <> struct MappingTraits<Param> {
121122
IO.mapOptional("Nullability", P.Nullability, std::nullopt);
122123
IO.mapOptional("RetainCountConvention", P.RetainCountConvention);
123124
IO.mapOptional("NoEscape", P.NoEscape);
125+
IO.mapOptional("Lifetimebound", P.Lifetimebound);
124126
IO.mapOptional("Type", P.Type, StringRef(""));
125127
}
126128
};
@@ -734,6 +736,7 @@ class YAMLConverter {
734736
if (P.Nullability)
735737
PI.setNullabilityAudited(*P.Nullability);
736738
PI.setNoEscape(P.NoEscape);
739+
PI.setLifetimebound(P.Lifetimebound);
737740
PI.setType(std::string(P.Type));
738741
PI.setRetainCountConvention(P.RetainCountConvention);
739742
if (OutInfo.Params.size() <= P.Position)

0 commit comments

Comments
 (0)