Skip to content

Commit 410f28b

Browse files
authored
Merge branch 'main' into fix/allow-AVX512-masked-arithmetic-intrinsics
2 parents 679c6e6 + bba40ab commit 410f28b

File tree

291 files changed

+11163
-3054
lines changed

Some content is hidden

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

291 files changed

+11163
-3054
lines changed

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Checks: >
1515
performance-*,
1616
-performance-enum-size,
1717
-performance-no-int-to-ptr,
18-
-performance-unnecessary-value-param,
1918
readability-*,
2019
-readability-avoid-nested-conditional-operator,
2120
-readability-braces-around-statements,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ ClangTidyASTConsumerFactory::createASTConsumer(
455455

456456
if (Context.canEnableModuleHeadersParsing() &&
457457
Context.getLangOpts().Modules && OverlayFS != nullptr) {
458-
auto ModuleExpander =
459-
std::make_unique<ExpandModularHeadersPPCallbacks>(&Compiler, OverlayFS);
458+
auto ModuleExpander = std::make_unique<ExpandModularHeadersPPCallbacks>(
459+
&Compiler, *OverlayFS);
460460
ModuleExpanderPP = ModuleExpander->getPreprocessor();
461461
PP->addPPCallbacks(std::move(ModuleExpander));
462462
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ class ExpandModularHeadersPPCallbacks::FileRecorder {
6565
};
6666

6767
ExpandModularHeadersPPCallbacks::ExpandModularHeadersPPCallbacks(
68-
CompilerInstance *CI,
69-
IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS)
68+
CompilerInstance *CI, llvm::vfs::OverlayFileSystem &OverlayFS)
7069
: Recorder(std::make_unique<FileRecorder>()), Compiler(*CI),
7170
InMemoryFs(new llvm::vfs::InMemoryFileSystem),
7271
Sources(Compiler.getSourceManager()),
@@ -76,7 +75,7 @@ ExpandModularHeadersPPCallbacks::ExpandModularHeadersPPCallbacks(
7675
LangOpts(Compiler.getLangOpts()), HSOpts(Compiler.getHeaderSearchOpts()) {
7776
// Add a FileSystem containing the extra files needed in place of modular
7877
// headers.
79-
OverlayFS->pushOverlay(InMemoryFs);
78+
OverlayFS.pushOverlay(InMemoryFs);
8079

8180
Diags.setSourceManager(&Sources);
8281
// FIXME: Investigate whatever is there better way to initialize DiagEngine

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ namespace tooling {
4141
/// non-modular way.
4242
class ExpandModularHeadersPPCallbacks : public PPCallbacks {
4343
public:
44-
ExpandModularHeadersPPCallbacks(
45-
CompilerInstance *CI,
46-
IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem> OverlayFS);
44+
ExpandModularHeadersPPCallbacks(CompilerInstance *CI,
45+
llvm::vfs::OverlayFileSystem &OverlayFS);
4746
~ExpandModularHeadersPPCallbacks() override;
4847

4948
/// Returns the preprocessor that provides callbacks for the whole

clang-tools-extra/clang-tidy/android/CloexecCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static std::string buildFixMsgForStringFlag(const Expr *Arg,
3636
}
3737

3838
void CloexecCheck::registerMatchersImpl(
39-
MatchFinder *Finder, internal::Matcher<FunctionDecl> Function) {
39+
MatchFinder *Finder, const internal::Matcher<FunctionDecl> &Function) {
4040
// We assume all the checked APIs are C functions.
4141
Finder->addMatcher(
4242
callExpr(

clang-tools-extra/clang-tidy/android/CloexecCheck.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class CloexecCheck : public ClangTidyCheck {
2929
: ClangTidyCheck(Name, Context) {}
3030

3131
protected:
32-
void
33-
registerMatchersImpl(ast_matchers::MatchFinder *Finder,
34-
ast_matchers::internal::Matcher<FunctionDecl> Function);
32+
void registerMatchersImpl(
33+
ast_matchers::MatchFinder *Finder,
34+
const ast_matchers::internal::Matcher<FunctionDecl> &Function);
3535

3636
/// Currently, we have three types of fixes.
3737
///

clang-tools-extra/clang-tidy/boost/UseRangesCheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <initializer_list>
1919
#include <optional>
2020
#include <string>
21+
#include <utility>
2122

2223
// FixItHint - Let the docs script know that this class does provide fixits
2324

@@ -217,11 +218,11 @@ utils::UseRangesCheck::ReplacerMap UseRangesCheck::getReplacerMap() const {
217218
const auto AddFromStd =
218219
[&](llvm::IntrusiveRefCntPtr<UseRangesCheck::Replacer> Replacer,
219220
std::initializer_list<StringRef> Names) {
220-
AddFrom(Replacer, Names, "std");
221+
AddFrom(std::move(Replacer), Names, "std");
221222
};
222223

223224
const auto AddFromBoost =
224-
[&](llvm::IntrusiveRefCntPtr<UseRangesCheck::Replacer> Replacer,
225+
[&](const llvm::IntrusiveRefCntPtr<UseRangesCheck::Replacer> &Replacer,
225226
std::initializer_list<
226227
std::pair<StringRef, std::initializer_list<StringRef>>>
227228
NamespaceAndNames) {

clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "DynamicStaticInitializersCheck.h"
3131
#include "EasilySwappableParametersCheck.h"
3232
#include "EmptyCatchCheck.h"
33+
#include "ExceptionCopyConstructorThrowsCheck.h"
3334
#include "ExceptionEscapeCheck.h"
3435
#include "FloatLoopCounterCheck.h"
3536
#include "FoldInitTypeCheck.h"
@@ -155,6 +156,8 @@ class BugproneModule : public ClangTidyModule {
155156
CheckFactories.registerCheck<EasilySwappableParametersCheck>(
156157
"bugprone-easily-swappable-parameters");
157158
CheckFactories.registerCheck<EmptyCatchCheck>("bugprone-empty-catch");
159+
CheckFactories.registerCheck<ExceptionCopyConstructorThrowsCheck>(
160+
"bugprone-exception-copy-constructor-throws");
158161
CheckFactories.registerCheck<ExceptionEscapeCheck>(
159162
"bugprone-exception-escape");
160163
CheckFactories.registerCheck<FloatLoopCounterCheck>(

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ add_clang_library(clangTidyBugproneModule STATIC
2626
DynamicStaticInitializersCheck.cpp
2727
EasilySwappableParametersCheck.cpp
2828
EmptyCatchCheck.cpp
29+
ExceptionCopyConstructorThrowsCheck.cpp
2930
ExceptionEscapeCheck.cpp
3031
FloatLoopCounterCheck.cpp
3132
FoldInitTypeCheck.cpp

clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp renamed to clang-tools-extra/clang-tidy/bugprone/ExceptionCopyConstructorThrowsCheck.cpp

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

9-
#include "ThrownExceptionTypeCheck.h"
9+
#include "ExceptionCopyConstructorThrowsCheck.h"
1010
#include "clang/AST/ASTContext.h"
1111
#include "clang/ASTMatchers/ASTMatchFinder.h"
1212

1313
using namespace clang::ast_matchers;
1414

15-
namespace clang::tidy::cert {
15+
namespace clang::tidy::bugprone {
1616

17-
void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) {
17+
void ExceptionCopyConstructorThrowsCheck::registerMatchers(
18+
MatchFinder *Finder) {
1819
Finder->addMatcher(
1920
traverse(
2021
TK_AsIs,
@@ -25,10 +26,11 @@ void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) {
2526
this);
2627
}
2728

28-
void ThrownExceptionTypeCheck::check(const MatchFinder::MatchResult &Result) {
29+
void ExceptionCopyConstructorThrowsCheck::check(
30+
const MatchFinder::MatchResult &Result) {
2931
const auto *E = Result.Nodes.getNodeAs<Expr>("expr");
3032
diag(E->getExprLoc(),
3133
"thrown exception type is not nothrow copy constructible");
3234
}
3335

34-
} // namespace clang::tidy::cert
36+
} // namespace clang::tidy::bugprone

0 commit comments

Comments
 (0)