Skip to content

Commit af0fbbd

Browse files
committed
merge main into amd-staging
2 parents 27cda2d + dda95d9 commit af0fbbd

File tree

51 files changed

+1634
-1302
lines changed

Some content is hidden

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

51 files changed

+1634
-1302
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,6 @@ class BinaryContext {
781781
uint64_t PseudoProbeLooseMatchedSampleCount{0};
782782
/// the count of call matched samples
783783
uint64_t CallMatchedSampleCount{0};
784-
/// the number of stale functions that have matching number of blocks in
785-
/// the profile
786-
uint64_t NumStaleFuncsWithEqualBlockCount{0};
787-
/// the number of blocks that have matching size but a differing hash
788-
uint64_t NumStaleBlocksWithEqualIcount{0};
789784
} Stats;
790785

791786
// Original binary execution count stats.

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,12 +1508,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
15081508
if (NumAllStaleFunctions) {
15091509
const float PctStale =
15101510
NumAllStaleFunctions / (float)NumAllProfiledFunctions * 100.0f;
1511-
const float PctStaleFuncsWithEqualBlockCount =
1512-
(float)BC.Stats.NumStaleFuncsWithEqualBlockCount /
1513-
NumAllStaleFunctions * 100.0f;
1514-
const float PctStaleBlocksWithEqualIcount =
1515-
(float)BC.Stats.NumStaleBlocksWithEqualIcount /
1516-
BC.Stats.NumStaleBlocks * 100.0f;
15171511
auto printErrorOrWarning = [&]() {
15181512
if (PctStale > opts::StaleThreshold)
15191513
BC.errs() << "BOLT-ERROR: ";
@@ -1536,17 +1530,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
15361530
<< "%) belong to functions with invalid"
15371531
" (possibly stale) profile.\n";
15381532
}
1539-
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleFuncsWithEqualBlockCount
1540-
<< " stale function"
1541-
<< (BC.Stats.NumStaleFuncsWithEqualBlockCount == 1 ? "" : "s")
1542-
<< format(" (%.1f%% of all stale)",
1543-
PctStaleFuncsWithEqualBlockCount)
1544-
<< " have matching block count.\n";
1545-
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleBlocksWithEqualIcount
1546-
<< " stale block"
1547-
<< (BC.Stats.NumStaleBlocksWithEqualIcount == 1 ? "" : "s")
1548-
<< format(" (%.1f%% of all stale)", PctStaleBlocksWithEqualIcount)
1549-
<< " have matching icount.\n";
15501533
if (PctStale > opts::StaleThreshold) {
15511534
return createFatalBOLTError(
15521535
Twine("BOLT-ERROR: stale functions exceed specified threshold of ") +

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ bool YAMLProfileReader::parseFunctionProfile(
350350
<< MismatchedCalls << " calls, and " << MismatchedEdges
351351
<< " edges in profile did not match function " << BF << '\n';
352352

353-
if (YamlBF.NumBasicBlocks != BF.size())
354-
++BC.Stats.NumStaleFuncsWithEqualBlockCount;
355-
356353
if (!opts::InferStaleProfile)
357354
return false;
358355
ArrayRef<ProbeMatchSpec> ProbeMatchSpecs;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
247247
Options.WarningsAsErrors = "";
248248
Options.HeaderFileExtensions = {"", "h", "hh", "hpp", "hxx"};
249249
Options.ImplementationFileExtensions = {"c", "cc", "cpp", "cxx"};
250-
Options.HeaderFilterRegex = "";
250+
Options.HeaderFilterRegex = ".*";
251251
Options.ExcludeHeaderFilterRegex = "";
252252
Options.SystemHeaders = false;
253253
Options.FormatStyle = "none";

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Configuration files:
9393
WarningsAsErrors: ''
9494
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
9595
ImplementationFileExtensions: ['c','cc','cpp','cxx']
96-
HeaderFilterRegex: ''
96+
HeaderFilterRegex: '.*'
9797
FormatStyle: none
9898
InheritParentConfig: true
9999
User: user
@@ -132,14 +132,16 @@ file, if any.
132132

133133
static cl::opt<std::string> HeaderFilter("header-filter", desc(R"(
134134
Regular expression matching the names of the
135-
headers to output diagnostics from. Diagnostics
135+
headers to output diagnostics from. The default
136+
value is '.*', i.e. diagnostics from all non-system
137+
headers are displayed by default. Diagnostics
136138
from the main file of each translation unit are
137139
always displayed.
138140
Can be used together with -line-filter.
139141
This option overrides the 'HeaderFilterRegex'
140142
option in .clang-tidy file, if any.
141143
)"),
142-
cl::init(""),
144+
cl::init(".*"),
143145
cl::cat(ClangTidyCategory));
144146

145147
static cl::opt<std::string> ExcludeHeaderFilter("exclude-header-filter",
@@ -379,9 +381,9 @@ static void printStats(const ClangTidyStats &Stats) {
379381
<< " with check filters";
380382
llvm::errs() << ").\n";
381383
if (Stats.ErrorsIgnoredNonUserCode)
382-
llvm::errs() << "Use -header-filter=.* to display errors from all "
383-
"non-system headers. Use -system-headers to display "
384-
"errors from system headers as well.\n";
384+
llvm::errs() << "Use -header-filter=.* or leave it as default to display "
385+
"errors from all non-system headers. Use -system-headers "
386+
"to display errors from system headers as well.\n";
385387
}
386388
}
387389

clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context) {
2121
SourceLocation AmpLocation = Var.getLocation();
2222
auto Token = utils::lexer::getPreviousToken(
2323
AmpLocation, Context.getSourceManager(), Context.getLangOpts());
24+
25+
// For parameter packs the '&' must go before the '...' token
26+
if (Token.is(tok::ellipsis))
27+
return FixItHint::CreateInsertion(Token.getLocation(), "&");
28+
2429
if (!Token.is(tok::unknown))
2530
AmpLocation = Lexer::getLocForEndOfToken(Token.getLocation(), 0,
2631
Context.getSourceManager(),

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ Potentially Breaking Changes
7070
:doc:`bugprone-signed-char-misuse
7171
<clang-tidy/checks/bugprone/signed-char-misuse>`
7272

73+
- :program:`clang-tidy` now displays warnings from all non-system headers by
74+
default. Previously, users had to explicitly opt-in to header warnings using
75+
`-header-filter='.*'`. To disable warnings from non-system, set `-header-filter`
76+
to an empty string.
77+
7378
Improvements to clangd
7479
----------------------
7580

@@ -132,6 +137,11 @@ Improvements to clang-tidy
132137
when run over C files. If ``-std`` is not specified, it defaults to
133138
``c99-or-later``.
134139

140+
- :program:`clang-tidy` now displays warnings from all non-system headers by
141+
default. Previously, users had to explicitly opt-in to header warnings using
142+
`-header-filter='.*'`. To disable warnings from non-system, set `-header-filter`
143+
to an empty string.
144+
135145
- :program:`clang-tidy` no longer attempts to analyze code from system headers
136146
by default, greatly improving performance. This behavior is disabled if the
137147
`SystemHeaders` option is enabled.
@@ -407,7 +417,8 @@ Changes in existing checks
407417

408418
- Improved :doc:`performance-unnecessary-value-param
409419
<clang-tidy/checks/performance/unnecessary-value-param>` by printing
410-
the type of the diagnosed variable.
420+
the type of the diagnosed variable and correctly generating fix-it hints for
421+
parameter-pack arguments.
411422

412423
- Improved :doc:`portability-template-virtual-member-function
413424
<clang-tidy/checks/portability/template-virtual-member-function>` check to

clang-tools-extra/docs/clang-tidy/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ An overview of all the command-line options:
215215
This option overrides the 'FormatStyle` option in
216216
.clang-tidy file, if any.
217217
--header-filter=<string> - Regular expression matching the names of the
218-
headers to output diagnostics from. Diagnostics
218+
headers to output diagnostics from. The default
219+
value is '.*', i.e. diagnostics from all non-system
220+
headers are displayed by default. Diagnostics
219221
from the main file of each translation unit are
220222
always displayed.
221223
Can be used together with -line-filter.
@@ -338,7 +340,7 @@ An overview of all the command-line options:
338340
WarningsAsErrors: ''
339341
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
340342
ImplementationFileExtensions: ['c','cc','cpp','cxx']
341-
HeaderFilterRegex: ''
343+
HeaderFilterRegex: '.*'
342344
FormatStyle: none
343345
InheritParentConfig: true
344346
User: user

clang-tools-extra/test/clang-tidy/checkers/abseil/no-internal-dependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t, -- -- -I %S/Inputs
1+
// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t, -- -header-filter='' -- -I %S/Inputs
22
// RUN: clang-tidy -checks='-*, abseil-no-internal-dependencies' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
33

44
#include "absl/strings/internal-file.h"

clang-tools-extra/test/clang-tidy/checkers/abseil/no-namespace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -- -I %S/Inputs
1+
// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -header-filter='' -- -I %S/Inputs
22
// RUN: clang-tidy -checks='-*, abseil-no-namespace' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s
33

44
/// Warning will not be triggered on internal Abseil code that is included.

0 commit comments

Comments
 (0)