Skip to content

Commit 3259e66

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-branch-on-multi-cond-in-middle
2 parents 64db0ee + 2de3d00 commit 3259e66

File tree

442 files changed

+11472
-6175
lines changed

Some content is hidden

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

442 files changed

+11472
-6175
lines changed

clang-tools-extra/clangd/Protocol.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,16 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R,
504504
P.field("offsetEncoding")))
505505
return false;
506506
}
507+
508+
if (auto *Experimental = O->getObject("experimental")) {
509+
if (auto *TextDocument = Experimental->getObject("textDocument")) {
510+
if (auto *Completion = TextDocument->getObject("completion")) {
511+
if (auto EditsNearCursor = Completion->getBoolean("editsNearCursor"))
512+
R.CompletionFixes |= *EditsNearCursor;
513+
}
514+
}
515+
}
516+
507517
return true;
508518
}
509519

clang-tools-extra/clangd/TidyProvider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DotClangTidyCache : private FileCache {
4646
[this](std::optional<llvm::StringRef> Data) {
4747
Value.reset();
4848
if (Data && !Data->empty()) {
49-
tidy::DiagCallback Diagnostics = [](const llvm::SMDiagnostic &D) {
49+
auto Diagnostics = [](const llvm::SMDiagnostic &D) {
5050
switch (D.getKind()) {
5151
case llvm::SourceMgr::DK_Error:
5252
elog("tidy-config error at {0}:{1}:{2}: {3}", D.getFilename(),
@@ -149,7 +149,7 @@ static void mergeCheckList(std::optional<std::string> &Checks,
149149
*Checks = llvm::join_items(",", *Checks, List);
150150
}
151151

152-
TidyProviderRef provideEnvironment() {
152+
TidyProvider provideEnvironment() {
153153
static const std::optional<std::string> User = [] {
154154
std::optional<std::string> Ret = llvm::sys::Process::GetEnv("USER");
155155
#ifdef _WIN32
@@ -167,7 +167,7 @@ TidyProviderRef provideEnvironment() {
167167
return [](tidy::ClangTidyOptions &, llvm::StringRef) {};
168168
}
169169

170-
TidyProviderRef provideDefaultChecks() {
170+
TidyProvider provideDefaultChecks() {
171171
// These default checks are chosen for:
172172
// - low false-positive rate
173173
// - providing a lot of value
@@ -251,7 +251,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
251251
};
252252
}
253253

254-
TidyProviderRef provideClangdConfig() {
254+
TidyProvider provideClangdConfig() {
255255
return [](tidy::ClangTidyOptions &Opts, llvm::StringRef) {
256256
const auto &CurTidyConfig = Config::current().Diagnostics.ClangTidy;
257257
if (!CurTidyConfig.Checks.empty())

clang-tools-extra/clangd/TidyProvider.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ using TidyProviderRef = llvm::function_ref<void(tidy::ClangTidyOptions &,
3030
TidyProvider combine(std::vector<TidyProvider> Providers);
3131

3232
/// Provider that just sets the defaults.
33-
TidyProviderRef provideEnvironment();
33+
TidyProvider provideEnvironment();
3434

3535
/// Provider that will enable a nice set of default checks if none are
3636
/// specified.
37-
TidyProviderRef provideDefaultChecks();
37+
TidyProvider provideDefaultChecks();
3838

3939
/// Provider the enables a specific set of checks and warnings as errors.
4040
TidyProvider addTidyChecks(llvm::StringRef Checks,
@@ -51,7 +51,7 @@ disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks = {});
5151
TidyProvider provideClangTidyFiles(ThreadsafeFS &);
5252

5353
// Provider that uses clangd configuration files.
54-
TidyProviderRef provideClangdConfig();
54+
TidyProvider provideClangdConfig();
5555

5656
tidy::ClangTidyOptions getTidyOptionsForFile(TidyProviderRef Provider,
5757
llvm::StringRef Filename);

clang/Maintainers.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ Sema
6969
| aeternalmail\@gmail.com (email), Sirraide (GitHub), Ætérnal (Discord), Sirraide (Discourse)
7070
7171

72+
Recovery AST
73+
~~~~~~~~~~~~
74+
| Haojian Wu
75+
| hokein.wu\@gmail.com (email), hokein (Phabricator), hokein (GitHub), hokein (Discourse)
76+
77+
7278
Experimental new constant interpreter
7379
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7480
| Timm Bäder
@@ -295,6 +301,15 @@ SYCL conformance
295301
| alexey.bader\@intel.com (email), bader (Phabricator), bader (GitHub)
296302
297303

304+
Issue Triage
305+
~~~~~~~~~~~~
306+
| Shafik Yaghmour
307+
| shafik.yaghmour\@intel.com (email), shafik (GitHub), shafik.yaghmour (Discord), shafik (Discourse)
308+
309+
| hstk30
310+
| hanwei62\@huawei.com (email), hstk30-hw (GitHub), hstk30(Discord), hstk30 (Discourse)
311+
312+
298313
Inactive Maintainers
299314
====================
300315
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/include/clang/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ class DeclaratorDecl : public ValueDecl {
737737
// qualifier, to be used for the (uncommon) case of out-of-line declarations
738738
// and constrained function decls.
739739
struct ExtInfo : public QualifierInfo {
740-
TypeSourceInfo *TInfo;
740+
TypeSourceInfo *TInfo = nullptr;
741741
Expr *TrailingRequiresClause = nullptr;
742742
};
743743

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;

0 commit comments

Comments
 (0)