Skip to content

Commit 128a3f6

Browse files
committed
Merge remote-tracking branch 'official/main' into users/meinersbur/runtimes_output-dir
2 parents 983ebe8 + 67c8e38 commit 128a3f6

File tree

714 files changed

+75401
-68217
lines changed

Some content is hidden

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

714 files changed

+75401
-68217
lines changed

.github/workflows/libcxx-build-containers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ jobs:
6464

6565
- name: Push the images
6666
if: github.event_name == 'push'
67-
run: docker compose push libcxx-linux-builder-base libcxx-linux-builder libcxx-android-builder
67+
run: docker compose --file libcxx/utils/ci/docker/docker-compose.yml push libcxx-linux-builder-base libcxx-linux-builder libcxx-android-builder
68+
env:
69+
TAG: ${{ github.sha }}
6870

6971
# We create tarballs with the images and upload them as artifacts, since that's useful for testing
7072
# the images when making changes.

clang-tools-extra/clang-doc/JSONGenerator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ static Object serializeComment(const CommentInfo &I, Object &Description) {
140140
insertComment(Description, TextCommentsArray, "BriefComments");
141141
else if (I.Name == "return")
142142
insertComment(Description, TextCommentsArray, "ReturnComments");
143+
else if (I.Name == "throws" || I.Name == "throw") {
144+
json::Value ThrowsVal = Object();
145+
auto &ThrowsObj = *ThrowsVal.getAsObject();
146+
ThrowsObj["Exception"] = I.Args.front();
147+
ThrowsObj["Children"] = TextCommentsArray;
148+
insertComment(Description, ThrowsVal, "ThrowsComments");
149+
}
143150
return Obj;
144151
}
145152

clang-tools-extra/clang-doc/assets/comment-template.mustache

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@
5454
</div>
5555
{{/CodeComments}}
5656
{{/HasCodeComments}}
57+
{{#HasThrowsComments}}
58+
<h3>Throws</h3>
59+
{{#ThrowsComments}}
60+
<div>
61+
<b>{{Exception}}</b> {{#Children}}{{TextComment}}{{/Children}}
62+
</div>
63+
{{/ThrowsComments}}
64+
{{/HasThrowsComments}}
5765
{{#BlockCommandComment}}
5866
<div class="block-command-comment__command">
5967
<div class="block-command-command">

clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
#include "../google/UnnamedNamespaceInHeaderCheck.h"
3535
#include "../misc/NewDeleteOverloadsCheck.h"
3636
#include "../misc/NonCopyableObjectsCheck.h"
37+
#include "../misc/PredictableRandCheck.h"
3738
#include "../misc/StaticAssertCheck.h"
3839
#include "../misc/ThrowByValueCatchByReferenceCheck.h"
3940
#include "../modernize/AvoidSetjmpLongjmpCheck.h"
4041
#include "../modernize/AvoidVariadicFunctionsCheck.h"
4142
#include "../performance/MoveConstructorInitCheck.h"
4243
#include "../readability/EnumInitialValueCheck.h"
4344
#include "../readability/UppercaseLiteralSuffixCheck.h"
44-
#include "LimitedRandomnessCheck.h"
4545

4646
namespace {
4747

@@ -271,7 +271,7 @@ class CERTModule : public ClangTidyModule {
271271
.registerCheck<bugprone::DefaultOperatorNewOnOveralignedTypeCheck>(
272272
"cert-mem57-cpp");
273273
// MSC
274-
CheckFactories.registerCheck<LimitedRandomnessCheck>("cert-msc50-cpp");
274+
CheckFactories.registerCheck<misc::PredictableRandCheck>("cert-msc50-cpp");
275275
CheckFactories.registerCheck<bugprone::RandomGeneratorSeedCheck>(
276276
"cert-msc51-cpp");
277277
CheckFactories.registerCheck<bugprone::SignalHandlerCheck>(
@@ -324,7 +324,7 @@ class CERTModule : public ClangTidyModule {
324324
// MSC
325325
CheckFactories.registerCheck<bugprone::UnsafeFunctionsCheck>(
326326
"cert-msc24-c");
327-
CheckFactories.registerCheck<LimitedRandomnessCheck>("cert-msc30-c");
327+
CheckFactories.registerCheck<misc::PredictableRandCheck>("cert-msc30-c");
328328
CheckFactories.registerCheck<bugprone::RandomGeneratorSeedCheck>(
329329
"cert-msc32-c");
330330
CheckFactories.registerCheck<bugprone::UnsafeFunctionsCheck>(

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set(LLVM_LINK_COMPONENTS
55

66
add_clang_library(clangTidyCERTModule STATIC
77
CERTTidyModule.cpp
8-
LimitedRandomnessCheck.cpp
98

109
LINK_LIBS
1110
clangTidy

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ add_clang_library(clangTidyMiscModule STATIC
3333
NonCopyableObjectsCheck.cpp
3434
NonPrivateMemberVariablesInClassesCheck.cpp
3535
OverrideWithDifferentVisibilityCheck.cpp
36+
PredictableRandCheck.cpp
3637
RedundantExpressionCheck.cpp
3738
StaticAssertCheck.cpp
3839
ThrowByValueCatchByReferenceCheck.cpp

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "NonCopyableObjectsCheck.h"
2424
#include "NonPrivateMemberVariablesInClassesCheck.h"
2525
#include "OverrideWithDifferentVisibilityCheck.h"
26+
#include "PredictableRandCheck.h"
2627
#include "RedundantExpressionCheck.h"
2728
#include "StaticAssertCheck.h"
2829
#include "ThrowByValueCatchByReferenceCheck.h"
@@ -63,6 +64,9 @@ class MiscModule : public ClangTidyModule {
6364
"misc-non-copyable-objects");
6465
CheckFactories.registerCheck<NonPrivateMemberVariablesInClassesCheck>(
6566
"misc-non-private-member-variables-in-classes");
67+
CheckFactories.registerCheck<OverrideWithDifferentVisibilityCheck>(
68+
"misc-override-with-different-visibility");
69+
CheckFactories.registerCheck<PredictableRandCheck>("misc-predictable-rand");
6670
CheckFactories.registerCheck<RedundantExpressionCheck>(
6771
"misc-redundant-expression");
6872
CheckFactories.registerCheck<StaticAssertCheck>("misc-static-assert");
@@ -82,8 +86,6 @@ class MiscModule : public ClangTidyModule {
8286
"misc-use-anonymous-namespace");
8387
CheckFactories.registerCheck<UseInternalLinkageCheck>(
8488
"misc-use-internal-linkage");
85-
CheckFactories.registerCheck<OverrideWithDifferentVisibilityCheck>(
86-
"misc-override-with-different-visibility");
8789
}
8890
};
8991

clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.cpp renamed to clang-tools-extra/clang-tidy/misc/PredictableRandCheck.cpp

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

9-
#include "LimitedRandomnessCheck.h"
9+
#include "PredictableRandCheck.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::misc {
1616

17-
void LimitedRandomnessCheck::registerMatchers(MatchFinder *Finder) {
17+
void PredictableRandCheck::registerMatchers(MatchFinder *Finder) {
1818
Finder->addMatcher(callExpr(callee(functionDecl(namedDecl(hasName("::rand")),
1919
parameterCountIs(0))))
2020
.bind("randomGenerator"),
2121
this);
2222
}
2323

24-
void LimitedRandomnessCheck::check(const MatchFinder::MatchResult &Result) {
24+
void PredictableRandCheck::check(const MatchFinder::MatchResult &Result) {
2525
std::string Msg;
2626
if (getLangOpts().CPlusPlus)
2727
Msg = "; use C++11 random library instead";
@@ -30,4 +30,4 @@ void LimitedRandomnessCheck::check(const MatchFinder::MatchResult &Result) {
3030
diag(MatchedDecl->getBeginLoc(), "rand() has limited randomness" + Msg);
3131
}
3232

33-
} // namespace clang::tidy::cert
33+
} // namespace clang::tidy::misc

clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.h renamed to clang-tools-extra/clang-tidy/misc/PredictableRandCheck.h

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

9-
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITEDRANDOMNESSCHECK_H
10-
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITEDRANDOMNESSCHECK_H
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_PREDICTABLERANDCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_PREDICTABLERANDCHECK_H
1111

1212
#include "../ClangTidyCheck.h"
1313

14-
namespace clang::tidy::cert {
14+
namespace clang::tidy::misc {
1515

1616
/// Pseudorandom number generators are not genuinely random. The result of the
1717
/// std::rand() function makes no guarantees as to the quality of the random
1818
/// sequence produced.
1919
/// This check warns for the usage of std::rand() function.
2020
///
2121
/// For the user-facing documentation see:
22-
/// https://clang.llvm.org/extra/clang-tidy/checks/cert/msc50-cpp.html
23-
class LimitedRandomnessCheck : public ClangTidyCheck {
22+
/// https://clang.llvm.org/extra/clang-tidy/checks/misc/predictable-rand.html
23+
class PredictableRandCheck : public ClangTidyCheck {
2424
public:
25-
LimitedRandomnessCheck(StringRef Name, ClangTidyContext *Context)
25+
PredictableRandCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
2727
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2828
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2929
};
3030

31-
} // namespace clang::tidy::cert
31+
} // namespace clang::tidy::misc
3232

33-
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CERT_LIMITEDRANDOMNESSCHECK_H
33+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_PREDICTABLERANDCHECK_H

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,21 @@ New check aliases
283283
<clang-tidy/checks/bugprone/default-operator-new-on-overaligned-type>`
284284
keeping initial check as an alias to the new one.
285285

286+
- Renamed :doc:`cert-msc30-c <clang-tidy/checks/cert/msc30-c>` to
287+
:doc:`misc-predictable-rand
288+
<clang-tidy/checks/misc/predictable-rand>`
289+
keeping initial check as an alias to the new one.
290+
286291
- Renamed :doc:`cert-msc32-c <clang-tidy/checks/cert/msc32-c>` to
287292
:doc:`bugprone-random-generator-seed
288293
<clang-tidy/checks/bugprone/random-generator-seed>`
289294
keeping initial check as an alias to the new one.
290295

296+
- Renamed :doc:`cert-msc50-cpp <clang-tidy/checks/cert/msc50-cpp>` to
297+
:doc:`misc-predictable-rand
298+
<clang-tidy/checks/misc/predictable-rand>`
299+
keeping initial check as an alias to the new one.
300+
291301
- Renamed :doc:`cert-msc51-cpp <clang-tidy/checks/cert/msc51-cpp>` to
292302
:doc:`bugprone-random-generator-seed
293303
<clang-tidy/checks/bugprone/random-generator-seed>`
@@ -316,7 +326,7 @@ Changes in existing checks
316326
exceptions from captures are now diagnosed, exceptions in the bodies of
317327
lambdas that aren't actually invoked are not. Additionally, fixed an issue
318328
where the check wouldn't diagnose throws in arguments to functions or
319-
constructors. Added fine-grained configuration via options
329+
constructors. Added fine-grained configuration via options
320330
`CheckDestructors`, `CheckMoveMemberFunctions`, `CheckMain`,
321331
`CheckedSwapFunctions`, and `CheckNothrowFunctions`.
322332

0 commit comments

Comments
 (0)