Skip to content

Commit 555b851

Browse files
committed
rebase
Created using spr 1.3.6-beta.1
2 parents a4b3c8a + 14d69c3 commit 555b851

File tree

335 files changed

+17548
-9314
lines changed

Some content is hidden

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

335 files changed

+17548
-9314
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@ jobs:
2121
- os: ubuntu-24.04
2222
build_type: Debug
2323
ccache-variant: sccache
24-
c_compiler: clang-21
25-
cpp_compiler: clang++-21
24+
c_compiler: clang-20
25+
cpp_compiler: clang++-20
2626
target: x86_64-unknown-linux-llvm
2727
include_scudo: ON
2828
- os: ubuntu-24.04
2929
build_type: Release
3030
ccache-variant: sccache
31-
c_compiler: clang-21
32-
cpp_compiler: clang++-21
31+
c_compiler: clang-20
32+
cpp_compiler: clang++-20
3333
target: x86_64-unknown-linux-llvm
3434
include_scudo: ON
3535
- os: ubuntu-24.04
3636
build_type: MinSizeRel
3737
ccache-variant: sccache
38-
c_compiler: clang-21
39-
cpp_compiler: clang++-21
38+
c_compiler: clang-20
39+
cpp_compiler: clang++-20
4040
target: x86_64-unknown-linux-llvm
4141
include_scudo: ON
4242
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
4343
- os: ubuntu-24.04-arm
4444
build_type: Debug
4545
ccache-variant: ccache
46-
c_compiler: clang-21
47-
cpp_compiler: clang++-21
46+
c_compiler: clang-20
47+
cpp_compiler: clang++-20
4848
target: aarch64-unknown-linux-llvm
4949
include_scudo: ON
5050
- os: ubuntu-24.04
5151
build_type: Debug
5252
ccache-variant: ccache
53-
c_compiler: clang-21
54-
cpp_compiler: clang++-21
53+
c_compiler: clang-20
54+
cpp_compiler: clang++-20
5555
target: x86_64-unknown-uefi-llvm
5656
include_scudo: OFF
5757
# TODO: add back gcc build when it is fixed
@@ -81,7 +81,7 @@ jobs:
8181
run: |
8282
wget https://apt.llvm.org/llvm.sh
8383
chmod +x llvm.sh
84-
sudo ./llvm.sh 21
84+
sudo ./llvm.sh 20
8585
sudo apt-get update
8686
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
8787
sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ class DataAggregator : public DataReader {
502502
/// entries).
503503
void imputeFallThroughs();
504504

505+
/// Register profiled functions for lite mode.
506+
void registerProfiledFunctions();
507+
505508
/// Debugging dump methods
506509
void dump() const;
507510
void dump(const PerfBranchSample &Sample) const;

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,26 @@ void DataAggregator::imputeFallThroughs() {
581581
outs() << "BOLT-INFO: imputed " << InferredTraces << " traces\n";
582582
}
583583

584+
void DataAggregator::registerProfiledFunctions() {
585+
DenseSet<uint64_t> Addrs;
586+
for (const auto &Trace : llvm::make_first_range(Traces)) {
587+
if (Trace.Branch != Trace::FT_ONLY &&
588+
Trace.Branch != Trace::FT_EXTERNAL_ORIGIN)
589+
Addrs.insert(Trace.Branch);
590+
Addrs.insert(Trace.From);
591+
}
592+
593+
for (const auto [PC, _] : BasicSamples)
594+
Addrs.insert(PC);
595+
596+
for (const PerfMemSample &MemSample : MemSamples)
597+
Addrs.insert(MemSample.PC);
598+
599+
for (const uint64_t Addr : Addrs)
600+
if (BinaryFunction *Func = getBinaryFunctionContainingAddress(Addr))
601+
Func->setHasProfileAvailable();
602+
}
603+
584604
Error DataAggregator::preprocessProfile(BinaryContext &BC) {
585605
this->BC = &BC;
586606

@@ -603,6 +623,7 @@ Error DataAggregator::preprocessProfile(BinaryContext &BC) {
603623
exit(0);
604624
}
605625

626+
registerProfiledFunctions();
606627
return Error::success();
607628
}
608629

@@ -1347,10 +1368,6 @@ std::error_code DataAggregator::parseAggregatedLBREntry() {
13471368
}
13481369

13491370
const uint64_t FromOffset = Addr[0]->Offset;
1350-
BinaryFunction *FromFunc = getBinaryFunctionContainingAddress(FromOffset);
1351-
if (FromFunc)
1352-
FromFunc->setHasProfileAvailable();
1353-
13541371
int64_t Count = Counters[0];
13551372
int64_t Mispreds = Counters[1];
13561373

@@ -1361,11 +1378,6 @@ std::error_code DataAggregator::parseAggregatedLBREntry() {
13611378
return std::error_code();
13621379
}
13631380

1364-
const uint64_t ToOffset = Addr[1]->Offset;
1365-
BinaryFunction *ToFunc = getBinaryFunctionContainingAddress(ToOffset);
1366-
if (ToFunc)
1367-
ToFunc->setHasProfileAvailable();
1368-
13691381
/// For fall-through types, adjust locations to match Trace container.
13701382
if (Type == FT || Type == FT_EXTERNAL_ORIGIN || Type == FT_EXTERNAL_RETURN) {
13711383
Addr[2] = Location(Addr[1]->Offset); // Trace To
@@ -1613,9 +1625,6 @@ std::error_code DataAggregator::parseBranchEvents() {
16131625
Traces.reserve(TraceMap.size());
16141626
for (const auto &[Trace, Info] : TraceMap) {
16151627
Traces.emplace_back(Trace, Info);
1616-
for (const uint64_t Addr : {Trace.Branch, Trace.From})
1617-
if (BinaryFunction *BF = getBinaryFunctionContainingAddress(Addr))
1618-
BF->setHasProfileAvailable();
16191628
}
16201629
clear(TraceMap);
16211630

@@ -1676,9 +1685,6 @@ std::error_code DataAggregator::parseBasicEvents() {
16761685
continue;
16771686
++NumTotalSamples;
16781687

1679-
if (BinaryFunction *BF = getBinaryFunctionContainingAddress(Sample->PC))
1680-
BF->setHasProfileAvailable();
1681-
16821688
++BasicSamples[Sample->PC];
16831689
EventNames.insert(Sample->EventName);
16841690
}
@@ -1716,9 +1722,6 @@ std::error_code DataAggregator::parseMemEvents() {
17161722
if (std::error_code EC = Sample.getError())
17171723
return EC;
17181724

1719-
if (BinaryFunction *BF = getBinaryFunctionContainingAddress(Sample->PC))
1720-
BF->setHasProfileAvailable();
1721-
17221725
MemSamples.emplace_back(std::move(Sample.get()));
17231726
}
17241727

clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ void UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) {
121121
hasAnyBase(hasType(cxxRecordDecl(has(fieldDecl()))));
122122
Finder->addMatcher(
123123
initListExpr(
124-
hasType(cxxRecordDecl(
125-
RestrictToPODTypes ? isPOD() : isAggregate(),
126-
unless(anyOf(HasBaseWithFields, hasName("::std::array"))))
127-
.bind("type")),
124+
hasType(hasUnqualifiedDesugaredType(recordType(hasDeclaration(
125+
cxxRecordDecl(
126+
RestrictToPODTypes ? isPOD() : isAggregate(),
127+
unless(anyOf(HasBaseWithFields, hasName("::std::array"))))
128+
.bind("type"))))),
128129
IgnoreSingleElementAggregates ? hasMoreThanOneElement() : anything(),
129130
unless(isFullyDesignated()))
130131
.bind("init"),
@@ -155,7 +156,7 @@ void UseDesignatedInitializersCheck::check(
155156
DiagnosticBuilder Diag =
156157
diag(InitList->getLBraceLoc(),
157158
"use designated initializer list to initialize %0");
158-
Diag << Type << InitList->getSourceRange();
159+
Diag << InitList->getType() << InitList->getSourceRange();
159160
for (const Stmt *InitExpr : *SyntacticInitList) {
160161
const auto Designator = Designators[InitExpr->getBeginLoc()];
161162
if (Designator && !Designator->empty())

clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ QualifiedAutoCheck::QualifiedAutoCheck(StringRef Name,
106106
: ClangTidyCheck(Name, Context),
107107
AddConstToQualified(Options.get("AddConstToQualified", true)),
108108
AllowedTypes(
109-
utils::options::parseStringList(Options.get("AllowedTypes", ""))) {}
109+
utils::options::parseStringList(Options.get("AllowedTypes", ""))),
110+
IgnoreAliasing(Options.get("IgnoreAliasing", true)) {}
110111

111112
void QualifiedAutoCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
112113
Options.store(Opts, "AddConstToQualified", AddConstToQualified);
113114
Options.store(Opts, "AllowedTypes",
114115
utils::options::serializeStringList(AllowedTypes));
116+
Options.store(Opts, "IgnoreAliasing", IgnoreAliasing);
115117
}
116118

117119
void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) {
@@ -134,16 +136,30 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder *Finder) {
134136

135137
auto IsBoundToType = refersToType(equalsBoundNode("type"));
136138
auto UnlessFunctionType = unless(hasUnqualifiedDesugaredType(functionType()));
137-
auto IsAutoDeducedToPointer = [](const std::vector<StringRef> &AllowedTypes,
138-
const auto &...InnerMatchers) {
139-
return autoType(hasDeducedType(
140-
hasUnqualifiedDesugaredType(pointerType(pointee(InnerMatchers...))),
141-
unless(hasUnqualifiedType(
142-
matchers::matchesAnyListedTypeName(AllowedTypes, false))),
143-
unless(pointerType(pointee(hasUnqualifiedType(
144-
matchers::matchesAnyListedTypeName(AllowedTypes, false)))))));
139+
140+
auto IsPointerType = [this](const auto &...InnerMatchers) {
141+
if (this->IgnoreAliasing) {
142+
return qualType(
143+
hasUnqualifiedDesugaredType(pointerType(pointee(InnerMatchers...))));
144+
} else {
145+
return qualType(
146+
anyOf(qualType(pointerType(pointee(InnerMatchers...))),
147+
qualType(substTemplateTypeParmType(hasReplacementType(
148+
pointerType(pointee(InnerMatchers...)))))));
149+
}
145150
};
146151

152+
auto IsAutoDeducedToPointer =
153+
[IsPointerType](const std::vector<StringRef> &AllowedTypes,
154+
const auto &...InnerMatchers) {
155+
return autoType(hasDeducedType(
156+
IsPointerType(InnerMatchers...),
157+
unless(hasUnqualifiedType(
158+
matchers::matchesAnyListedTypeName(AllowedTypes, false))),
159+
unless(pointerType(pointee(hasUnqualifiedType(
160+
matchers::matchesAnyListedTypeName(AllowedTypes, false)))))));
161+
};
162+
147163
Finder->addMatcher(
148164
ExplicitSingleVarDecl(
149165
hasType(IsAutoDeducedToPointer(AllowedTypes, UnlessFunctionType)),

clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class QualifiedAutoCheck : public ClangTidyCheck {
3232
private:
3333
const bool AddConstToQualified;
3434
const std::vector<StringRef> AllowedTypes;
35+
const bool IgnoreAliasing;
3536
};
3637

3738
} // namespace clang::tidy::readability

clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ set(LLVM_LINK_COMPONENTS
1414
add_clang_library(clangDaemonTweaks OBJECT
1515
AddUsing.cpp
1616
AnnotateHighlightings.cpp
17-
DumpAST.cpp
1817
DefineInline.cpp
1918
DefineOutline.cpp
19+
DumpAST.cpp
2020
ExpandDeducedType.cpp
2121
ExpandMacro.cpp
2222
ExtractFunction.cpp
2323
ExtractVariable.cpp
2424
MemberwiseConstructor.cpp
2525
ObjCLocalizeStringLiteral.cpp
2626
ObjCMemberwiseInitializer.cpp
27+
OverridePureVirtuals.cpp
2728
PopulateSwitch.cpp
2829
RawStringLiteral.cpp
2930
RemoveUsingNamespace.cpp

0 commit comments

Comments
 (0)