Skip to content

Commit da007dd

Browse files
authored
Merge pull request #554 from Xilinx/bump_to_3057d0f1
[AutoBump] Merge with 3057d0f (Jan 22) (16)
2 parents b92605a + 789c55b commit da007dd

File tree

1,663 files changed

+80694
-55737
lines changed

Some content is hidden

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

1,663 files changed

+80694
-55737
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-24.04
14+
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- c_compiler: clang
19+
- os: ubuntu-24.04
20+
ccache-variant: sccache
21+
c_compiler: clang
22+
cpp_compiler: clang++
23+
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
24+
- os: ubuntu-24.04-arm
25+
ccache-variant: ccache
26+
c_compiler: clang
2027
cpp_compiler: clang++
2128
# TODO: add back gcc build when it is fixed
2229
# - c_compiler: gcc
@@ -35,7 +42,7 @@ jobs:
3542
with:
3643
max-size: 1G
3744
key: libc_fullbuild_${{ matrix.c_compiler }}
38-
variant: sccache
45+
variant: ${{ matrix.ccache-variant }}
3946

4047
# Notice:
4148
# - MPFR is required by some of the mathlib tests.
@@ -62,8 +69,8 @@ jobs:
6269
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6370
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
6471
-DCMAKE_BUILD_TYPE=MinSizeRel
65-
-DCMAKE_C_COMPILER_LAUNCHER=sccache
66-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
72+
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
73+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
6774
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
6875
-DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
6976
-DLLVM_LIBC_FULL_BUILD=ON

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@ jobs:
1919
include:
2020
# TODO: add linux gcc when it is fixed
2121
- os: ubuntu-24.04
22+
ccache-variant: sccache
23+
compiler:
24+
c_compiler: clang
25+
cpp_compiler: clang++
26+
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
27+
- os: ubuntu-24.04-arm
28+
ccache-variant: ccache
2229
compiler:
2330
c_compiler: clang
2431
cpp_compiler: clang++
2532
- os: windows-2022
33+
ccache-variant: sccache
34+
compiler:
35+
c_compiler: clang-cl
36+
cpp_compiler: clang-cl
37+
- os: windows-2025
38+
ccache-variant: sccache
2639
compiler:
2740
c_compiler: clang-cl
2841
cpp_compiler: clang-cl
2942
- os: macos-14
43+
ccache-variant: sccache
3044
compiler:
3145
c_compiler: clang
3246
cpp_compiler: clang++
@@ -46,7 +60,7 @@ jobs:
4660
with:
4761
max-size: 1G
4862
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
49-
variant: sccache
63+
variant: ${{ matrix.ccache-variant }}
5064

5165
# MPFR is required by some of the mathlib tests.
5266
- name: Prepare dependencies (Ubuntu)
@@ -82,8 +96,8 @@ jobs:
8296
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
8397
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
8498
-DCMAKE_BUILD_TYPE=MinSizeRel
85-
-DCMAKE_C_COMPILER_LAUNCHER=sccache
86-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
99+
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
100+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
87101
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
88102
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
89103
-DLLVM_ENABLE_RUNTIMES=libc

.github/workflows/release-binaries.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
prepare:
5050
name: Prepare to build binaries
5151
runs-on: ${{ inputs.runs-on }}
52-
if: github.repository == 'llvm/llvm-project'
52+
if: github.repository_owner == 'llvm'
5353
outputs:
5454
release-version: ${{ steps.vars.outputs.release-version }}
5555
ref: ${{ steps.vars.outputs.ref }}
@@ -177,7 +177,7 @@ jobs:
177177
build-release-package:
178178
name: "Build Release Package"
179179
needs: prepare
180-
if: github.repository == 'llvm/llvm-project'
180+
if: github.repository_owner == 'llvm'
181181
runs-on: ${{ needs.prepare.outputs.build-runs-on }}
182182
steps:
183183

@@ -327,7 +327,7 @@ jobs:
327327
- prepare
328328
- build-release-package
329329
if: >-
330-
github.repository == 'llvm/llvm-project'
330+
github.repository_owner == 'llvm'
331331
runs-on: ${{ needs.prepare.outputs.test-runs-on }}
332332
steps:
333333
- name: Checkout Actions

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,25 @@ ClangTidyProfiling::StorageParams::StorageParams(llvm::StringRef ProfilePrefix,
3636
.str();
3737
}
3838

39-
void ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS) {
40-
TG->print(OS);
39+
void ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS,
40+
llvm::TimerGroup &TG) {
41+
TG.print(OS);
4142
OS.flush();
4243
}
4344

44-
void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS) {
45+
void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS,
46+
llvm::TimerGroup &TG) {
4547
OS << "{\n";
4648
OS << R"("file": ")" << Storage->SourceFilename << "\",\n";
4749
OS << R"("timestamp": ")" << Storage->Timestamp << "\",\n";
4850
OS << "\"profile\": {\n";
49-
TG->printJSONValues(OS, "");
51+
TG.printJSONValues(OS, "");
5052
OS << "\n}\n";
5153
OS << "}\n";
5254
OS.flush();
5355
}
5456

55-
void ClangTidyProfiling::storeProfileData() {
57+
void ClangTidyProfiling::storeProfileData(llvm::TimerGroup &TG) {
5658
assert(Storage && "We should have a filename.");
5759

5860
llvm::SmallString<256> OutputDirectory(Storage->StoreFilename);
@@ -71,19 +73,18 @@ void ClangTidyProfiling::storeProfileData() {
7173
return;
7274
}
7375

74-
printAsJSON(OS);
76+
printAsJSON(OS, TG);
7577
}
7678

7779
ClangTidyProfiling::ClangTidyProfiling(std::optional<StorageParams> Storage)
7880
: Storage(std::move(Storage)) {}
7981

8082
ClangTidyProfiling::~ClangTidyProfiling() {
81-
TG.emplace("clang-tidy", "clang-tidy checks profiling", Records);
82-
83+
llvm::TimerGroup TG{"clang-tidy", "clang-tidy checks profiling", Records};
8384
if (!Storage)
84-
printUserFriendlyTable(llvm::errs());
85+
printUserFriendlyTable(llvm::errs(), TG);
8586
else
86-
storeProfileData();
87+
storeProfileData(TG);
8788
}
8889

8990
} // namespace clang::tidy

clang-tools-extra/clang-tidy/ClangTidyProfiling.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,11 @@ class ClangTidyProfiling {
3434
};
3535

3636
private:
37-
std::optional<llvm::TimerGroup> TG;
38-
3937
std::optional<StorageParams> Storage;
4038

41-
void printUserFriendlyTable(llvm::raw_ostream &OS);
42-
void printAsJSON(llvm::raw_ostream &OS);
43-
44-
void storeProfileData();
39+
void printUserFriendlyTable(llvm::raw_ostream &OS, llvm::TimerGroup &TG);
40+
void printAsJSON(llvm::raw_ostream &OS, llvm::TimerGroup &TG);
41+
void storeProfileData(llvm::TimerGroup &TG);
4542

4643
public:
4744
llvm::StringMap<llvm::TimeRecord> Records;

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "clang/AST/ASTContext.h"
1111
#include "clang/AST/Decl.h"
1212
#include "clang/ASTMatchers/ASTMatchFinder.h"
13+
#include "clang/ASTMatchers/ASTMatchers.h"
1314
#include "clang/Lex/Lexer.h"
1415

1516
using namespace clang::ast_matchers;
@@ -50,6 +51,10 @@ UnusedUsingDeclsCheck::UnusedUsingDeclsCheck(StringRef Name,
5051
HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
5152

5253
void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
54+
// We don't emit warnings on unused-using-decls from headers, so bail out if
55+
// the main file is a header.
56+
if (utils::isFileExtension(getCurrentMainFile(), HeaderFileExtensions))
57+
return;
5358
Finder->addMatcher(usingDecl(isExpansionInMainFile()).bind("using"), this);
5459
auto DeclMatcher = hasDeclaration(namedDecl().bind("used"));
5560
Finder->addMatcher(loc(templateSpecializationType(DeclMatcher)), this);
@@ -82,12 +87,6 @@ void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
8287
void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
8388
if (Result.Context->getDiagnostics().hasUncompilableErrorOccurred())
8489
return;
85-
// We don't emit warnings on unused-using-decls from headers, so bail out if
86-
// the main file is a header.
87-
if (auto MainFile = Result.SourceManager->getFileEntryRefForID(
88-
Result.SourceManager->getMainFileID());
89-
utils::isFileExtension(MainFile->getName(), HeaderFileExtensions))
90-
return;
9190

9291
if (const auto *Using = Result.Nodes.getNodeAs<UsingDecl>("using")) {
9392
// Ignores using-declarations defined in macros.

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ UseIntegerSignComparisonCheck::UseIntegerSignComparisonCheck(
8080
: ClangTidyCheck(Name, Context),
8181
IncludeInserter(Options.getLocalOrGlobal("IncludeStyle",
8282
utils::IncludeSorter::IS_LLVM),
83-
areDiagsSelfContained()) {}
83+
areDiagsSelfContained()),
84+
EnableQtSupport(Options.get("EnableQtSupport", false)) {}
8485

8586
void UseIntegerSignComparisonCheck::storeOptions(
8687
ClangTidyOptions::OptionMap &Opts) {
8788
Options.store(Opts, "IncludeStyle", IncludeInserter.getStyle());
89+
Options.store(Opts, "EnableQtSupport", EnableQtSupport);
8890
}
8991

9092
void UseIntegerSignComparisonCheck::registerMatchers(MatchFinder *Finder) {
@@ -154,8 +156,17 @@ void UseIntegerSignComparisonCheck::check(
154156
DiagnosticBuilder Diag =
155157
diag(BinaryOp->getBeginLoc(),
156158
"comparison between 'signed' and 'unsigned' integers");
157-
const std::string CmpNamespace = ("std::" + parseOpCode(OpCode)).str();
158-
const std::string CmpHeader = "<utility>";
159+
std::string CmpNamespace;
160+
llvm::StringRef CmpHeader;
161+
162+
if (getLangOpts().CPlusPlus20) {
163+
CmpHeader = "<utility>";
164+
CmpNamespace = llvm::Twine("std::" + parseOpCode(OpCode)).str();
165+
} else if (getLangOpts().CPlusPlus17 && EnableQtSupport) {
166+
CmpHeader = "<QtCore/q20utility.h>";
167+
CmpNamespace = llvm::Twine("q20::" + parseOpCode(OpCode)).str();
168+
}
169+
159170
// Prefer modernize-use-integer-sign-comparison when C++20 is available!
160171
Diag << FixItHint::CreateReplacement(
161172
CharSourceRange(R1, SubExprLHS != nullptr),

clang-tools-extra/clang-tidy/modernize/UseIntegerSignComparisonCheck.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ class UseIntegerSignComparisonCheck : public ClangTidyCheck {
3030
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3131
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3232
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
33-
return LangOpts.CPlusPlus20;
33+
return LangOpts.CPlusPlus20 || (LangOpts.CPlusPlus17 && EnableQtSupport);
3434
}
3535

3636
private:
3737
utils::IncludeInserter IncludeInserter;
38+
const bool EnableQtSupport;
3839
};
3940

4041
} // namespace clang::tidy::modernize

clang-tools-extra/clangd/GlobalCompilationDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ OverlayCDB::getProjectModules(PathRef File) const {
837837
PathRef CommandPath) {
838838
Mangler(Command, CommandPath);
839839
});
840-
return std::move(MDB);
840+
return MDB;
841841
}
842842

843843
DelegatingCDB::DelegatingCDB(const GlobalCompilationDatabase *Base)

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ Changes in existing checks
329329
<clang-tidy/checks/modernize/use-designated-initializers>` check to fix a
330330
crash when a class is declared but not defined.
331331

332+
- Improved :doc:`modernize-use-integer-sign-comparison
333+
<clang-tidy/checks/modernize/use-integer-sign-comparison>` check to
334+
add an option ``EnableQtSupport``, that makes C++17 ``q20::cmp_*`` alternative
335+
available for Qt-based applications.
336+
332337
- Improved :doc:`modernize-use-nullptr
333338
<clang-tidy/checks/modernize/use-nullptr>` check to also recognize
334339
``NULL``/``__null`` (but not ``0``) when used with a templated type.

0 commit comments

Comments
 (0)