Skip to content

Commit e98ff61

Browse files
authored
merge main into amd-staging (llvm#1754)
2 parents cef7de3 + d1ec997 commit e98ff61

File tree

60 files changed

+752
-228
lines changed

Some content is hidden

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

60 files changed

+752
-228
lines changed

bolt/lib/Core/BinaryBasicBlock.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ void BinaryBasicBlock::updateJumpTableSuccessors() {
372372
[](const BinaryBasicBlock *BB1, const BinaryBasicBlock *BB2) {
373373
return BB1->getInputOffset() < BB2->getInputOffset();
374374
});
375-
SuccessorBBs.erase(std::unique(SuccessorBBs.begin(), SuccessorBBs.end()),
376-
SuccessorBBs.end());
375+
SuccessorBBs.erase(llvm::unique(SuccessorBBs), SuccessorBBs.end());
377376

378377
for (BinaryBasicBlock *BB : SuccessorBBs)
379378
addSuccessor(BB);

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,7 @@ Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
23762376
// Without doing jump table value profiling we don't have a use for extra
23772377
// (duplicate) branches.
23782378
llvm::sort(TakenBranches);
2379-
auto NewEnd = std::unique(TakenBranches.begin(), TakenBranches.end());
2379+
auto NewEnd = llvm::unique(TakenBranches);
23802380
TakenBranches.erase(NewEnd, TakenBranches.end());
23812381

23822382
for (std::pair<uint32_t, uint32_t> &Branch : TakenBranches) {

bolt/lib/Core/DebugNames.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ void DWARF5AcceleratorTable::computeBucketCount() {
440440
for (const auto &E : Entries)
441441
Uniques.push_back(E.second.HashValue);
442442
array_pod_sort(Uniques.begin(), Uniques.end());
443-
std::vector<uint32_t>::iterator P =
444-
std::unique(Uniques.begin(), Uniques.end());
443+
std::vector<uint32_t>::iterator P = llvm::unique(Uniques);
445444

446445
UniqueHashCount = std::distance(Uniques.begin(), P);
447446

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,9 @@ std::vector<yaml::bolt::PseudoProbeInfo>
133133
YAMLProfileWriter::convertNodeProbes(NodeIdToProbes &NodeProbes) {
134134
struct BlockProbeInfoHasher {
135135
size_t operator()(const yaml::bolt::PseudoProbeInfo &BPI) const {
136-
auto HashCombine = [](auto &Range) {
137-
return llvm::hash_combine_range(Range.begin(), Range.end());
138-
};
139-
return llvm::hash_combine(HashCombine(BPI.BlockProbes),
140-
HashCombine(BPI.CallProbes),
141-
HashCombine(BPI.IndCallProbes));
136+
return llvm::hash_combine(llvm::hash_combine_range(BPI.BlockProbes),
137+
llvm::hash_combine_range(BPI.CallProbes),
138+
llvm::hash_combine_range(BPI.IndCallProbes));
142139
}
143140
};
144141

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void Info::mergeBase(Info &&Other) {
200200
std::move(Other.Description.begin(), Other.Description.end(),
201201
std::back_inserter(Description));
202202
llvm::sort(Description);
203-
auto Last = std::unique(Description.begin(), Description.end());
203+
auto Last = llvm::unique(Description);
204204
Description.erase(Last, Description.end());
205205
}
206206

@@ -215,7 +215,7 @@ void SymbolInfo::merge(SymbolInfo &&Other) {
215215
// Unconditionally extend the list of locations, since we want all of them.
216216
std::move(Other.Loc.begin(), Other.Loc.end(), std::back_inserter(Loc));
217217
llvm::sort(Loc);
218-
auto *Last = std::unique(Loc.begin(), Loc.end());
218+
auto *Last = llvm::unique(Loc);
219219
Loc.erase(Last, Loc.end());
220220
mergeBase(std::move(Other));
221221
}

clang-tools-extra/clang-include-fixer/IncludeFixerContext.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ IncludeFixerContext::IncludeFixerContext(
9090
std::make_pair(B.Range.getOffset(), B.Range.getLength());
9191
});
9292
QuerySymbolInfos.erase(
93-
std::unique(QuerySymbolInfos.begin(), QuerySymbolInfos.end(),
94-
[](const QuerySymbolInfo &A, const QuerySymbolInfo &B) {
95-
return A.Range == B.Range;
96-
}),
93+
llvm::unique(QuerySymbolInfos,
94+
[](const QuerySymbolInfo &A, const QuerySymbolInfo &B) {
95+
return A.Range == B.Range;
96+
}),
9797
QuerySymbolInfos.end());
9898
for (const auto &Symbol : MatchedSymbols) {
9999
HeaderInfos.push_back(
@@ -103,11 +103,11 @@ IncludeFixerContext::IncludeFixerContext(
103103
QuerySymbolInfos.front().ScopedQualifiers, Symbol)});
104104
}
105105
// Deduplicate header infos.
106-
HeaderInfos.erase(std::unique(HeaderInfos.begin(), HeaderInfos.end(),
107-
[](const HeaderInfo &A, const HeaderInfo &B) {
108-
return A.Header == B.Header &&
109-
A.QualifiedName == B.QualifiedName;
110-
}),
106+
HeaderInfos.erase(llvm::unique(HeaderInfos,
107+
[](const HeaderInfo &A, const HeaderInfo &B) {
108+
return A.Header == B.Header &&
109+
A.QualifiedName == B.QualifiedName;
110+
}),
111111
HeaderInfos.end());
112112
}
113113

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,7 @@ std::vector<ClangTidyError> ClangTidyDiagnosticConsumer::take() {
754754
finalizeLastError();
755755

756756
llvm::stable_sort(Errors, LessClangTidyError());
757-
Errors.erase(std::unique(Errors.begin(), Errors.end(), EqualClangTidyError()),
758-
Errors.end());
757+
Errors.erase(llvm::unique(Errors, EqualClangTidyError()), Errors.end());
759758
if (RemoveIncompatibleErrors)
760759
removeIncompatibleErrors();
761760
return std::move(Errors);

clang-tools-extra/clangd/SystemIncludeExtractor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ template <> struct DenseMapInfo<DriverArgs> {
239239
Val.Stdlib,
240240
});
241241

242-
unsigned SpecsHash =
243-
llvm::hash_combine_range(Val.Specs.begin(), Val.Specs.end());
242+
unsigned SpecsHash = llvm::hash_combine_range(Val.Specs);
244243

245244
return llvm::hash_combine(FixedFieldsHash, SpecsHash);
246245
}

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,14 @@ Improvements to Clang's diagnostics
411411
constructors to initialize their non-modifiable members. The diagnostic is
412412
not new; being controlled via a warning group is what's new. Fixes #GH41104
413413

414+
- Improved bit-field diagnostics to consider the type specified by the
415+
``preferred_type`` attribute. These diagnostics are controlled by the flags
416+
``-Wpreferred-type-bitfield-enum-conversion`` and
417+
``-Wpreferred-type-bitfield-width``. These warnings are on by default as they
418+
they're only triggered if the authors are already making the choice to use
419+
``preferred_type`` attribute.
420+
421+
414422
Improvements to Clang's time-trace
415423
----------------------------------
416424

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def SingleBitBitFieldConstantConversion :
4949
DiagGroup<"single-bit-bitfield-constant-conversion">;
5050
def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion",
5151
[SingleBitBitFieldConstantConversion]>;
52+
def PreferredTypeBitFieldEnumConversion
53+
: DiagGroup<"preferred-type-bitfield-enum-conversion">;
54+
def PreferredTypeBitFieldWidth : DiagGroup<"preferred-type-bitfield-width">;
5255
def BitFieldEnumConversion : DiagGroup<"bitfield-enum-conversion">;
5356
def BitFieldWidth : DiagGroup<"bitfield-width">;
5457
def CompoundTokenSplitByMacro : DiagGroup<"compound-token-split-by-macro">;

0 commit comments

Comments
 (0)