Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
3fc24a2
[clang-format] Fix a bug in annotating class member names (#165351)
owenca Oct 29, 2025
0589409
[flang][cuda] Support gpu.launch_func with async token in target rewr…
clementval Oct 29, 2025
028bfa2
[LoongArch][NFC] Add tests for vector fminnum/fmaxnum (#162767)
ylzsx Oct 29, 2025
0926265
[clang] Use a formatted_raw_ostream in TextDiagnostic (#164935)
tbaederr Oct 29, 2025
20532c0
[AMDGPU] make AMDGPUUniformIntrinsicCombine a function pass (#165265)
PankajDwivedi-25 Oct 29, 2025
a21521a
[clang][bytecode] Check builtin carryops for non-block out pointers (…
tbaederr Oct 29, 2025
2f97761
[clang-tidy] Fix param-pack fix-its for 'performance-unnecessary-valu…
vbvictor Oct 29, 2025
1bd0fdf
[clang-tidy] Emit warnings from user headers by default (#164165)
vbvictor Oct 29, 2025
04e78b4
[BOLT][NFC] Drop unused profile staleness stats (#165489)
aaupov Oct 29, 2025
da15b8f
[AArch64][GlobalISel] Add a constant funnel shift post-legalizer comb…
davemgreen Oct 29, 2025
a9e6f90
[libunwind][PAuthLR] Remove PC offset when using FEAT_PAuthLR (#164224)
Stylie777 Oct 29, 2025
7fb6fae
[llvm][DebugInfo][test] Add LLVM tests for Objective-C property debug…
Michael137 Oct 29, 2025
f4e77e9
[lldb] Fix StdUnorderedMapSynthProvider for GCC (#164251)
DrSergei Oct 29, 2025
7f1aef8
[ASTMatchers][Docs] Regenerate MatchersReference via dump_ast_matcher…
vbvictor Oct 29, 2025
dda95d9
[llvm][DebugInfo][ObjC] Fix argument order of setter/getter to DIObjC…
Michael137 Oct 29, 2025
af0fbbd
merge main into amd-staging
ronlieb Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions bolt/include/bolt/Core/BinaryContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,6 @@ class BinaryContext {
uint64_t PseudoProbeLooseMatchedSampleCount{0};
/// the count of call matched samples
uint64_t CallMatchedSampleCount{0};
/// the number of stale functions that have matching number of blocks in
/// the profile
uint64_t NumStaleFuncsWithEqualBlockCount{0};
/// the number of blocks that have matching size but a differing hash
uint64_t NumStaleBlocksWithEqualIcount{0};
} Stats;

// Original binary execution count stats.
Expand Down
17 changes: 0 additions & 17 deletions bolt/lib/Passes/BinaryPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,12 +1508,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
if (NumAllStaleFunctions) {
const float PctStale =
NumAllStaleFunctions / (float)NumAllProfiledFunctions * 100.0f;
const float PctStaleFuncsWithEqualBlockCount =
(float)BC.Stats.NumStaleFuncsWithEqualBlockCount /
NumAllStaleFunctions * 100.0f;
const float PctStaleBlocksWithEqualIcount =
(float)BC.Stats.NumStaleBlocksWithEqualIcount /
BC.Stats.NumStaleBlocks * 100.0f;
auto printErrorOrWarning = [&]() {
if (PctStale > opts::StaleThreshold)
BC.errs() << "BOLT-ERROR: ";
Expand All @@ -1536,17 +1530,6 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
<< "%) belong to functions with invalid"
" (possibly stale) profile.\n";
}
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleFuncsWithEqualBlockCount
<< " stale function"
<< (BC.Stats.NumStaleFuncsWithEqualBlockCount == 1 ? "" : "s")
<< format(" (%.1f%% of all stale)",
PctStaleFuncsWithEqualBlockCount)
<< " have matching block count.\n";
BC.outs() << "BOLT-INFO: " << BC.Stats.NumStaleBlocksWithEqualIcount
<< " stale block"
<< (BC.Stats.NumStaleBlocksWithEqualIcount == 1 ? "" : "s")
<< format(" (%.1f%% of all stale)", PctStaleBlocksWithEqualIcount)
<< " have matching icount.\n";
if (PctStale > opts::StaleThreshold) {
return createFatalBOLTError(
Twine("BOLT-ERROR: stale functions exceed specified threshold of ") +
Expand Down
3 changes: 0 additions & 3 deletions bolt/lib/Profile/YAMLProfileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@ bool YAMLProfileReader::parseFunctionProfile(
<< MismatchedCalls << " calls, and " << MismatchedEdges
<< " edges in profile did not match function " << BF << '\n';

if (YamlBF.NumBasicBlocks != BF.size())
++BC.Stats.NumStaleFuncsWithEqualBlockCount;

if (!opts::InferStaleProfile)
return false;
ArrayRef<ProbeMatchSpec> ProbeMatchSpecs;
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ ClangTidyOptions ClangTidyOptions::getDefaults() {
Options.WarningsAsErrors = "";
Options.HeaderFileExtensions = {"", "h", "hh", "hpp", "hxx"};
Options.ImplementationFileExtensions = {"c", "cc", "cpp", "cxx"};
Options.HeaderFilterRegex = "";
Options.HeaderFilterRegex = ".*";
Options.ExcludeHeaderFilterRegex = "";
Options.SystemHeaders = false;
Options.FormatStyle = "none";
Expand Down
14 changes: 8 additions & 6 deletions clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Configuration files:
WarningsAsErrors: ''
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
ImplementationFileExtensions: ['c','cc','cpp','cxx']
HeaderFilterRegex: ''
HeaderFilterRegex: '.*'
FormatStyle: none
InheritParentConfig: true
User: user
Expand Down Expand Up @@ -132,14 +132,16 @@ file, if any.

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

static cl::opt<std::string> ExcludeHeaderFilter("exclude-header-filter",
Expand Down Expand Up @@ -379,9 +381,9 @@ static void printStats(const ClangTidyStats &Stats) {
<< " with check filters";
llvm::errs() << ").\n";
if (Stats.ErrorsIgnoredNonUserCode)
llvm::errs() << "Use -header-filter=.* to display errors from all "
"non-system headers. Use -system-headers to display "
"errors from system headers as well.\n";
llvm::errs() << "Use -header-filter=.* or leave it as default to display "
"errors from all non-system headers. Use -system-headers "
"to display errors from system headers as well.\n";
}
}

Expand Down
5 changes: 5 additions & 0 deletions clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context) {
SourceLocation AmpLocation = Var.getLocation();
auto Token = utils::lexer::getPreviousToken(
AmpLocation, Context.getSourceManager(), Context.getLangOpts());

// For parameter packs the '&' must go before the '...' token
if (Token.is(tok::ellipsis))
return FixItHint::CreateInsertion(Token.getLocation(), "&");

if (!Token.is(tok::unknown))
AmpLocation = Lexer::getLocForEndOfToken(Token.getLocation(), 0,
Context.getSourceManager(),
Expand Down
13 changes: 12 additions & 1 deletion clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ Potentially Breaking Changes
:doc:`bugprone-signed-char-misuse
<clang-tidy/checks/bugprone/signed-char-misuse>`

- :program:`clang-tidy` now displays warnings from all non-system headers by
default. Previously, users had to explicitly opt-in to header warnings using
`-header-filter='.*'`. To disable warnings from non-system, set `-header-filter`
to an empty string.

Improvements to clangd
----------------------

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

- :program:`clang-tidy` now displays warnings from all non-system headers by
default. Previously, users had to explicitly opt-in to header warnings using
`-header-filter='.*'`. To disable warnings from non-system, set `-header-filter`
to an empty string.

- :program:`clang-tidy` no longer attempts to analyze code from system headers
by default, greatly improving performance. This behavior is disabled if the
`SystemHeaders` option is enabled.
Expand Down Expand Up @@ -407,7 +417,8 @@ Changes in existing checks

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

- Improved :doc:`portability-template-virtual-member-function
<clang-tidy/checks/portability/template-virtual-member-function>` check to
Expand Down
6 changes: 4 additions & 2 deletions clang-tools-extra/docs/clang-tidy/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ An overview of all the command-line options:
This option overrides the 'FormatStyle` option in
.clang-tidy file, if any.
--header-filter=<string> - Regular expression matching the names of the
headers to output diagnostics from. Diagnostics
headers to output diagnostics from. The default
value is '.*', i.e. diagnostics from all non-system
headers are displayed by default. Diagnostics
from the main file of each translation unit are
always displayed.
Can be used together with -line-filter.
Expand Down Expand Up @@ -338,7 +340,7 @@ An overview of all the command-line options:
WarningsAsErrors: ''
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
ImplementationFileExtensions: ['c','cc','cpp','cxx']
HeaderFilterRegex: ''
HeaderFilterRegex: '.*'
FormatStyle: none
InheritParentConfig: true
User: user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t, -- -- -I %S/Inputs
// RUN: %check_clang_tidy %s abseil-no-internal-dependencies %t, -- -header-filter='' -- -I %S/Inputs
// RUN: clang-tidy -checks='-*, abseil-no-internal-dependencies' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s

#include "absl/strings/internal-file.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -- -I %S/Inputs
// RUN: %check_clang_tidy %s abseil-no-namespace %t -- -header-filter='' -- -I %S/Inputs
// RUN: clang-tidy -checks='-*, abseil-no-namespace' -header-filter='.*' %s -- -I %S/Inputs 2>&1 | FileCheck %s

/// Warning will not be triggered on internal Abseil code that is included.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- -- \
// RUN: %check_clang_tidy %s bugprone-reserved-identifier %t -- \
// RUN: -header-filter='' -- \
// RUN: -I%S/Inputs/reserved-identifier \
// RUN: -isystem %S/Inputs/reserved-identifier/system

// no warnings expected without -header-filter=
// no warnings expected with -header-filter=''
#include "user-header.h"
#include <system-header.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy %s google-upgrade-googletest-case %t -- -- -I%S/Inputs
// RUN: %check_clang_tidy -check-suffix=NOSUITE %s google-upgrade-googletest-case %t -- -- -DNOSUITE -I%S/Inputs/gtest/nosuite
// RUN: %check_clang_tidy %s google-upgrade-googletest-case %t -- -- -isystem%S/Inputs
// RUN: %check_clang_tidy -check-suffix=NOSUITE %s google-upgrade-googletest-case %t -- -- -DNOSUITE -isystem%S/Inputs/gtest/nosuite

#include "gtest/gtest.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- -I %S/Inputs/replace-auto-ptr
// RUN: %check_clang_tidy %s modernize-replace-auto-ptr %t -- -- -isystem %S/Inputs/replace-auto-ptr

// CHECK-FIXES: #include <utility>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s modernize-use-using %t -- -- -fno-delayed-template-parsing -I %S/Inputs/use-using/
// RUN: %check_clang_tidy %s modernize-use-using %t -- -- -fno-delayed-template-parsing -isystem %S/Inputs/use-using/

typedef int Type;
// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,34 @@ void lambdaNonConstAutoValue() {
};
fn(ExpensiveToCopyType());
}

template <typename... Args>
void ParameterPack(Args... args) {
// CHECK-MESSAGES: [[@LINE-1]]:28: warning: the parameter 'args' of type 'ExpensiveToCopyType'
// CHECK-FIXES: void ParameterPack(const Args&... args) {
}

template <typename... Args>
void ParameterPackConst(Args const... args) {
// CHECK-MESSAGES: [[@LINE-1]]:39: warning: the const qualified parameter 'args' of type 'const ExpensiveToCopyType'
// CHECK-FIXES: void ParameterPackConst(Args const&... args) {
}

template <typename... Args>
void ParameterPackWithParams(const ExpensiveToCopyType E1, ExpensiveToCopyType E2, Args... args) {
// CHECK-MESSAGES: [[@LINE-1]]:56: warning: the const qualified parameter 'E1'
// CHECK-MESSAGES: [[@LINE-2]]:80: warning: the parameter 'E2'
// CHECK-MESSAGES: [[@LINE-3]]:92: warning: the parameter 'args'
// CHECK-FIXES: void ParameterPackWithParams(const ExpensiveToCopyType& E1, const ExpensiveToCopyType& E2, const Args&... args) {
}

template <typename... Args>
void PackWithNonExpensive(int x, Args... args) {}

void instantiatedParameterPack() {
ExpensiveToCopyType E;
ParameterPack(E);
ParameterPackConst(E);
ParameterPackWithParams(E, E, E);
PackWithNonExpensive(5, 5);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// RUN: %check_clang_tidy %s readability-duplicate-include %t -- -- -isystem %S/Inputs/duplicate-include/system -I %S/Inputs/duplicate-include
// RUN: %check_clang_tidy %s readability-duplicate-include %t -- \
// RUN: -header-filter='' \
// RUN: -- -isystem %S/Inputs/duplicate-include/system -I %S/Inputs/duplicate-include

int a;
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
// RUN: readability-identifier-naming.LocalPointerPrefix: 'l_', \
// RUN: readability-identifier-naming.LocalConstantPointerCase: CamelCase, \
// RUN: readability-identifier-naming.LocalConstantPointerPrefix: 'lc_', \
// RUN: }}' -- -fno-delayed-template-parsing -Dbad_macro \
// RUN: }}' \
// RUN: -header-filter='' \
// RUN: -- -fno-delayed-template-parsing -Dbad_macro \
// RUN: -I%S/Inputs/identifier-naming \
// RUN: -isystem %S/Inputs/identifier-naming/system

Expand All @@ -95,8 +97,7 @@
#include <system-header.h>
#include <coroutines.h>
#include "user-header.h"
// NO warnings or fixes expected from declarations within header files without
// the -header-filter= option
// NO warnings or fixes expected from declarations with the -header-filter='' option

namespace FOO_NS {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 'FOO_NS' [readability-identifier-naming]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

// RUN: clang-tidy -checks='-*,google-explicit-constructor' --config='{}' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK-DEFAULT %s
// RUN: clang-tidy -checks='-*,google-explicit-constructor' --config='{}' -header-filter='' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK-EMPTY %s
// RUN: clang-tidy -checks='-*,google-explicit-constructor' --config='{}' -header-filter='.*' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK-EXPLICIT %s
// RUN: clang-tidy -checks='-*,google-explicit-constructor' --config='{}' %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK-NO-SYSTEM %s
// RUN: clang-tidy -checks='-*,google-explicit-constructor' --config='{}' -system-headers %s -- -I %S/Inputs/file-filter -isystem %S/Inputs/file-filter/system 2>&1 | FileCheck --check-prefix=CHECK-WITH-SYSTEM %s

#include "header1.h"
// CHECK-DEFAULT: header1.h:1:12: warning: single-argument constructors must be marked explicit
// CHECK-EMPTY-NOT: header1.h:1:12: warning:
// CHECK-EXPLICIT: header1.h:1:12: warning: single-argument constructors must be marked explicit
// CHECK-NO-SYSTEM: header1.h:1:12: warning: single-argument constructors must be marked explicit
// CHECK-WITH-SYSTEM-DAG: header1.h:1:12: warning: single-argument constructors must be marked explicit

#include <system-header.h>
// CHECK-DEFAULT-NOT: system-header.h:1:12: warning:
// CHECK-EMPTY-NOT: system-header.h:1:12: warning:
// CHECK-EXPLICIT-NOT: system-header.h:1:12: warning:
// CHECK-NO-SYSTEM-NOT: system-header.h:1:12: warning:
// CHECK-WITH-SYSTEM-DAG: system-header.h:1:12: warning: single-argument constructors must be marked explicit

class A { A(int); };
// CHECK-DEFAULT: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit
// CHECK-EMPTY: :[[@LINE-2]]:11: warning: single-argument constructors must be marked explicit
// CHECK-EXPLICIT: :[[@LINE-3]]:11: warning: single-argument constructors must be marked explicit
// CHECK-NO-SYSTEM: :[[@LINE-4]]:11: warning: single-argument constructors must be marked explicit
// CHECK-WITH-SYSTEM: :[[@LINE-5]]:11: warning: single-argument constructors must be marked explicit
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class A { A(int); };
// CHECK4-NOT: warning:
// CHECK4-QUIET-NOT: warning:

// CHECK: Use -header-filter=.* to display errors from all non-system headers.
// CHECK: Use -header-filter=.* or leave it as default to display errors from all non-system headers.
// CHECK-QUIET-NOT: Suppressed
// CHECK2-QUIET-NOT: Suppressed
// CHECK3: Use -header-filter=.* {{.*}}
Expand Down
Loading