Skip to content

Commit b4101ff

Browse files
Merge branch 'main' into an/avx-masked-shuffles
2 parents fcf5e8b + 4030b27 commit b4101ff

File tree

534 files changed

+8984
-5230
lines changed

Some content is hidden

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

534 files changed

+8984
-5230
lines changed

.github/workflows/build-ci-container-tooling.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build CI Container
1+
name: Build CI Tooling Containers
22

33
permissions:
44
contents: read
@@ -101,7 +101,7 @@ jobs:
101101
}
102102
103103
podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
104-
for f in $(find . -iname *.tar); do
104+
for f in $(find . -iname '*.tar'); do
105105
image_name=$(podman load -q -i $f | sed 's/Loaded image: //g')
106106
push_container $image_name
107107

.github/workflows/build-ci-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
}
104104
105105
podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
106-
for f in $(find . -iname *.tar); do
106+
for f in $(find . -iname '*.tar'); do
107107
image_name=$(podman load -q -i $f | sed 's/Loaded image: //g')
108108
push_container $image_name
109109

bolt/utils/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:24.04 AS builder
1+
FROM docker.io/library/ubuntu:24.04 AS builder
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
ENV TZ=UTC
@@ -25,6 +25,6 @@ RUN mkdir build && \
2525
ninja check-bolt && \
2626
ninja install-llvm-bolt install-merge-fdata install-bolt_rt
2727

28-
FROM ubuntu:24.04
28+
FROM docker.io/library/ubuntu:24.04
2929

3030
COPY --from=builder /home/bolt/install /usr/local

clang-tools-extra/clang-tidy/fuchsia/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_clang_library(clangTidyFuchsiaModule STATIC
1010
MultipleInheritanceCheck.cpp
1111
OverloadedOperatorCheck.cpp
1212
StaticallyConstructedObjectsCheck.cpp
13+
TemporaryObjectsCheck.cpp
1314
TrailingReturnCheck.cpp
1415
VirtualInheritanceCheck.cpp
1516

clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "MultipleInheritanceCheck.h"
1616
#include "OverloadedOperatorCheck.h"
1717
#include "StaticallyConstructedObjectsCheck.h"
18+
#include "TemporaryObjectsCheck.h"
1819
#include "TrailingReturnCheck.h"
1920
#include "VirtualInheritanceCheck.h"
2021

@@ -39,6 +40,8 @@ class FuchsiaModule : public ClangTidyModule {
3940
"fuchsia-overloaded-operator");
4041
CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>(
4142
"fuchsia-statically-constructed-objects");
43+
CheckFactories.registerCheck<TemporaryObjectsCheck>(
44+
"fuchsia-temporary-objects");
4245
CheckFactories.registerCheck<TrailingReturnCheck>(
4346
"fuchsia-trailing-return");
4447
CheckFactories.registerCheck<VirtualInheritanceCheck>(

clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.cpp renamed to clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
using namespace clang::ast_matchers;
1717

18-
namespace clang::tidy::zircon {
18+
namespace clang::tidy::fuchsia {
1919

2020
namespace {
2121

@@ -55,4 +55,4 @@ void TemporaryObjectsCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
5555
Options.store(Opts, "Names", utils::options::serializeStringList(Names));
5656
}
5757

58-
} // namespace clang::tidy::zircon
58+
} // namespace clang::tidy::fuchsia

clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.h renamed to clang-tools-extra/clang-tidy/fuchsia/TemporaryObjectsCheck.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
10-
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TEMPORARYOBJECTSCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TEMPORARYOBJECTSCHECK_H
1111

1212
#include "../ClangTidyCheck.h"
1313
#include "../utils/OptionsUtils.h"
1414

15-
namespace clang::tidy::zircon {
15+
namespace clang::tidy::fuchsia {
1616

1717
/// Construction of specific temporary objects in the Zircon kernel is
1818
/// discouraged.
1919
///
2020
/// For the user-facing documentation see:
21-
/// https://clang.llvm.org/extra/clang-tidy/checks/zircon/temporary-objects.html
21+
/// https://clang.llvm.org/extra/clang-tidy/checks/fuchsia/temporary-objects.html
2222
class TemporaryObjectsCheck : public ClangTidyCheck {
2323
public:
2424
TemporaryObjectsCheck(StringRef Name, ClangTidyContext *Context)
@@ -35,6 +35,6 @@ class TemporaryObjectsCheck : public ClangTidyCheck {
3535
std::vector<StringRef> Names;
3636
};
3737

38-
} // namespace clang::tidy::zircon
38+
} // namespace clang::tidy::fuchsia
3939

40-
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ZIRCON_TEMPORARYOBJECTSCHECK_H
40+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_TEMPORARYOBJECTSCHECK_H

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ void ConstCorrectnessCheck::check(const MatchFinder::MatchResult &Result) {
249249
CheckValue();
250250
if (WarnPointersAsPointers) {
251251
if (const auto *PT = dyn_cast<PointerType>(VT)) {
252-
if (!PT->getPointeeType().isConstQualified())
252+
if (!PT->getPointeeType().isConstQualified() &&
253+
!PT->getPointeeType()->isFunctionType())
253254
CheckPointee();
254255
}
255256
if (const auto *AT = dyn_cast<ArrayType>(VT)) {

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

Lines changed: 33 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ namespace {
2424
class IncludeModernizePPCallbacks : public PPCallbacks {
2525
public:
2626
explicit IncludeModernizePPCallbacks(
27-
std::vector<IncludeMarker> &IncludesToBeProcessed, LangOptions LangOpts,
28-
const SourceManager &SM, bool CheckHeaderFile);
27+
std::vector<IncludeMarker> &IncludesToBeProcessed,
28+
const LangOptions &LangOpts, const SourceManager &SM,
29+
bool CheckHeaderFile);
2930

3031
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
3132
StringRef FileName, bool IsAngled,
@@ -37,8 +38,7 @@ class IncludeModernizePPCallbacks : public PPCallbacks {
3738

3839
private:
3940
std::vector<IncludeMarker> &IncludesToBeProcessed;
40-
LangOptions LangOpts;
41-
llvm::StringMap<std::string> CStyledHeaderToCxx;
41+
llvm::StringMap<StringRef> CStyledHeaderToCxx;
4242
llvm::StringSet<> DeleteHeaders;
4343
const SourceManager &SM;
4444
bool CheckHeaderFile;
@@ -131,48 +131,35 @@ void DeprecatedHeadersCheck::check(
131131
}
132132

133133
IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(
134-
std::vector<IncludeMarker> &IncludesToBeProcessed, LangOptions LangOpts,
135-
const SourceManager &SM, bool CheckHeaderFile)
136-
: IncludesToBeProcessed(IncludesToBeProcessed), LangOpts(LangOpts), SM(SM),
134+
std::vector<IncludeMarker> &IncludesToBeProcessed,
135+
const LangOptions &LangOpts, const SourceManager &SM, bool CheckHeaderFile)
136+
: IncludesToBeProcessed(IncludesToBeProcessed), SM(SM),
137137
CheckHeaderFile(CheckHeaderFile) {
138-
for (const auto &KeyValue :
139-
std::vector<std::pair<llvm::StringRef, std::string>>(
140-
{{"assert.h", "cassert"},
141-
{"complex.h", "complex"},
142-
{"ctype.h", "cctype"},
143-
{"errno.h", "cerrno"},
144-
{"float.h", "cfloat"},
145-
{"limits.h", "climits"},
146-
{"locale.h", "clocale"},
147-
{"math.h", "cmath"},
148-
{"setjmp.h", "csetjmp"},
149-
{"signal.h", "csignal"},
150-
{"stdarg.h", "cstdarg"},
151-
{"stddef.h", "cstddef"},
152-
{"stdio.h", "cstdio"},
153-
{"stdlib.h", "cstdlib"},
154-
{"string.h", "cstring"},
155-
{"time.h", "ctime"},
156-
{"wchar.h", "cwchar"},
157-
{"wctype.h", "cwctype"}})) {
158-
CStyledHeaderToCxx.insert(KeyValue);
159-
}
160-
// Add C++11 headers.
161-
if (LangOpts.CPlusPlus11) {
162-
for (const auto &KeyValue :
163-
std::vector<std::pair<llvm::StringRef, std::string>>(
164-
{{"fenv.h", "cfenv"},
165-
{"stdint.h", "cstdint"},
166-
{"inttypes.h", "cinttypes"},
167-
{"tgmath.h", "ctgmath"},
168-
{"uchar.h", "cuchar"}})) {
169-
CStyledHeaderToCxx.insert(KeyValue);
170-
}
171-
}
172-
for (const auto &Key :
173-
std::vector<std::string>({"stdalign.h", "stdbool.h", "iso646.h"})) {
174-
DeleteHeaders.insert(Key);
175-
}
138+
139+
static constexpr std::pair<StringRef, StringRef> CXX98Headers[] = {
140+
{"assert.h", "cassert"}, {"complex.h", "complex"},
141+
{"ctype.h", "cctype"}, {"errno.h", "cerrno"},
142+
{"float.h", "cfloat"}, {"limits.h", "climits"},
143+
{"locale.h", "clocale"}, {"math.h", "cmath"},
144+
{"setjmp.h", "csetjmp"}, {"signal.h", "csignal"},
145+
{"stdarg.h", "cstdarg"}, {"stddef.h", "cstddef"},
146+
{"stdio.h", "cstdio"}, {"stdlib.h", "cstdlib"},
147+
{"string.h", "cstring"}, {"time.h", "ctime"},
148+
{"wchar.h", "cwchar"}, {"wctype.h", "cwctype"},
149+
};
150+
CStyledHeaderToCxx.insert(std::begin(CXX98Headers), std::end(CXX98Headers));
151+
152+
static constexpr std::pair<StringRef, StringRef> CXX11Headers[] = {
153+
{"fenv.h", "cfenv"}, {"stdint.h", "cstdint"},
154+
{"inttypes.h", "cinttypes"}, {"tgmath.h", "ctgmath"},
155+
{"uchar.h", "cuchar"},
156+
};
157+
if (LangOpts.CPlusPlus11)
158+
CStyledHeaderToCxx.insert(std::begin(CXX11Headers), std::end(CXX11Headers));
159+
160+
static constexpr StringRef HeadersToDelete[] = {"stdalign.h", "stdbool.h",
161+
"iso646.h"};
162+
DeleteHeaders.insert_range(HeadersToDelete);
176163
}
177164

178165
void IncludeModernizePPCallbacks::InclusionDirective(
@@ -205,7 +192,7 @@ void IncludeModernizePPCallbacks::InclusionDirective(
205192
} else if (DeleteHeaders.contains(FileName)) {
206193
IncludesToBeProcessed.emplace_back(
207194
// NOLINTNEXTLINE(modernize-use-emplace) - false-positive
208-
IncludeMarker{std::string{}, FileName,
195+
IncludeMarker{StringRef{}, FileName,
209196
SourceRange{HashLoc, FilenameRange.getEnd()}, DiagLoc});
210197
}
211198
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DeprecatedHeadersCheck : public ClangTidyCheck {
4444
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
4545

4646
struct IncludeMarker {
47-
std::string Replacement;
47+
StringRef Replacement;
4848
StringRef FileName;
4949
SourceRange ReplacementRange;
5050
SourceLocation DiagLoc;

0 commit comments

Comments
 (0)