Skip to content

Commit 0af1b7f

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
2 parents 2c77462 + d02471e commit 0af1b7f

File tree

347 files changed

+17170
-8476
lines changed

Some content is hidden

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

347 files changed

+17170
-8476
lines changed

bolt/lib/Profile/BoltAddressTranslation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ void BoltAddressTranslation::saveMetadata(BinaryContext &BC) {
486486
FuncHashes[BF.getAddress()].first = BF.computeHash();
487487
BF.computeBlockHashes();
488488
for (const BinaryBasicBlock &BB : BF)
489-
FuncHashes[BF.getAddress()].second.emplace(BB.getInputOffset(), BB.getHash());
489+
FuncHashes[BF.getAddress()].second.emplace(BB.getInputOffset(),
490+
BB.getHash());
490491
}
491492
}
492493

clang-tools-extra/clangd/IncludeCleaner.cpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <cassert>
4949
#include <iterator>
5050
#include <map>
51-
#include <memory>
5251
#include <optional>
5352
#include <string>
5453
#include <utility>
@@ -237,18 +236,6 @@ removeAllUnusedIncludes(llvm::ArrayRef<Diag> UnusedIncludes) {
237236
Diag.Fixes.front().Edits.begin(),
238237
Diag.Fixes.front().Edits.end());
239238
}
240-
241-
// TODO(hokein): emit a suitable text for the label.
242-
ChangeAnnotation Annotation = {/*label=*/"",
243-
/*needsConfirmation=*/true,
244-
/*description=*/""};
245-
static const ChangeAnnotationIdentifier RemoveAllUnusedID =
246-
"RemoveAllUnusedIncludes";
247-
for (unsigned I = 0; I < RemoveAll.Edits.size(); ++I) {
248-
ChangeAnnotationIdentifier ID = RemoveAllUnusedID + std::to_string(I);
249-
RemoveAll.Edits[I].annotationId = ID;
250-
RemoveAll.Annotations.push_back({ID, Annotation});
251-
}
252239
return RemoveAll;
253240
}
254241

@@ -268,20 +255,8 @@ addAllMissingIncludes(llvm::ArrayRef<Diag> MissingIncludeDiags) {
268255
Edits.try_emplace(Edit.newText, Edit);
269256
}
270257
}
271-
// FIXME(hokein): emit used symbol reference in the annotation.
272-
ChangeAnnotation Annotation = {/*label=*/"",
273-
/*needsConfirmation=*/true,
274-
/*description=*/""};
275-
static const ChangeAnnotationIdentifier AddAllMissingID =
276-
"AddAllMissingIncludes";
277-
unsigned I = 0;
278-
for (auto &It : Edits) {
279-
ChangeAnnotationIdentifier ID = AddAllMissingID + std::to_string(I++);
258+
for (auto &It : Edits)
280259
AddAllMissing.Edits.push_back(std::move(It.second));
281-
AddAllMissing.Edits.back().annotationId = ID;
282-
283-
AddAllMissing.Annotations.push_back({ID, Annotation});
284-
}
285260
return AddAllMissing;
286261
}
287262
Fix fixAll(const Fix &RemoveAllUnused, const Fix &AddAllMissing) {
@@ -292,11 +267,6 @@ Fix fixAll(const Fix &RemoveAllUnused, const Fix &AddAllMissing) {
292267
FixAll.Edits.push_back(F);
293268
for (const auto &F : AddAllMissing.Edits)
294269
FixAll.Edits.push_back(F);
295-
296-
for (const auto &A : RemoveAllUnused.Annotations)
297-
FixAll.Annotations.push_back(A);
298-
for (const auto &A : AddAllMissing.Annotations)
299-
FixAll.Annotations.push_back(A);
300270
return FixAll;
301271
}
302272

clang-tools-extra/clangd/test/include-cleaner-batch-fix.test

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,10 @@
157157
# CHECK-NEXT: {
158158
# CHECK-NEXT: "arguments": [
159159
# CHECK-NEXT: {
160-
# CHECK-NEXT: "changeAnnotations": {
161-
# CHECK-NEXT: "AddAllMissingIncludes0": {
162-
# CHECK-NEXT: "label": "",
163-
# CHECK-NEXT: "needsConfirmation": true
164-
# CHECK-NEXT: },
165-
# CHECK-NEXT: "AddAllMissingIncludes1": {
166-
# CHECK-NEXT: "label": "",
167-
# CHECK-NEXT: "needsConfirmation": true
168-
# CHECK-NEXT: }
169-
# CHECK-NEXT: },
170160
# CHECK-NEXT: "documentChanges": [
171161
# CHECK-NEXT: {
172162
# CHECK-NEXT: "edits": [
173163
# CHECK-NEXT: {
174-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes0",
175164
# CHECK-NEXT: "newText": "#include {{.*}}bar.h{{.*}}",
176165
# CHECK-NEXT: "range": {
177166
# CHECK-NEXT: "end": {
@@ -185,7 +174,6 @@
185174
# CHECK-NEXT: }
186175
# CHECK-NEXT: },
187176
# CHECK-NEXT: {
188-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes1",
189177
# CHECK-NEXT: "newText": "#include {{.*}}foo.h{{.*}}",
190178
# CHECK-NEXT: "range": {
191179
# CHECK-NEXT: "end": {
@@ -213,29 +201,10 @@
213201
# CHECK-NEXT: {
214202
# CHECK-NEXT: "arguments": [
215203
# CHECK-NEXT: {
216-
# CHECK-NEXT: "changeAnnotations": {
217-
# CHECK-NEXT: "AddAllMissingIncludes0": {
218-
# CHECK-NEXT: "label": "",
219-
# CHECK-NEXT: "needsConfirmation": true
220-
# CHECK-NEXT: },
221-
# CHECK-NEXT: "AddAllMissingIncludes1": {
222-
# CHECK-NEXT: "label": "",
223-
# CHECK-NEXT: "needsConfirmation": true
224-
# CHECK-NEXT: },
225-
# CHECK-NEXT: "RemoveAllUnusedIncludes0": {
226-
# CHECK-NEXT: "label": "",
227-
# CHECK-NEXT: "needsConfirmation": true
228-
# CHECK-NEXT: },
229-
# CHECK-NEXT: "RemoveAllUnusedIncludes1": {
230-
# CHECK-NEXT: "label": "",
231-
# CHECK-NEXT: "needsConfirmation": true
232-
# CHECK-NEXT: }
233-
# CHECK-NEXT: },
234204
# CHECK-NEXT: "documentChanges": [
235205
# CHECK-NEXT: {
236206
# CHECK-NEXT: "edits": [
237207
# CHECK-NEXT: {
238-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes0",
239208
# CHECK-NEXT: "newText": "",
240209
# CHECK-NEXT: "range": {
241210
# CHECK-NEXT: "end": {
@@ -249,7 +218,6 @@
249218
# CHECK-NEXT: }
250219
# CHECK-NEXT: },
251220
# CHECK-NEXT: {
252-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes1",
253221
# CHECK-NEXT: "newText": "",
254222
# CHECK-NEXT: "range": {
255223
# CHECK-NEXT: "end": {
@@ -263,7 +231,6 @@
263231
# CHECK-NEXT: }
264232
# CHECK-NEXT: },
265233
# CHECK-NEXT: {
266-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes0",
267234
# CHECK-NEXT: "newText": "#include {{.*}}bar.h{{.*}}",
268235
# CHECK-NEXT: "range": {
269236
# CHECK-NEXT: "end": {
@@ -277,7 +244,6 @@
277244
# CHECK-NEXT: }
278245
# CHECK-NEXT: },
279246
# CHECK-NEXT: {
280-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes1",
281247
# CHECK-NEXT: "newText": "#include {{.*}}foo.h{{.*}}",
282248
# CHECK-NEXT: "range": {
283249
# CHECK-NEXT: "end": {
@@ -342,21 +308,10 @@
342308
# CHECK-NEXT: {
343309
# CHECK-NEXT: "arguments": [
344310
# CHECK-NEXT: {
345-
# CHECK-NEXT: "changeAnnotations": {
346-
# CHECK-NEXT: "RemoveAllUnusedIncludes0": {
347-
# CHECK-NEXT: "label": "",
348-
# CHECK-NEXT: "needsConfirmation": true
349-
# CHECK-NEXT: },
350-
# CHECK-NEXT: "RemoveAllUnusedIncludes1": {
351-
# CHECK-NEXT: "label": "",
352-
# CHECK-NEXT: "needsConfirmation": true
353-
# CHECK-NEXT: }
354-
# CHECK-NEXT: },
355311
# CHECK-NEXT: "documentChanges": [
356312
# CHECK-NEXT: {
357313
# CHECK-NEXT: "edits": [
358314
# CHECK-NEXT: {
359-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes0",
360315
# CHECK-NEXT: "newText": "",
361316
# CHECK-NEXT: "range": {
362317
# CHECK-NEXT: "end": {
@@ -370,7 +325,6 @@
370325
# CHECK-NEXT: }
371326
# CHECK-NEXT: },
372327
# CHECK-NEXT: {
373-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes1",
374328
# CHECK-NEXT: "newText": "",
375329
# CHECK-NEXT: "range": {
376330
# CHECK-NEXT: "end": {
@@ -398,29 +352,10 @@
398352
# CHECK-NEXT: {
399353
# CHECK-NEXT: "arguments": [
400354
# CHECK-NEXT: {
401-
# CHECK-NEXT: "changeAnnotations": {
402-
# CHECK-NEXT: "AddAllMissingIncludes0": {
403-
# CHECK-NEXT: "label": "",
404-
# CHECK-NEXT: "needsConfirmation": true
405-
# CHECK-NEXT: },
406-
# CHECK-NEXT: "AddAllMissingIncludes1": {
407-
# CHECK-NEXT: "label": "",
408-
# CHECK-NEXT: "needsConfirmation": true
409-
# CHECK-NEXT: },
410-
# CHECK-NEXT: "RemoveAllUnusedIncludes0": {
411-
# CHECK-NEXT: "label": "",
412-
# CHECK-NEXT: "needsConfirmation": true
413-
# CHECK-NEXT: },
414-
# CHECK-NEXT: "RemoveAllUnusedIncludes1": {
415-
# CHECK-NEXT: "label": "",
416-
# CHECK-NEXT: "needsConfirmation": true
417-
# CHECK-NEXT: }
418-
# CHECK-NEXT: },
419355
# CHECK-NEXT: "documentChanges": [
420356
# CHECK-NEXT: {
421357
# CHECK-NEXT: "edits": [
422358
# CHECK-NEXT: {
423-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes0",
424359
# CHECK-NEXT: "newText": "",
425360
# CHECK-NEXT: "range": {
426361
# CHECK-NEXT: "end": {
@@ -434,7 +369,6 @@
434369
# CHECK-NEXT: }
435370
# CHECK-NEXT: },
436371
# CHECK-NEXT: {
437-
# CHECK-NEXT: "annotationId": "RemoveAllUnusedIncludes1",
438372
# CHECK-NEXT: "newText": "",
439373
# CHECK-NEXT: "range": {
440374
# CHECK-NEXT: "end": {
@@ -448,7 +382,6 @@
448382
# CHECK-NEXT: }
449383
# CHECK-NEXT: },
450384
# CHECK-NEXT: {
451-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes0",
452385
# CHECK-NEXT: "newText": "#include {{.*}}bar.h{{.*}}",
453386
# CHECK-NEXT: "range": {
454387
# CHECK-NEXT: "end": {
@@ -462,7 +395,6 @@
462395
# CHECK-NEXT: }
463396
# CHECK-NEXT: },
464397
# CHECK-NEXT: {
465-
# CHECK-NEXT: "annotationId": "AddAllMissingIncludes1",
466398
# CHECK-NEXT: "newText": "#include {{.*}}foo.h{{.*}}",
467399
# CHECK-NEXT: "range": {
468400
# CHECK-NEXT: "end": {

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ Improvements to Clang's diagnostics
518518
- Clang now diagnoses definitions of friend function specializations, e.g. ``friend void f<>(int) {}``.
519519
- Clang now diagnoses narrowing conversions involving const references.
520520
(`#63151: <https://github.com/llvm/llvm-project/issues/63151>`_).
521-
- Clang now diagnoses unexpanded packs within the template argument lists of function template specializations.
522521

523522

524523
Improvements to Clang's time-trace
@@ -1163,8 +1162,9 @@ Improvements
11631162
`0954dc3fb921 <https://github.com/llvm/llvm-project/commit/0954dc3fb9214b994623f5306473de075f8e3593>`_)
11641163

11651164
- Improved the ``alpha.unix.Stream`` checker by modeling more functions like,
1166-
``fflush``, ``fputs``, ``fgetc``, ``fputc``, ``fopen``, ``fopen``, ``fgets``.
1167-
(`#74296 <https://github.com/llvm/llvm-project/pull/74296>`_,
1165+
``fflush``, ``fputs``, ``fgetc``, ``fputc``, ``fopen``, ``fdopen``, ``fgets``, ``tmpfile``.
1166+
(`#76776 <https://github.com/llvm/llvm-project/pull/76776>`_,
1167+
`#74296 <https://github.com/llvm/llvm-project/pull/74296>`_,
11681168
`#73335 <https://github.com/llvm/llvm-project/pull/73335>`_,
11691169
`#72627 <https://github.com/llvm/llvm-project/pull/72627>`_,
11701170
`#71518 <https://github.com/llvm/llvm-project/pull/71518>`_,

clang/include/clang/AST/DeclCXX.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,14 @@ class RequiresExprBodyDecl : public Decl, public DeclContext {
20442044
// Implement isa/cast/dyncast/etc.
20452045
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
20462046
static bool classofKind(Kind K) { return K == RequiresExprBody; }
2047+
2048+
static DeclContext *castToDeclContext(const RequiresExprBodyDecl *D) {
2049+
return static_cast<DeclContext *>(const_cast<RequiresExprBodyDecl *>(D));
2050+
}
2051+
2052+
static RequiresExprBodyDecl *castFromDeclContext(const DeclContext *DC) {
2053+
return static_cast<RequiresExprBodyDecl *>(const_cast<DeclContext *>(DC));
2054+
}
20472055
};
20482056

20492057
/// Represents a static or instance method of a struct/union/class.

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10263,11 +10263,13 @@ class Sema final {
1026310263
~ConstraintEvalRAII() { TI.setEvaluateConstraints(OldValue); }
1026410264
};
1026510265

10266-
// Unlike the above, this evaluates constraints, which should only happen at
10267-
// 'constraint checking' time.
10266+
// Must be used instead of SubstExpr at 'constraint checking' time.
1026810267
ExprResult
1026910268
SubstConstraintExpr(Expr *E,
1027010269
const MultiLevelTemplateArgumentList &TemplateArgs);
10270+
// Unlike the above, this does not evaluates constraints.
10271+
ExprResult SubstConstraintExprWithoutSatisfaction(
10272+
Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs);
1027110273

1027210274
/// Substitute the given template arguments into a list of
1027310275
/// expressions, expanding pack expansions if required.

clang/include/clang/Sema/Template.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ enum class TemplateSubstitutionKind : char {
564564
const MultiLevelTemplateArgumentList &TemplateArgs;
565565
Sema::LateInstantiatedAttrVec* LateAttrs = nullptr;
566566
LocalInstantiationScope *StartingScope = nullptr;
567+
// Whether to evaluate the C++20 constraints or simply substitute into them.
567568
bool EvaluateConstraints = true;
568569

569570
/// A list of out-of-line class template partial

clang/lib/AST/ASTImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6141,6 +6141,11 @@ ExpectedDecl ASTNodeImporter::VisitClassTemplateSpecializationDecl(
61416141
InsertPos))
61426142
// Add this partial specialization to the class template.
61436143
ClassTemplate->AddPartialSpecialization(PartSpec2, InsertPos);
6144+
if (Expected<ClassTemplatePartialSpecializationDecl *> ToInstOrErr =
6145+
import(PartialSpec->getInstantiatedFromMember()))
6146+
PartSpec2->setInstantiatedFromMember(*ToInstOrErr);
6147+
else
6148+
return ToInstOrErr.takeError();
61446149

61456150
updateLookupTableForTemplateParameters(*ToTPList);
61466151
} else { // Not a partial specialization.

clang/lib/AST/DeclBase.cpp

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -930,39 +930,27 @@ const AttrVec &Decl::getAttrs() const {
930930

931931
Decl *Decl::castFromDeclContext (const DeclContext *D) {
932932
Decl::Kind DK = D->getDeclKind();
933-
switch(DK) {
934-
#define DECL(NAME, BASE)
935-
#define DECL_CONTEXT(NAME) \
936-
case Decl::NAME: \
937-
return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
938-
#define DECL_CONTEXT_BASE(NAME)
939-
#include "clang/AST/DeclNodes.inc"
940-
default:
933+
switch (DK) {
941934
#define DECL(NAME, BASE)
942-
#define DECL_CONTEXT_BASE(NAME) \
943-
if (DK >= first##NAME && DK <= last##NAME) \
944-
return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
935+
#define DECL_CONTEXT(NAME) \
936+
case Decl::NAME: \
937+
return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
945938
#include "clang/AST/DeclNodes.inc"
946-
llvm_unreachable("a decl that inherits DeclContext isn't handled");
939+
default:
940+
llvm_unreachable("a decl that inherits DeclContext isn't handled");
947941
}
948942
}
949943

950944
DeclContext *Decl::castToDeclContext(const Decl *D) {
951945
Decl::Kind DK = D->getKind();
952946
switch(DK) {
953947
#define DECL(NAME, BASE)
954-
#define DECL_CONTEXT(NAME) \
955-
case Decl::NAME: \
956-
return static_cast<NAME##Decl *>(const_cast<Decl *>(D));
957-
#define DECL_CONTEXT_BASE(NAME)
948+
#define DECL_CONTEXT(NAME) \
949+
case Decl::NAME: \
950+
return static_cast<NAME##Decl *>(const_cast<Decl *>(D));
958951
#include "clang/AST/DeclNodes.inc"
959-
default:
960-
#define DECL(NAME, BASE)
961-
#define DECL_CONTEXT_BASE(NAME) \
962-
if (DK >= first##NAME && DK <= last##NAME) \
963-
return static_cast<NAME##Decl *>(const_cast<Decl *>(D));
964-
#include "clang/AST/DeclNodes.inc"
965-
llvm_unreachable("a decl that inherits DeclContext isn't handled");
952+
default:
953+
llvm_unreachable("a decl that inherits DeclContext isn't handled");
966954
}
967955
}
968956

@@ -1129,20 +1117,14 @@ DeclContext::DeclContext(Decl::Kind K) {
11291117
}
11301118

11311119
bool DeclContext::classof(const Decl *D) {
1132-
switch (D->getKind()) {
1120+
Decl::Kind DK = D->getKind();
1121+
switch (DK) {
11331122
#define DECL(NAME, BASE)
11341123
#define DECL_CONTEXT(NAME) case Decl::NAME:
1135-
#define DECL_CONTEXT_BASE(NAME)
11361124
#include "clang/AST/DeclNodes.inc"
1137-
return true;
1138-
default:
1139-
#define DECL(NAME, BASE)
1140-
#define DECL_CONTEXT_BASE(NAME) \
1141-
if (D->getKind() >= Decl::first##NAME && \
1142-
D->getKind() <= Decl::last##NAME) \
1143-
return true;
1144-
#include "clang/AST/DeclNodes.inc"
1145-
return false;
1125+
return true;
1126+
default:
1127+
return false;
11461128
}
11471129
}
11481130

clang/lib/Basic/Targets/AVR.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ class LLVM_LIBRARY_VISIBILITY AVRTargetInfo : public TargetInfo {
146146
case 'R': // Integer constant (Range: -6 to 5)
147147
Info.setRequiresImmediate(-6, 5);
148148
return true;
149-
case 'G': // Floating point constant
149+
case 'G': // Floating point constant 0.0
150+
Info.setRequiresImmediate(0);
151+
return true;
150152
case 'Q': // A memory address based on Y or Z pointer with displacement.
151153
return true;
152154
}

0 commit comments

Comments
 (0)