Skip to content

Commit

Permalink
Merge "merge main into amd-staging" into amd-staging
Browse files Browse the repository at this point in the history
  • Loading branch information
ronlieb committed Dec 20, 2024
2 parents 51232e7 + 931affc commit 358352b
Show file tree
Hide file tree
Showing 219 changed files with 7,390 additions and 3,322 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ e80bc777749331e9519575f416c342f7626dd14d

# NFC: clang-format test_demangle.pass.cpp but keep test "lines"
d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6

# [lldb][NFC] clang-format MainLoopPosix.cpp
66bdbfbaa08fa3d8e64a7fe136a8fb717f5cdbb7
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
/mlir/**/Transforms/SROA.* @moxinilian

# BOLT
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci @yota9

# Bazel build system.
/utils/bazel/ @rupprecht @keith
Expand Down
7 changes: 3 additions & 4 deletions clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ struct MissingIncludeInfo {
IncludeCleanerCheck::IncludeCleanerCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
IgnoreHeaders(utils::options::parseStringList(
Options.getLocalOrGlobal("IgnoreHeaders", ""))),
DeduplicateFindings(
Options.getLocalOrGlobal("DeduplicateFindings", true)) {
IgnoreHeaders(
utils::options::parseStringList(Options.get("IgnoreHeaders", ""))),
DeduplicateFindings(Options.get("DeduplicateFindings", true)) {
for (const auto &Header : IgnoreHeaders) {
if (!llvm::Regex{Header}.isValid())
configurationDiag("Invalid ignore headers regex '%0'") << Header;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class InconsistentDeclarationParameterNameCheck : public ClangTidyCheck {
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
IgnoreMacros(Options.getLocalOrGlobal("IgnoreMacros", true)),
Strict(Options.getLocalOrGlobal("Strict", false)) {}
Strict(Options.get("Strict", false)) {}

void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
Expand Down
18 changes: 18 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ Improvements to clang-tidy
- Improved :program:`run-clang-tidy.py` script. Fixed minor shutdown noise
happening on certain platforms when interrupting the script.

- Removed :program:`clang-tidy`'s global options for most of checks. All options
are changed to local options except `IncludeStyle`, `StrictMode` and
`IgnoreMacros`.

.. csv-table::
:header: "Check", "Options removed from global option"

:doc:`bugprone-reserved-identifier <clang-tidy/checks/bugprone/reserved-identifier>`, AggressiveDependentMemberLookup
:doc:`bugprone-unchecked-optional-access <clang-tidy/checks/bugprone/unchecked-optional-access>`, IgnoreSmartPointerDereference
:doc:`cppcoreguidelines-pro-type-member-init <clang-tidy/checks/cppcoreguidelines/pro-type-member-init>`, UseAssignment
:doc:`cppcoreguidelines-rvalue-reference-param-not-moved <clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved>`, AllowPartialMove; IgnoreUnnamedParams; IgnoreNonDeducedTemplateTypes
:doc:`misc-include-cleaner <clang-tidy/checks/misc/include-cleaner>`, IgnoreHeaders; DeduplicateFindings
:doc:`performance-inefficient-vector-operation <clang-tidy/checks/performance/inefficient-vector-operation>`, EnableProto
:doc:`readability-identifier-naming <clang-tidy/checks/readability/identifier-naming>`, AggressiveDependentMemberLookup
:doc:`readability-inconsistent-declaration-parameter-name <clang-tidy/checks/readability/inconsistent-declaration-parameter-name>`, Strict
:doc:`readability-redundant-access-specifiers <clang-tidy/checks/readability/redundant-access-specifiers>`, CheckFirstDeclaration
:doc:`readability-redundant-casting <clang-tidy/checks/readability/redundant-casting>`, IgnoreTypeAliases

New checks
^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
// RUN: -config="{CheckOptions: {StrictMode: true}}" --
// RUN: -config="{CheckOptions: {bugprone-argument-comment.StrictMode: true}}" --

void f(int _with_underscores_);
void g(int x_);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy -check-suffix=STRICT %s cppcoreguidelines-pro-type-const-cast %t -- -config="{CheckOptions: {StrictMode: true}}"
// RUN: %check_clang_tidy -check-suffix=STRICT %s cppcoreguidelines-pro-type-const-cast %t -- -config="{CheckOptions: {cppcoreguidelines-pro-type-const-cast.StrictMode: true}}"
// RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-const-cast %t

namespace Const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy -check-suffixes=NSTRICT,STRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t
// RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t -- -config="{CheckOptions: {StrictMode: false}}"
// RUN: %check_clang_tidy -check-suffix=NSTRICT %s cppcoreguidelines-pro-type-static-cast-downcast %t -- -config="{CheckOptions: {cppcoreguidelines-pro-type-static-cast-downcast.StrictMode: false}}"

class Base {
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
// RUN: -config="{CheckOptions: {StrictMode: true}}" --
// RUN: -config="{CheckOptions: {misc-unused-parameters.StrictMode: true}}" --

// Warn on empty function bodies in StrictMode.
namespace strict_mode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: %check_clang_tidy \
// RUN: -std=c++20 %s modernize-use-std-format %t -- \
// RUN: -config="{CheckOptions: {StrictMode: true}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-format.StrictMode: true}}" \
// RUN: -- -isystem %clang_tidy_headers \
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
// RUN: %check_clang_tidy \
// RUN: -std=c++20 %s modernize-use-std-format %t -- \
// RUN: -config="{CheckOptions: {StrictMode: false}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-format.StrictMode: false}}" \
// RUN: -- -isystem %clang_tidy_headers \
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %check_clang_tidy \
// RUN: -std=c++23 %s modernize-use-std-print %t -- \
// RUN: -config="{CheckOptions: {StrictMode: true}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-print.StrictMode: true}}" \
// RUN: -- -isystem %clang_tidy_headers
// RUN: %check_clang_tidy \
// RUN: -std=c++23 %s modernize-use-std-print %t -- \
// RUN: -config="{CheckOptions: {StrictMode: false}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-print.StrictMode: false}}" \
// RUN: -- -isystem %clang_tidy_headers

#include <cstdio>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: %check_clang_tidy -check-suffixes=,STRICT \
// RUN: -std=c++23 %s modernize-use-std-print %t -- \
// RUN: -config="{CheckOptions: {StrictMode: true}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-print.StrictMode: true}}" \
// RUN: -- -isystem %clang_tidy_headers -fexceptions \
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
// RUN: %check_clang_tidy -check-suffixes=,NOTSTRICT \
// RUN: -std=c++23 %s modernize-use-std-print %t -- \
// RUN: -config="{CheckOptions: {StrictMode: false}}" \
// RUN: -config="{CheckOptions: {modernize-use-std-print.StrictMode: false}}" \
// RUN: -- -isystem %clang_tidy_headers -fexceptions \
// RUN: -DPRI_CMDLINE_MACRO="\"s\"" \
// RUN: -D__PRI_CMDLINE_MACRO="\"s\""
Expand Down
14 changes: 8 additions & 6 deletions clang-tools-extra/unittests/clang-tidy/IncludeCleanerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ TEST(IncludeCleanerCheckTest, SuppressUnusedIncludes) {

std::vector<ClangTidyError> Errors;
ClangTidyOptions Opts;
Opts.CheckOptions["IgnoreHeaders"] = llvm::StringRef{llvm::formatv(
"bar.h;{0};{1};vector;<list>;",
llvm::Regex::escape(appendPathFileSystemIndependent({"foo", "qux.h"})),
llvm::Regex::escape(appendPathFileSystemIndependent({"baz", "qux"})))};
Opts.CheckOptions["test-check-0.IgnoreHeaders"] = llvm::StringRef{
llvm::formatv("bar.h;{0};{1};vector;<list>;",
llvm::Regex::escape(
appendPathFileSystemIndependent({"foo", "qux.h"})),
llvm::Regex::escape(
appendPathFileSystemIndependent({"baz", "qux"})))};
EXPECT_EQ(
PostCode,
runCheckOnCode<IncludeCleanerCheck>(
Expand Down Expand Up @@ -139,7 +141,7 @@ int BarResult2 = $diag2^bar();)");
{
std::vector<ClangTidyError> Errors;
ClangTidyOptions Opts;
Opts.CheckOptions.insert({"DeduplicateFindings", "false"});
Opts.CheckOptions["test-check-0.DeduplicateFindings"] = "false";
runCheckOnCode<IncludeCleanerCheck>(Code.code(), &Errors, "file.cpp", {},
Opts,
{{"baz.h", R"(#pragma once
Expand Down Expand Up @@ -170,7 +172,7 @@ std::vector x;
)";

ClangTidyOptions Opts;
Opts.CheckOptions["IgnoreHeaders"] = llvm::StringRef{
Opts.CheckOptions["test-check-0.IgnoreHeaders"] = llvm::StringRef{
"public.h;<vector>;baz.h;" +
llvm::Regex::escape(appendPathFileSystemIndependent({"foo", "qux.h"}))};
std::vector<ClangTidyError> Errors;
Expand Down
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ Bug Fixes to C++ Support
missing placeholder return type. (#GH78694)
- Fixed a bug where bounds of partially expanded pack indexing expressions were checked too early. (#GH116105)
- Fixed an assertion failure caused by using ``consteval`` in condition in consumed analyses. (#GH117385)
- Fixed an assertion failure caused by invalid default argument substitutions in non-defining
friend declarations. (#GH113324)
- Fix a crash caused by incorrect argument position in merging deduced template arguments. (#GH113659)
- Fixed a parser crash when using pack indexing as a nested name specifier. (#GH119072)
- Fixed a null pointer dereference issue when heuristically computing ``sizeof...(pack)`` expressions. (#GH81436)
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -7048,6 +7048,7 @@ defm underscoring : OptInFC1FFlag<"underscoring", "Appends one trailing undersco
defm ppc_native_vec_elem_order: BoolOptionWithoutMarshalling<"f", "ppc-native-vector-element-order",
PosFlag<SetTrue, [], [ClangOption], "Specifies PowerPC native vector element order (default)">,
NegFlag<SetFalse, [], [ClangOption], "Specifies PowerPC non-native vector element order">>;
defm unsigned : OptInFC1FFlag<"unsigned", "Enables UNSIGNED type">;

def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>,
HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">;
Expand Down
Loading

0 comments on commit 358352b

Please sign in to comment.