-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Inclusive Language] migrate "sanity" checks to "soundness" checks #156995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang-codegen Author: Rick van Voorden (vanvoorden) ChangesBackgroundInspired by swiftlang/swift#71167. Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation. Changes
Patch is 337.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156995.diff 443 Files Affected:
diff --git a/bolt/lib/Passes/CMOVConversion.cpp b/bolt/lib/Passes/CMOVConversion.cpp
index cdd99b55207e0..10372416a9acd 100644
--- a/bolt/lib/Passes/CMOVConversion.cpp
+++ b/bolt/lib/Passes/CMOVConversion.cpp
@@ -66,7 +66,7 @@ bool isIfThenSubgraph(const BinaryBasicBlock &LHS,
if (LHS.pred_size() != 2 || RHS.pred_size() != 1)
return false;
- // Sanity check
+ // Soundness check
BinaryBasicBlock *Predecessor = *RHS.pred_begin();
assert(Predecessor && LHS.isPredecessor(Predecessor) && "invalid subgraph");
(void)Predecessor;
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8a01cb974c5da..dff1989c016b5 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -597,7 +597,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase(Target.JTIndices, JTIndex);
- // Keep fixCFG counts sane if more indices use this same target later
+ // Keep fixCFG counts sound if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
NewTargets.back().Branches =
Target.Branches / IndicesPerTarget[Target.To.Sym];
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..62190397b2be3 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -385,7 +385,7 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) {
return errorCodeToError(YamlInput.error());
}
- // Sanity check.
+ // Soundness check.
if (YamlBP.Header.Version != 1)
return make_error<StringError>(
Twine("cannot read profile : unsupported version"),
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index a6e4dbc9c192f..871453b0ec5db 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -637,7 +637,7 @@ Error RewriteInstance::discoverStorage() {
// If user specified a custom address where we should start writing new
// data, honor that.
NextAvailableAddress = opts::CustomAllocationVMA;
- // Sanity check the user-supplied address and emit warnings if something
+ // Soundness check the user-supplied address and emit warnings if something
// seems off.
for (const ELF64LE::Phdr &Phdr : PHs) {
switch (Phdr.p_type) {
@@ -2985,7 +2985,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
}
if (BinaryData *BD = BC->getBinaryDataContainingAddress(SymbolAddress)) {
- // Note: this assertion is trying to check sanity of BinaryData objects
+ // Note: this assertion is trying to check soundness of BinaryData objects
// but AArch64 and RISCV has inferred and incomplete object locations
// coming from GOT/TLS or any other non-trivial relocation (that requires
// creation of sections and whose symbol address is not really what should
diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp
index 1f54a500dbf98..97b49327ac484 100644
--- a/bolt/runtime/instr.cpp
+++ b/bolt/runtime/instr.cpp
@@ -819,7 +819,7 @@ ProfileWriterContext readDescriptions() {
#endif
#if !defined(__APPLE__)
-/// Debug by printing overall metadata global numbers to check it is sane
+/// Debug by printing overall metadata global numbers to check it is sound
void printStats(const ProfileWriterContext &Ctx) {
char StatMsg[BufSize];
char *StatPtr = StatMsg;
diff --git a/bolt/test/AArch64/hook-fini.s b/bolt/test/AArch64/hook-fini.s
index 4f321d463ef32..4051546724748 100644
--- a/bolt/test/AArch64/hook-fini.s
+++ b/bolt/test/AArch64/hook-fini.s
@@ -4,7 +4,7 @@
## dynamic).
## All tests perform the following steps:
## - Compile and link for the case to be tested
-## - Some sanity-checks on the dynamic section and relocations in the binary to
+## - Some soundness-checks on the dynamic section and relocations in the binary to
## verify it has the shape we want for testing:
## - DT_FINI or DT_FINI_ARRAY in dynamic section
## - No relative relocations for non-PIE
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index 8e991fade2c86..c0a69a75b0d1b 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -272,7 +272,7 @@ lr_clobbered_nocfg:
ret
.size lr_clobbered_nocfg, .-lr_clobbered_nocfg
-/// Now do a basic sanity check on every different Authentication instruction:
+/// Now do a basic soundness check on every different Authentication instruction:
.globl f_autiasp
.type f_autiasp,@function
diff --git a/bolt/test/runtime/AArch64/hook-fini.test b/bolt/test/runtime/AArch64/hook-fini.test
index 8d23b21b6d612..43cc832e429ed 100644
--- a/bolt/test/runtime/AArch64/hook-fini.test
+++ b/bolt/test/runtime/AArch64/hook-fini.test
@@ -4,7 +4,7 @@
# dynamic).
# All tests perform the following steps:
# - Compile and link for the case to be tested
-# - Some sanity-checks on the dynamic section and relocations in the binary to
+# - Some soundness-checks on the dynamic section and relocations in the binary to
# verify it has the shape we want for testing:
# - DT_FINI or DT_FINI_ARRAY in dynamic section
# - No relative relocations for non-PIE
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index cfcb9373548a1..9e55ad39427d4 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -428,7 +428,7 @@ int main(int argc, char **argv) {
if (YamlInput.error())
report_error(InputDataFilename, YamlInput.error());
- // Sanity check.
+ // Soundness check.
if (BP.Header.Version != 1) {
errs() << "Unable to merge data from profile using version "
<< BP.Header.Version << '\n';
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index d911b58cb8b7e..4b8b411bcc2ef 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -40,7 +40,7 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref");
- // Sanity check: The use might have overriden ::std::make_pair.
+ // Soundness check: The use might have overriden ::std::make_pair.
if (Call->getNumArgs() != 2)
return;
diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
index 3f5cd4b473903..ac66c5bc5d66a 100644
--- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -99,7 +99,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
bool SwitchHasDefault = false;
std::tie(SwitchCaseCount, SwitchHasDefault) = countCaseLabels(Switch);
- // Checks the sanity of 'switch' statements that actually do define
+ // Checks the soundness of 'switch' statements that actually do define
// a default branch but might be degenerated by having no or only one case.
if (SwitchHasDefault) {
handleSwitchWithDefault(Switch, SwitchCaseCount);
diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
index 712f390765957..f22118d5cb7e4 100644
--- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
@@ -92,7 +92,7 @@ template <typename T, unsigned SmallSize> class SmartSmallSetVector {
void populateSet() {
assert(Set.empty() && "Should not have already utilized the Set.");
// Magical growth factor prediction - to how many elements do we expect to
- // sanely grow after switching away from small-size storage?
+ // soundly grow after switching away from small-size storage?
const size_t NewMaxElts = 4 * Vector.size();
Vector.reserve(NewMaxElts);
Set.reserve(NewMaxElts);
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
index 2f59aaa86b157..b0e4efcbc5cba 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
@@ -133,7 +133,7 @@ struct CognitiveComplexity final {
"that in terms of stack usage. "
"Thus, it is good to minimize the size of the Detail struct.");
SmallVector<Detail, DefaultLimit> Details; // 25 elements is 200 bytes.
- // Yes, 25 is a magic number. This is the seemingly-sane default for the
+ // Yes, 25 is a magic number. This is the seemingly-sound default for the
// upper limit for function cognitive complexity. Thus it would make sense
// to avoid allocations for any function that does not violate the limit.
diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
index 6bb8c394f75cc..1aaad01dea13f 100644
--- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
@@ -61,7 +61,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
Parm->getType()->isSpecificBuiltinType(BuiltinType::Int))
continue;
- // Sanity check the source locations.
+ // Soundness check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
!SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
index 9c4241b54057a..a26b36db7ecad 100644
--- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp
+++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
@@ -123,7 +123,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
@@ -146,7 +146,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
RC = getCompletionComment(Ctx, &Decl);
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp
index 8b3865c8a8e5c..ba8766663c411 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -100,7 +100,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
std::vector<const char *> ArgStrs;
ArgStrs.reserve(Argv.size() + 1);
// In asserts builds, CompilerInvocation redundantly reads/parses cc1 args as
- // a sanity test. This is not useful to clangd, and costs 10% of test time.
+ // a soundness test. This is not useful to clangd, and costs 10% of test time.
// To avoid mismatches between assert/production builds, disable it always.
ArgStrs = {Argv.front().c_str(), "-Xclang", "-no-round-trip-args"};
for (const auto &S : Argv.drop_front())
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index e1c50f906de08..17141a52afc6c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -972,7 +972,7 @@ class ReferenceFinder : public index::IndexDataConsumer {
llvm::dyn_cast_or_null<ObjCMethodDecl>(ASTNode.OrigD)) {
OMD->getSelectorLocs(Locs);
}
- // Sanity check: we expect the *first* token to match the reported loc.
+ // Soundness check: we expect the *first* token to match the reported loc.
// Otherwise, maybe it was e.g. some other kind of reference to a Decl.
if (!Locs.empty() && Locs.front() != Loc)
Locs.clear(); // First token doesn't match, assume our guess was wrong.
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index ed56c2a9d2e81..d9d9cd0f40942 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -106,7 +106,7 @@ struct IncludeGraphCollector : public PPCallbacks {
NodeForIncluding.first->getValue().DirectIncludes.push_back(NodeForInclude);
}
- // Sanity check to ensure we have already populated a skipped file.
+ // Soundness check to ensure we have already populated a skipped file.
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override {
#ifndef NDEBUG
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index ada14c9939318..1c443c50866e2 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -854,7 +854,7 @@ TEST(BackgroundQueueTest, Progress) {
using testing::AnyOf;
BackgroundQueue::Stats S;
BackgroundQueue Q([&](BackgroundQueue::Stats New) {
- // Verify values are sane.
+ // Verify values are sound.
// Items are enqueued one at a time (at least in this test).
EXPECT_THAT(New.Enqueued, AnyOf(S.Enqueued, S.Enqueued + 1));
// Items are completed one at a time.
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 9ea7c3e02411d..63c92671a621a 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -919,7 +919,7 @@ int d;
StartSecond.wait();
Server.addDocument(FooCpp, SourceContentsWithoutErrors);
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics";
- ASSERT_EQ(DiagConsumer.Count, 2); // Sanity check - we actually ran both?
+ ASSERT_EQ(DiagConsumer.Count, 2); // Soundness check - we actually ran both?
}
TEST(ClangdServerTest, FormatCode) {
diff --git a/clang-tools-extra/clangd/unittests/QualityTests.cpp b/clang-tools-extra/clangd/unittests/QualityTests.cpp
index 4954659a45e02..1e6d34d58fcc1 100644
--- a/clang-tools-extra/clangd/unittests/QualityTests.cpp
+++ b/clang-tools-extra/clangd/unittests/QualityTests.cpp
@@ -10,7 +10,7 @@
// For interesting cases, both exact scores and "X beats Y" are too brittle to
// make good hard assertions.
//
-// Here we test the signal extraction and sanity-check that signals point in
+// Here we test the signal extraction and soundness-check that signals point in
// the right direction. This should be supplemented by quality metrics which
// we can compute from a corpus of queries and preferred rankings.
//
diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index 5d2a77b62a219..b23d62e37e068 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1444,7 +1444,7 @@ TEST(RenameTest, IndexMergeMainFile) {
EXPECT_THAT(Results.GlobalChanges[Main].asTextEdits(),
ElementsAre(newText("xPrime")));
- // Sanity check: we do expect to see index results!
+ // Soundness check: we do expect to see index results!
TU.Filename = "other.cc";
Results = Rename(TU.index().get());
EXPECT_THAT(Results.GlobalChanges.keys(),
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
index 4d1ca669b8d03..c846291329831 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
@@ -1,4 +1,4 @@
-// Sanity-check. Run without modules:
+// Soundness-check. Run without modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
diff --git a/clang/docs/AutomaticReferenceCounting.rst b/clang/docs/AutomaticReferenceCounting.rst
index 80bbd25121148..b10e3635e1d5b 100644
--- a/clang/docs/AutomaticReferenceCounting.rst
+++ b/clang/docs/AutomaticReferenceCounting.rst
@@ -1993,7 +1993,7 @@ A program is ill-formed if it refers to the ``NSAutoreleasePool`` class.
dependencies between two calls. It is also very easy to accidentally forget
to drain an autorelease pool when using the manual API, and this can
significantly inflate the process's high-water-mark. The introduction of a
- new scope is unfortunate but basically required for sane interaction with the
+ new scope is unfortunate but basically required for sound interaction with the
rest of the language. Not draining the pool during an unwind is apparently
required by the Objective-C exceptions implementation.
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index bd742273f4ed5..411d3ee3ecec0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -82,7 +82,7 @@ using it. From this file, :program:`tblgen` generates the unique ID of the
diagnostic, the severity of the diagnostic and the English translation + format
string.
-There is little sanity with the naming of the unique ID's right now. Some
+There is little soundness with the naming of the unique ID's right now. Some
start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name.
Since the enum is referenced in the C++ code that produces the diagnostic, it
is somewhat useful for it to be reasonably short.
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index acbe45e0be970..515f5838dbe49 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -1099,7 +1099,7 @@ The module maps will be written using the `module map language`_, which provides
Headers are often missing ``#include`` directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don't happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.
**Headers that vend multiple APIs at different times**
- Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend ``wchar_t`` only when the macro ``__need_wchar_t`` is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply ``exclude`` it in the module map.
+ Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend...
[truncated]
|
@llvm/pr-subscribers-backend-risc-v Author: Rick van Voorden (vanvoorden) ChangesBackgroundInspired by swiftlang/swift#71167. Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation. Changes
Patch is 337.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156995.diff 443 Files Affected:
diff --git a/bolt/lib/Passes/CMOVConversion.cpp b/bolt/lib/Passes/CMOVConversion.cpp
index cdd99b55207e0..10372416a9acd 100644
--- a/bolt/lib/Passes/CMOVConversion.cpp
+++ b/bolt/lib/Passes/CMOVConversion.cpp
@@ -66,7 +66,7 @@ bool isIfThenSubgraph(const BinaryBasicBlock &LHS,
if (LHS.pred_size() != 2 || RHS.pred_size() != 1)
return false;
- // Sanity check
+ // Soundness check
BinaryBasicBlock *Predecessor = *RHS.pred_begin();
assert(Predecessor && LHS.isPredecessor(Predecessor) && "invalid subgraph");
(void)Predecessor;
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8a01cb974c5da..dff1989c016b5 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -597,7 +597,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase(Target.JTIndices, JTIndex);
- // Keep fixCFG counts sane if more indices use this same target later
+ // Keep fixCFG counts sound if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
NewTargets.back().Branches =
Target.Branches / IndicesPerTarget[Target.To.Sym];
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..62190397b2be3 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -385,7 +385,7 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) {
return errorCodeToError(YamlInput.error());
}
- // Sanity check.
+ // Soundness check.
if (YamlBP.Header.Version != 1)
return make_error<StringError>(
Twine("cannot read profile : unsupported version"),
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index a6e4dbc9c192f..871453b0ec5db 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -637,7 +637,7 @@ Error RewriteInstance::discoverStorage() {
// If user specified a custom address where we should start writing new
// data, honor that.
NextAvailableAddress = opts::CustomAllocationVMA;
- // Sanity check the user-supplied address and emit warnings if something
+ // Soundness check the user-supplied address and emit warnings if something
// seems off.
for (const ELF64LE::Phdr &Phdr : PHs) {
switch (Phdr.p_type) {
@@ -2985,7 +2985,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
}
if (BinaryData *BD = BC->getBinaryDataContainingAddress(SymbolAddress)) {
- // Note: this assertion is trying to check sanity of BinaryData objects
+ // Note: this assertion is trying to check soundness of BinaryData objects
// but AArch64 and RISCV has inferred and incomplete object locations
// coming from GOT/TLS or any other non-trivial relocation (that requires
// creation of sections and whose symbol address is not really what should
diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp
index 1f54a500dbf98..97b49327ac484 100644
--- a/bolt/runtime/instr.cpp
+++ b/bolt/runtime/instr.cpp
@@ -819,7 +819,7 @@ ProfileWriterContext readDescriptions() {
#endif
#if !defined(__APPLE__)
-/// Debug by printing overall metadata global numbers to check it is sane
+/// Debug by printing overall metadata global numbers to check it is sound
void printStats(const ProfileWriterContext &Ctx) {
char StatMsg[BufSize];
char *StatPtr = StatMsg;
diff --git a/bolt/test/AArch64/hook-fini.s b/bolt/test/AArch64/hook-fini.s
index 4f321d463ef32..4051546724748 100644
--- a/bolt/test/AArch64/hook-fini.s
+++ b/bolt/test/AArch64/hook-fini.s
@@ -4,7 +4,7 @@
## dynamic).
## All tests perform the following steps:
## - Compile and link for the case to be tested
-## - Some sanity-checks on the dynamic section and relocations in the binary to
+## - Some soundness-checks on the dynamic section and relocations in the binary to
## verify it has the shape we want for testing:
## - DT_FINI or DT_FINI_ARRAY in dynamic section
## - No relative relocations for non-PIE
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index 8e991fade2c86..c0a69a75b0d1b 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -272,7 +272,7 @@ lr_clobbered_nocfg:
ret
.size lr_clobbered_nocfg, .-lr_clobbered_nocfg
-/// Now do a basic sanity check on every different Authentication instruction:
+/// Now do a basic soundness check on every different Authentication instruction:
.globl f_autiasp
.type f_autiasp,@function
diff --git a/bolt/test/runtime/AArch64/hook-fini.test b/bolt/test/runtime/AArch64/hook-fini.test
index 8d23b21b6d612..43cc832e429ed 100644
--- a/bolt/test/runtime/AArch64/hook-fini.test
+++ b/bolt/test/runtime/AArch64/hook-fini.test
@@ -4,7 +4,7 @@
# dynamic).
# All tests perform the following steps:
# - Compile and link for the case to be tested
-# - Some sanity-checks on the dynamic section and relocations in the binary to
+# - Some soundness-checks on the dynamic section and relocations in the binary to
# verify it has the shape we want for testing:
# - DT_FINI or DT_FINI_ARRAY in dynamic section
# - No relative relocations for non-PIE
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index cfcb9373548a1..9e55ad39427d4 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -428,7 +428,7 @@ int main(int argc, char **argv) {
if (YamlInput.error())
report_error(InputDataFilename, YamlInput.error());
- // Sanity check.
+ // Soundness check.
if (BP.Header.Version != 1) {
errs() << "Unable to merge data from profile using version "
<< BP.Header.Version << '\n';
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index d911b58cb8b7e..4b8b411bcc2ef 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -40,7 +40,7 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref");
- // Sanity check: The use might have overriden ::std::make_pair.
+ // Soundness check: The use might have overriden ::std::make_pair.
if (Call->getNumArgs() != 2)
return;
diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
index 3f5cd4b473903..ac66c5bc5d66a 100644
--- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -99,7 +99,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
bool SwitchHasDefault = false;
std::tie(SwitchCaseCount, SwitchHasDefault) = countCaseLabels(Switch);
- // Checks the sanity of 'switch' statements that actually do define
+ // Checks the soundness of 'switch' statements that actually do define
// a default branch but might be degenerated by having no or only one case.
if (SwitchHasDefault) {
handleSwitchWithDefault(Switch, SwitchCaseCount);
diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
index 712f390765957..f22118d5cb7e4 100644
--- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
@@ -92,7 +92,7 @@ template <typename T, unsigned SmallSize> class SmartSmallSetVector {
void populateSet() {
assert(Set.empty() && "Should not have already utilized the Set.");
// Magical growth factor prediction - to how many elements do we expect to
- // sanely grow after switching away from small-size storage?
+ // soundly grow after switching away from small-size storage?
const size_t NewMaxElts = 4 * Vector.size();
Vector.reserve(NewMaxElts);
Set.reserve(NewMaxElts);
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
index 2f59aaa86b157..b0e4efcbc5cba 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
@@ -133,7 +133,7 @@ struct CognitiveComplexity final {
"that in terms of stack usage. "
"Thus, it is good to minimize the size of the Detail struct.");
SmallVector<Detail, DefaultLimit> Details; // 25 elements is 200 bytes.
- // Yes, 25 is a magic number. This is the seemingly-sane default for the
+ // Yes, 25 is a magic number. This is the seemingly-sound default for the
// upper limit for function cognitive complexity. Thus it would make sense
// to avoid allocations for any function that does not violate the limit.
diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
index 6bb8c394f75cc..1aaad01dea13f 100644
--- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
@@ -61,7 +61,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
Parm->getType()->isSpecificBuiltinType(BuiltinType::Int))
continue;
- // Sanity check the source locations.
+ // Soundness check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
!SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
index 9c4241b54057a..a26b36db7ecad 100644
--- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp
+++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
@@ -123,7 +123,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
@@ -146,7 +146,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
RC = getCompletionComment(Ctx, &Decl);
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp
index 8b3865c8a8e5c..ba8766663c411 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -100,7 +100,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
std::vector<const char *> ArgStrs;
ArgStrs.reserve(Argv.size() + 1);
// In asserts builds, CompilerInvocation redundantly reads/parses cc1 args as
- // a sanity test. This is not useful to clangd, and costs 10% of test time.
+ // a soundness test. This is not useful to clangd, and costs 10% of test time.
// To avoid mismatches between assert/production builds, disable it always.
ArgStrs = {Argv.front().c_str(), "-Xclang", "-no-round-trip-args"};
for (const auto &S : Argv.drop_front())
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index e1c50f906de08..17141a52afc6c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -972,7 +972,7 @@ class ReferenceFinder : public index::IndexDataConsumer {
llvm::dyn_cast_or_null<ObjCMethodDecl>(ASTNode.OrigD)) {
OMD->getSelectorLocs(Locs);
}
- // Sanity check: we expect the *first* token to match the reported loc.
+ // Soundness check: we expect the *first* token to match the reported loc.
// Otherwise, maybe it was e.g. some other kind of reference to a Decl.
if (!Locs.empty() && Locs.front() != Loc)
Locs.clear(); // First token doesn't match, assume our guess was wrong.
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index ed56c2a9d2e81..d9d9cd0f40942 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -106,7 +106,7 @@ struct IncludeGraphCollector : public PPCallbacks {
NodeForIncluding.first->getValue().DirectIncludes.push_back(NodeForInclude);
}
- // Sanity check to ensure we have already populated a skipped file.
+ // Soundness check to ensure we have already populated a skipped file.
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override {
#ifndef NDEBUG
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index ada14c9939318..1c443c50866e2 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -854,7 +854,7 @@ TEST(BackgroundQueueTest, Progress) {
using testing::AnyOf;
BackgroundQueue::Stats S;
BackgroundQueue Q([&](BackgroundQueue::Stats New) {
- // Verify values are sane.
+ // Verify values are sound.
// Items are enqueued one at a time (at least in this test).
EXPECT_THAT(New.Enqueued, AnyOf(S.Enqueued, S.Enqueued + 1));
// Items are completed one at a time.
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 9ea7c3e02411d..63c92671a621a 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -919,7 +919,7 @@ int d;
StartSecond.wait();
Server.addDocument(FooCpp, SourceContentsWithoutErrors);
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics";
- ASSERT_EQ(DiagConsumer.Count, 2); // Sanity check - we actually ran both?
+ ASSERT_EQ(DiagConsumer.Count, 2); // Soundness check - we actually ran both?
}
TEST(ClangdServerTest, FormatCode) {
diff --git a/clang-tools-extra/clangd/unittests/QualityTests.cpp b/clang-tools-extra/clangd/unittests/QualityTests.cpp
index 4954659a45e02..1e6d34d58fcc1 100644
--- a/clang-tools-extra/clangd/unittests/QualityTests.cpp
+++ b/clang-tools-extra/clangd/unittests/QualityTests.cpp
@@ -10,7 +10,7 @@
// For interesting cases, both exact scores and "X beats Y" are too brittle to
// make good hard assertions.
//
-// Here we test the signal extraction and sanity-check that signals point in
+// Here we test the signal extraction and soundness-check that signals point in
// the right direction. This should be supplemented by quality metrics which
// we can compute from a corpus of queries and preferred rankings.
//
diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index 5d2a77b62a219..b23d62e37e068 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1444,7 +1444,7 @@ TEST(RenameTest, IndexMergeMainFile) {
EXPECT_THAT(Results.GlobalChanges[Main].asTextEdits(),
ElementsAre(newText("xPrime")));
- // Sanity check: we do expect to see index results!
+ // Soundness check: we do expect to see index results!
TU.Filename = "other.cc";
Results = Rename(TU.index().get());
EXPECT_THAT(Results.GlobalChanges.keys(),
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
index 4d1ca669b8d03..c846291329831 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
@@ -1,4 +1,4 @@
-// Sanity-check. Run without modules:
+// Soundness-check. Run without modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
diff --git a/clang/docs/AutomaticReferenceCounting.rst b/clang/docs/AutomaticReferenceCounting.rst
index 80bbd25121148..b10e3635e1d5b 100644
--- a/clang/docs/AutomaticReferenceCounting.rst
+++ b/clang/docs/AutomaticReferenceCounting.rst
@@ -1993,7 +1993,7 @@ A program is ill-formed if it refers to the ``NSAutoreleasePool`` class.
dependencies between two calls. It is also very easy to accidentally forget
to drain an autorelease pool when using the manual API, and this can
significantly inflate the process's high-water-mark. The introduction of a
- new scope is unfortunate but basically required for sane interaction with the
+ new scope is unfortunate but basically required for sound interaction with the
rest of the language. Not draining the pool during an unwind is apparently
required by the Objective-C exceptions implementation.
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index bd742273f4ed5..411d3ee3ecec0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -82,7 +82,7 @@ using it. From this file, :program:`tblgen` generates the unique ID of the
diagnostic, the severity of the diagnostic and the English translation + format
string.
-There is little sanity with the naming of the unique ID's right now. Some
+There is little soundness with the naming of the unique ID's right now. Some
start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name.
Since the enum is referenced in the C++ code that produces the diagnostic, it
is somewhat useful for it to be reasonably short.
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index acbe45e0be970..515f5838dbe49 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -1099,7 +1099,7 @@ The module maps will be written using the `module map language`_, which provides
Headers are often missing ``#include`` directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don't happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.
**Headers that vend multiple APIs at different times**
- Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend ``wchar_t`` only when the macro ``__need_wchar_t`` is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply ``exclude`` it in the module map.
+ Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend...
[truncated]
|
@llvm/pr-subscribers-backend-arm Author: Rick van Voorden (vanvoorden) ChangesBackgroundInspired by swiftlang/swift#71167. Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation. Changes
Patch is 337.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156995.diff 443 Files Affected:
diff --git a/bolt/lib/Passes/CMOVConversion.cpp b/bolt/lib/Passes/CMOVConversion.cpp
index cdd99b55207e0..10372416a9acd 100644
--- a/bolt/lib/Passes/CMOVConversion.cpp
+++ b/bolt/lib/Passes/CMOVConversion.cpp
@@ -66,7 +66,7 @@ bool isIfThenSubgraph(const BinaryBasicBlock &LHS,
if (LHS.pred_size() != 2 || RHS.pred_size() != 1)
return false;
- // Sanity check
+ // Soundness check
BinaryBasicBlock *Predecessor = *RHS.pred_begin();
assert(Predecessor && LHS.isPredecessor(Predecessor) && "invalid subgraph");
(void)Predecessor;
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8a01cb974c5da..dff1989c016b5 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -597,7 +597,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase(Target.JTIndices, JTIndex);
- // Keep fixCFG counts sane if more indices use this same target later
+ // Keep fixCFG counts sound if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
NewTargets.back().Branches =
Target.Branches / IndicesPerTarget[Target.To.Sym];
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..62190397b2be3 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -385,7 +385,7 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) {
return errorCodeToError(YamlInput.error());
}
- // Sanity check.
+ // Soundness check.
if (YamlBP.Header.Version != 1)
return make_error<StringError>(
Twine("cannot read profile : unsupported version"),
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index a6e4dbc9c192f..871453b0ec5db 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -637,7 +637,7 @@ Error RewriteInstance::discoverStorage() {
// If user specified a custom address where we should start writing new
// data, honor that.
NextAvailableAddress = opts::CustomAllocationVMA;
- // Sanity check the user-supplied address and emit warnings if something
+ // Soundness check the user-supplied address and emit warnings if something
// seems off.
for (const ELF64LE::Phdr &Phdr : PHs) {
switch (Phdr.p_type) {
@@ -2985,7 +2985,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
}
if (BinaryData *BD = BC->getBinaryDataContainingAddress(SymbolAddress)) {
- // Note: this assertion is trying to check sanity of BinaryData objects
+ // Note: this assertion is trying to check soundness of BinaryData objects
// but AArch64 and RISCV has inferred and incomplete object locations
// coming from GOT/TLS or any other non-trivial relocation (that requires
// creation of sections and whose symbol address is not really what should
diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp
index 1f54a500dbf98..97b49327ac484 100644
--- a/bolt/runtime/instr.cpp
+++ b/bolt/runtime/instr.cpp
@@ -819,7 +819,7 @@ ProfileWriterContext readDescriptions() {
#endif
#if !defined(__APPLE__)
-/// Debug by printing overall metadata global numbers to check it is sane
+/// Debug by printing overall metadata global numbers to check it is sound
void printStats(const ProfileWriterContext &Ctx) {
char StatMsg[BufSize];
char *StatPtr = StatMsg;
diff --git a/bolt/test/AArch64/hook-fini.s b/bolt/test/AArch64/hook-fini.s
index 4f321d463ef32..4051546724748 100644
--- a/bolt/test/AArch64/hook-fini.s
+++ b/bolt/test/AArch64/hook-fini.s
@@ -4,7 +4,7 @@
## dynamic).
## All tests perform the following steps:
## - Compile and link for the case to be tested
-## - Some sanity-checks on the dynamic section and relocations in the binary to
+## - Some soundness-checks on the dynamic section and relocations in the binary to
## verify it has the shape we want for testing:
## - DT_FINI or DT_FINI_ARRAY in dynamic section
## - No relative relocations for non-PIE
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index 8e991fade2c86..c0a69a75b0d1b 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -272,7 +272,7 @@ lr_clobbered_nocfg:
ret
.size lr_clobbered_nocfg, .-lr_clobbered_nocfg
-/// Now do a basic sanity check on every different Authentication instruction:
+/// Now do a basic soundness check on every different Authentication instruction:
.globl f_autiasp
.type f_autiasp,@function
diff --git a/bolt/test/runtime/AArch64/hook-fini.test b/bolt/test/runtime/AArch64/hook-fini.test
index 8d23b21b6d612..43cc832e429ed 100644
--- a/bolt/test/runtime/AArch64/hook-fini.test
+++ b/bolt/test/runtime/AArch64/hook-fini.test
@@ -4,7 +4,7 @@
# dynamic).
# All tests perform the following steps:
# - Compile and link for the case to be tested
-# - Some sanity-checks on the dynamic section and relocations in the binary to
+# - Some soundness-checks on the dynamic section and relocations in the binary to
# verify it has the shape we want for testing:
# - DT_FINI or DT_FINI_ARRAY in dynamic section
# - No relative relocations for non-PIE
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index cfcb9373548a1..9e55ad39427d4 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -428,7 +428,7 @@ int main(int argc, char **argv) {
if (YamlInput.error())
report_error(InputDataFilename, YamlInput.error());
- // Sanity check.
+ // Soundness check.
if (BP.Header.Version != 1) {
errs() << "Unable to merge data from profile using version "
<< BP.Header.Version << '\n';
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index d911b58cb8b7e..4b8b411bcc2ef 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -40,7 +40,7 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref");
- // Sanity check: The use might have overriden ::std::make_pair.
+ // Soundness check: The use might have overriden ::std::make_pair.
if (Call->getNumArgs() != 2)
return;
diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
index 3f5cd4b473903..ac66c5bc5d66a 100644
--- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -99,7 +99,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
bool SwitchHasDefault = false;
std::tie(SwitchCaseCount, SwitchHasDefault) = countCaseLabels(Switch);
- // Checks the sanity of 'switch' statements that actually do define
+ // Checks the soundness of 'switch' statements that actually do define
// a default branch but might be degenerated by having no or only one case.
if (SwitchHasDefault) {
handleSwitchWithDefault(Switch, SwitchCaseCount);
diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
index 712f390765957..f22118d5cb7e4 100644
--- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
@@ -92,7 +92,7 @@ template <typename T, unsigned SmallSize> class SmartSmallSetVector {
void populateSet() {
assert(Set.empty() && "Should not have already utilized the Set.");
// Magical growth factor prediction - to how many elements do we expect to
- // sanely grow after switching away from small-size storage?
+ // soundly grow after switching away from small-size storage?
const size_t NewMaxElts = 4 * Vector.size();
Vector.reserve(NewMaxElts);
Set.reserve(NewMaxElts);
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
index 2f59aaa86b157..b0e4efcbc5cba 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
@@ -133,7 +133,7 @@ struct CognitiveComplexity final {
"that in terms of stack usage. "
"Thus, it is good to minimize the size of the Detail struct.");
SmallVector<Detail, DefaultLimit> Details; // 25 elements is 200 bytes.
- // Yes, 25 is a magic number. This is the seemingly-sane default for the
+ // Yes, 25 is a magic number. This is the seemingly-sound default for the
// upper limit for function cognitive complexity. Thus it would make sense
// to avoid allocations for any function that does not violate the limit.
diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
index 6bb8c394f75cc..1aaad01dea13f 100644
--- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
@@ -61,7 +61,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
Parm->getType()->isSpecificBuiltinType(BuiltinType::Int))
continue;
- // Sanity check the source locations.
+ // Soundness check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
!SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
index 9c4241b54057a..a26b36db7ecad 100644
--- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp
+++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
@@ -123,7 +123,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
@@ -146,7 +146,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
RC = getCompletionComment(Ctx, &Decl);
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp
index 8b3865c8a8e5c..ba8766663c411 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -100,7 +100,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
std::vector<const char *> ArgStrs;
ArgStrs.reserve(Argv.size() + 1);
// In asserts builds, CompilerInvocation redundantly reads/parses cc1 args as
- // a sanity test. This is not useful to clangd, and costs 10% of test time.
+ // a soundness test. This is not useful to clangd, and costs 10% of test time.
// To avoid mismatches between assert/production builds, disable it always.
ArgStrs = {Argv.front().c_str(), "-Xclang", "-no-round-trip-args"};
for (const auto &S : Argv.drop_front())
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index e1c50f906de08..17141a52afc6c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -972,7 +972,7 @@ class ReferenceFinder : public index::IndexDataConsumer {
llvm::dyn_cast_or_null<ObjCMethodDecl>(ASTNode.OrigD)) {
OMD->getSelectorLocs(Locs);
}
- // Sanity check: we expect the *first* token to match the reported loc.
+ // Soundness check: we expect the *first* token to match the reported loc.
// Otherwise, maybe it was e.g. some other kind of reference to a Decl.
if (!Locs.empty() && Locs.front() != Loc)
Locs.clear(); // First token doesn't match, assume our guess was wrong.
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index ed56c2a9d2e81..d9d9cd0f40942 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -106,7 +106,7 @@ struct IncludeGraphCollector : public PPCallbacks {
NodeForIncluding.first->getValue().DirectIncludes.push_back(NodeForInclude);
}
- // Sanity check to ensure we have already populated a skipped file.
+ // Soundness check to ensure we have already populated a skipped file.
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override {
#ifndef NDEBUG
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index ada14c9939318..1c443c50866e2 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -854,7 +854,7 @@ TEST(BackgroundQueueTest, Progress) {
using testing::AnyOf;
BackgroundQueue::Stats S;
BackgroundQueue Q([&](BackgroundQueue::Stats New) {
- // Verify values are sane.
+ // Verify values are sound.
// Items are enqueued one at a time (at least in this test).
EXPECT_THAT(New.Enqueued, AnyOf(S.Enqueued, S.Enqueued + 1));
// Items are completed one at a time.
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 9ea7c3e02411d..63c92671a621a 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -919,7 +919,7 @@ int d;
StartSecond.wait();
Server.addDocument(FooCpp, SourceContentsWithoutErrors);
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics";
- ASSERT_EQ(DiagConsumer.Count, 2); // Sanity check - we actually ran both?
+ ASSERT_EQ(DiagConsumer.Count, 2); // Soundness check - we actually ran both?
}
TEST(ClangdServerTest, FormatCode) {
diff --git a/clang-tools-extra/clangd/unittests/QualityTests.cpp b/clang-tools-extra/clangd/unittests/QualityTests.cpp
index 4954659a45e02..1e6d34d58fcc1 100644
--- a/clang-tools-extra/clangd/unittests/QualityTests.cpp
+++ b/clang-tools-extra/clangd/unittests/QualityTests.cpp
@@ -10,7 +10,7 @@
// For interesting cases, both exact scores and "X beats Y" are too brittle to
// make good hard assertions.
//
-// Here we test the signal extraction and sanity-check that signals point in
+// Here we test the signal extraction and soundness-check that signals point in
// the right direction. This should be supplemented by quality metrics which
// we can compute from a corpus of queries and preferred rankings.
//
diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index 5d2a77b62a219..b23d62e37e068 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1444,7 +1444,7 @@ TEST(RenameTest, IndexMergeMainFile) {
EXPECT_THAT(Results.GlobalChanges[Main].asTextEdits(),
ElementsAre(newText("xPrime")));
- // Sanity check: we do expect to see index results!
+ // Soundness check: we do expect to see index results!
TU.Filename = "other.cc";
Results = Rename(TU.index().get());
EXPECT_THAT(Results.GlobalChanges.keys(),
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
index 4d1ca669b8d03..c846291329831 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
@@ -1,4 +1,4 @@
-// Sanity-check. Run without modules:
+// Soundness-check. Run without modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
diff --git a/clang/docs/AutomaticReferenceCounting.rst b/clang/docs/AutomaticReferenceCounting.rst
index 80bbd25121148..b10e3635e1d5b 100644
--- a/clang/docs/AutomaticReferenceCounting.rst
+++ b/clang/docs/AutomaticReferenceCounting.rst
@@ -1993,7 +1993,7 @@ A program is ill-formed if it refers to the ``NSAutoreleasePool`` class.
dependencies between two calls. It is also very easy to accidentally forget
to drain an autorelease pool when using the manual API, and this can
significantly inflate the process's high-water-mark. The introduction of a
- new scope is unfortunate but basically required for sane interaction with the
+ new scope is unfortunate but basically required for sound interaction with the
rest of the language. Not draining the pool during an unwind is apparently
required by the Objective-C exceptions implementation.
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index bd742273f4ed5..411d3ee3ecec0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -82,7 +82,7 @@ using it. From this file, :program:`tblgen` generates the unique ID of the
diagnostic, the severity of the diagnostic and the English translation + format
string.
-There is little sanity with the naming of the unique ID's right now. Some
+There is little soundness with the naming of the unique ID's right now. Some
start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name.
Since the enum is referenced in the C++ code that produces the diagnostic, it
is somewhat useful for it to be reasonably short.
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index acbe45e0be970..515f5838dbe49 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -1099,7 +1099,7 @@ The module maps will be written using the `module map language`_, which provides
Headers are often missing ``#include`` directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don't happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.
**Headers that vend multiple APIs at different times**
- Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend ``wchar_t`` only when the macro ``__need_wchar_t`` is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply ``exclude`` it in the module map.
+ Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend...
[truncated]
|
@llvm/pr-subscribers-clang Author: Rick van Voorden (vanvoorden) ChangesBackgroundInspired by swiftlang/swift#71167. Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation. Changes
Patch is 337.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156995.diff 443 Files Affected:
diff --git a/bolt/lib/Passes/CMOVConversion.cpp b/bolt/lib/Passes/CMOVConversion.cpp
index cdd99b55207e0..10372416a9acd 100644
--- a/bolt/lib/Passes/CMOVConversion.cpp
+++ b/bolt/lib/Passes/CMOVConversion.cpp
@@ -66,7 +66,7 @@ bool isIfThenSubgraph(const BinaryBasicBlock &LHS,
if (LHS.pred_size() != 2 || RHS.pred_size() != 1)
return false;
- // Sanity check
+ // Soundness check
BinaryBasicBlock *Predecessor = *RHS.pred_begin();
assert(Predecessor && LHS.isPredecessor(Predecessor) && "invalid subgraph");
(void)Predecessor;
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8a01cb974c5da..dff1989c016b5 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -597,7 +597,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase(Target.JTIndices, JTIndex);
- // Keep fixCFG counts sane if more indices use this same target later
+ // Keep fixCFG counts sound if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
NewTargets.back().Branches =
Target.Branches / IndicesPerTarget[Target.To.Sym];
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..62190397b2be3 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -385,7 +385,7 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) {
return errorCodeToError(YamlInput.error());
}
- // Sanity check.
+ // Soundness check.
if (YamlBP.Header.Version != 1)
return make_error<StringError>(
Twine("cannot read profile : unsupported version"),
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index a6e4dbc9c192f..871453b0ec5db 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -637,7 +637,7 @@ Error RewriteInstance::discoverStorage() {
// If user specified a custom address where we should start writing new
// data, honor that.
NextAvailableAddress = opts::CustomAllocationVMA;
- // Sanity check the user-supplied address and emit warnings if something
+ // Soundness check the user-supplied address and emit warnings if something
// seems off.
for (const ELF64LE::Phdr &Phdr : PHs) {
switch (Phdr.p_type) {
@@ -2985,7 +2985,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
}
if (BinaryData *BD = BC->getBinaryDataContainingAddress(SymbolAddress)) {
- // Note: this assertion is trying to check sanity of BinaryData objects
+ // Note: this assertion is trying to check soundness of BinaryData objects
// but AArch64 and RISCV has inferred and incomplete object locations
// coming from GOT/TLS or any other non-trivial relocation (that requires
// creation of sections and whose symbol address is not really what should
diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp
index 1f54a500dbf98..97b49327ac484 100644
--- a/bolt/runtime/instr.cpp
+++ b/bolt/runtime/instr.cpp
@@ -819,7 +819,7 @@ ProfileWriterContext readDescriptions() {
#endif
#if !defined(__APPLE__)
-/// Debug by printing overall metadata global numbers to check it is sane
+/// Debug by printing overall metadata global numbers to check it is sound
void printStats(const ProfileWriterContext &Ctx) {
char StatMsg[BufSize];
char *StatPtr = StatMsg;
diff --git a/bolt/test/AArch64/hook-fini.s b/bolt/test/AArch64/hook-fini.s
index 4f321d463ef32..4051546724748 100644
--- a/bolt/test/AArch64/hook-fini.s
+++ b/bolt/test/AArch64/hook-fini.s
@@ -4,7 +4,7 @@
## dynamic).
## All tests perform the following steps:
## - Compile and link for the case to be tested
-## - Some sanity-checks on the dynamic section and relocations in the binary to
+## - Some soundness-checks on the dynamic section and relocations in the binary to
## verify it has the shape we want for testing:
## - DT_FINI or DT_FINI_ARRAY in dynamic section
## - No relative relocations for non-PIE
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index 8e991fade2c86..c0a69a75b0d1b 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -272,7 +272,7 @@ lr_clobbered_nocfg:
ret
.size lr_clobbered_nocfg, .-lr_clobbered_nocfg
-/// Now do a basic sanity check on every different Authentication instruction:
+/// Now do a basic soundness check on every different Authentication instruction:
.globl f_autiasp
.type f_autiasp,@function
diff --git a/bolt/test/runtime/AArch64/hook-fini.test b/bolt/test/runtime/AArch64/hook-fini.test
index 8d23b21b6d612..43cc832e429ed 100644
--- a/bolt/test/runtime/AArch64/hook-fini.test
+++ b/bolt/test/runtime/AArch64/hook-fini.test
@@ -4,7 +4,7 @@
# dynamic).
# All tests perform the following steps:
# - Compile and link for the case to be tested
-# - Some sanity-checks on the dynamic section and relocations in the binary to
+# - Some soundness-checks on the dynamic section and relocations in the binary to
# verify it has the shape we want for testing:
# - DT_FINI or DT_FINI_ARRAY in dynamic section
# - No relative relocations for non-PIE
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index cfcb9373548a1..9e55ad39427d4 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -428,7 +428,7 @@ int main(int argc, char **argv) {
if (YamlInput.error())
report_error(InputDataFilename, YamlInput.error());
- // Sanity check.
+ // Soundness check.
if (BP.Header.Version != 1) {
errs() << "Unable to merge data from profile using version "
<< BP.Header.Version << '\n';
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index d911b58cb8b7e..4b8b411bcc2ef 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -40,7 +40,7 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref");
- // Sanity check: The use might have overriden ::std::make_pair.
+ // Soundness check: The use might have overriden ::std::make_pair.
if (Call->getNumArgs() != 2)
return;
diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
index 3f5cd4b473903..ac66c5bc5d66a 100644
--- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -99,7 +99,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
bool SwitchHasDefault = false;
std::tie(SwitchCaseCount, SwitchHasDefault) = countCaseLabels(Switch);
- // Checks the sanity of 'switch' statements that actually do define
+ // Checks the soundness of 'switch' statements that actually do define
// a default branch but might be degenerated by having no or only one case.
if (SwitchHasDefault) {
handleSwitchWithDefault(Switch, SwitchCaseCount);
diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
index 712f390765957..f22118d5cb7e4 100644
--- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
@@ -92,7 +92,7 @@ template <typename T, unsigned SmallSize> class SmartSmallSetVector {
void populateSet() {
assert(Set.empty() && "Should not have already utilized the Set.");
// Magical growth factor prediction - to how many elements do we expect to
- // sanely grow after switching away from small-size storage?
+ // soundly grow after switching away from small-size storage?
const size_t NewMaxElts = 4 * Vector.size();
Vector.reserve(NewMaxElts);
Set.reserve(NewMaxElts);
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
index 2f59aaa86b157..b0e4efcbc5cba 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
@@ -133,7 +133,7 @@ struct CognitiveComplexity final {
"that in terms of stack usage. "
"Thus, it is good to minimize the size of the Detail struct.");
SmallVector<Detail, DefaultLimit> Details; // 25 elements is 200 bytes.
- // Yes, 25 is a magic number. This is the seemingly-sane default for the
+ // Yes, 25 is a magic number. This is the seemingly-sound default for the
// upper limit for function cognitive complexity. Thus it would make sense
// to avoid allocations for any function that does not violate the limit.
diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
index 6bb8c394f75cc..1aaad01dea13f 100644
--- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
@@ -61,7 +61,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
Parm->getType()->isSpecificBuiltinType(BuiltinType::Int))
continue;
- // Sanity check the source locations.
+ // Soundness check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
!SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
index 9c4241b54057a..a26b36db7ecad 100644
--- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp
+++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
@@ -123,7 +123,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
@@ -146,7 +146,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
RC = getCompletionComment(Ctx, &Decl);
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp
index 8b3865c8a8e5c..ba8766663c411 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -100,7 +100,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
std::vector<const char *> ArgStrs;
ArgStrs.reserve(Argv.size() + 1);
// In asserts builds, CompilerInvocation redundantly reads/parses cc1 args as
- // a sanity test. This is not useful to clangd, and costs 10% of test time.
+ // a soundness test. This is not useful to clangd, and costs 10% of test time.
// To avoid mismatches between assert/production builds, disable it always.
ArgStrs = {Argv.front().c_str(), "-Xclang", "-no-round-trip-args"};
for (const auto &S : Argv.drop_front())
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index e1c50f906de08..17141a52afc6c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -972,7 +972,7 @@ class ReferenceFinder : public index::IndexDataConsumer {
llvm::dyn_cast_or_null<ObjCMethodDecl>(ASTNode.OrigD)) {
OMD->getSelectorLocs(Locs);
}
- // Sanity check: we expect the *first* token to match the reported loc.
+ // Soundness check: we expect the *first* token to match the reported loc.
// Otherwise, maybe it was e.g. some other kind of reference to a Decl.
if (!Locs.empty() && Locs.front() != Loc)
Locs.clear(); // First token doesn't match, assume our guess was wrong.
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index ed56c2a9d2e81..d9d9cd0f40942 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -106,7 +106,7 @@ struct IncludeGraphCollector : public PPCallbacks {
NodeForIncluding.first->getValue().DirectIncludes.push_back(NodeForInclude);
}
- // Sanity check to ensure we have already populated a skipped file.
+ // Soundness check to ensure we have already populated a skipped file.
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override {
#ifndef NDEBUG
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index ada14c9939318..1c443c50866e2 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -854,7 +854,7 @@ TEST(BackgroundQueueTest, Progress) {
using testing::AnyOf;
BackgroundQueue::Stats S;
BackgroundQueue Q([&](BackgroundQueue::Stats New) {
- // Verify values are sane.
+ // Verify values are sound.
// Items are enqueued one at a time (at least in this test).
EXPECT_THAT(New.Enqueued, AnyOf(S.Enqueued, S.Enqueued + 1));
// Items are completed one at a time.
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 9ea7c3e02411d..63c92671a621a 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -919,7 +919,7 @@ int d;
StartSecond.wait();
Server.addDocument(FooCpp, SourceContentsWithoutErrors);
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics";
- ASSERT_EQ(DiagConsumer.Count, 2); // Sanity check - we actually ran both?
+ ASSERT_EQ(DiagConsumer.Count, 2); // Soundness check - we actually ran both?
}
TEST(ClangdServerTest, FormatCode) {
diff --git a/clang-tools-extra/clangd/unittests/QualityTests.cpp b/clang-tools-extra/clangd/unittests/QualityTests.cpp
index 4954659a45e02..1e6d34d58fcc1 100644
--- a/clang-tools-extra/clangd/unittests/QualityTests.cpp
+++ b/clang-tools-extra/clangd/unittests/QualityTests.cpp
@@ -10,7 +10,7 @@
// For interesting cases, both exact scores and "X beats Y" are too brittle to
// make good hard assertions.
//
-// Here we test the signal extraction and sanity-check that signals point in
+// Here we test the signal extraction and soundness-check that signals point in
// the right direction. This should be supplemented by quality metrics which
// we can compute from a corpus of queries and preferred rankings.
//
diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index 5d2a77b62a219..b23d62e37e068 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1444,7 +1444,7 @@ TEST(RenameTest, IndexMergeMainFile) {
EXPECT_THAT(Results.GlobalChanges[Main].asTextEdits(),
ElementsAre(newText("xPrime")));
- // Sanity check: we do expect to see index results!
+ // Soundness check: we do expect to see index results!
TU.Filename = "other.cc";
Results = Rename(TU.index().get());
EXPECT_THAT(Results.GlobalChanges.keys(),
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
index 4d1ca669b8d03..c846291329831 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
@@ -1,4 +1,4 @@
-// Sanity-check. Run without modules:
+// Soundness-check. Run without modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
diff --git a/clang/docs/AutomaticReferenceCounting.rst b/clang/docs/AutomaticReferenceCounting.rst
index 80bbd25121148..b10e3635e1d5b 100644
--- a/clang/docs/AutomaticReferenceCounting.rst
+++ b/clang/docs/AutomaticReferenceCounting.rst
@@ -1993,7 +1993,7 @@ A program is ill-formed if it refers to the ``NSAutoreleasePool`` class.
dependencies between two calls. It is also very easy to accidentally forget
to drain an autorelease pool when using the manual API, and this can
significantly inflate the process's high-water-mark. The introduction of a
- new scope is unfortunate but basically required for sane interaction with the
+ new scope is unfortunate but basically required for sound interaction with the
rest of the language. Not draining the pool during an unwind is apparently
required by the Objective-C exceptions implementation.
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index bd742273f4ed5..411d3ee3ecec0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -82,7 +82,7 @@ using it. From this file, :program:`tblgen` generates the unique ID of the
diagnostic, the severity of the diagnostic and the English translation + format
string.
-There is little sanity with the naming of the unique ID's right now. Some
+There is little soundness with the naming of the unique ID's right now. Some
start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name.
Since the enum is referenced in the C++ code that produces the diagnostic, it
is somewhat useful for it to be reasonably short.
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index acbe45e0be970..515f5838dbe49 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -1099,7 +1099,7 @@ The module maps will be written using the `module map language`_, which provides
Headers are often missing ``#include`` directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don't happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.
**Headers that vend multiple APIs at different times**
- Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend ``wchar_t`` only when the macro ``__need_wchar_t`` is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply ``exclude`` it in the module map.
+ Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend...
[truncated]
|
@llvm/pr-subscribers-libcxx Author: Rick van Voorden (vanvoorden) ChangesBackgroundInspired by swiftlang/swift#71167. Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation. Changes
Patch is 337.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156995.diff 443 Files Affected:
diff --git a/bolt/lib/Passes/CMOVConversion.cpp b/bolt/lib/Passes/CMOVConversion.cpp
index cdd99b55207e0..10372416a9acd 100644
--- a/bolt/lib/Passes/CMOVConversion.cpp
+++ b/bolt/lib/Passes/CMOVConversion.cpp
@@ -66,7 +66,7 @@ bool isIfThenSubgraph(const BinaryBasicBlock &LHS,
if (LHS.pred_size() != 2 || RHS.pred_size() != 1)
return false;
- // Sanity check
+ // Soundness check
BinaryBasicBlock *Predecessor = *RHS.pred_begin();
assert(Predecessor && LHS.isPredecessor(Predecessor) && "invalid subgraph");
(void)Predecessor;
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 8a01cb974c5da..dff1989c016b5 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -597,7 +597,7 @@ IndirectCallPromotion::findCallTargetSymbols(std::vector<Callsite> &Targets,
std::vector<uint64_t>({JTIndex}).swap(NewTargets.back().JTIndices);
llvm::erase(Target.JTIndices, JTIndex);
- // Keep fixCFG counts sane if more indices use this same target later
+ // Keep fixCFG counts sound if more indices use this same target later
assert(IndicesPerTarget[Target.To.Sym] > 0 && "wrong map");
NewTargets.back().Branches =
Target.Branches / IndicesPerTarget[Target.To.Sym];
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index 086e47b661e10..62190397b2be3 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -385,7 +385,7 @@ Error YAMLProfileReader::preprocessProfile(BinaryContext &BC) {
return errorCodeToError(YamlInput.error());
}
- // Sanity check.
+ // Soundness check.
if (YamlBP.Header.Version != 1)
return make_error<StringError>(
Twine("cannot read profile : unsupported version"),
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index a6e4dbc9c192f..871453b0ec5db 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -637,7 +637,7 @@ Error RewriteInstance::discoverStorage() {
// If user specified a custom address where we should start writing new
// data, honor that.
NextAvailableAddress = opts::CustomAllocationVMA;
- // Sanity check the user-supplied address and emit warnings if something
+ // Soundness check the user-supplied address and emit warnings if something
// seems off.
for (const ELF64LE::Phdr &Phdr : PHs) {
switch (Phdr.p_type) {
@@ -2985,7 +2985,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
}
if (BinaryData *BD = BC->getBinaryDataContainingAddress(SymbolAddress)) {
- // Note: this assertion is trying to check sanity of BinaryData objects
+ // Note: this assertion is trying to check soundness of BinaryData objects
// but AArch64 and RISCV has inferred and incomplete object locations
// coming from GOT/TLS or any other non-trivial relocation (that requires
// creation of sections and whose symbol address is not really what should
diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp
index 1f54a500dbf98..97b49327ac484 100644
--- a/bolt/runtime/instr.cpp
+++ b/bolt/runtime/instr.cpp
@@ -819,7 +819,7 @@ ProfileWriterContext readDescriptions() {
#endif
#if !defined(__APPLE__)
-/// Debug by printing overall metadata global numbers to check it is sane
+/// Debug by printing overall metadata global numbers to check it is sound
void printStats(const ProfileWriterContext &Ctx) {
char StatMsg[BufSize];
char *StatPtr = StatMsg;
diff --git a/bolt/test/AArch64/hook-fini.s b/bolt/test/AArch64/hook-fini.s
index 4f321d463ef32..4051546724748 100644
--- a/bolt/test/AArch64/hook-fini.s
+++ b/bolt/test/AArch64/hook-fini.s
@@ -4,7 +4,7 @@
## dynamic).
## All tests perform the following steps:
## - Compile and link for the case to be tested
-## - Some sanity-checks on the dynamic section and relocations in the binary to
+## - Some soundness-checks on the dynamic section and relocations in the binary to
## verify it has the shape we want for testing:
## - DT_FINI or DT_FINI_ARRAY in dynamic section
## - No relative relocations for non-PIE
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index 8e991fade2c86..c0a69a75b0d1b 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -272,7 +272,7 @@ lr_clobbered_nocfg:
ret
.size lr_clobbered_nocfg, .-lr_clobbered_nocfg
-/// Now do a basic sanity check on every different Authentication instruction:
+/// Now do a basic soundness check on every different Authentication instruction:
.globl f_autiasp
.type f_autiasp,@function
diff --git a/bolt/test/runtime/AArch64/hook-fini.test b/bolt/test/runtime/AArch64/hook-fini.test
index 8d23b21b6d612..43cc832e429ed 100644
--- a/bolt/test/runtime/AArch64/hook-fini.test
+++ b/bolt/test/runtime/AArch64/hook-fini.test
@@ -4,7 +4,7 @@
# dynamic).
# All tests perform the following steps:
# - Compile and link for the case to be tested
-# - Some sanity-checks on the dynamic section and relocations in the binary to
+# - Some soundness-checks on the dynamic section and relocations in the binary to
# verify it has the shape we want for testing:
# - DT_FINI or DT_FINI_ARRAY in dynamic section
# - No relative relocations for non-PIE
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index cfcb9373548a1..9e55ad39427d4 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -428,7 +428,7 @@ int main(int argc, char **argv) {
if (YamlInput.error())
report_error(InputDataFilename, YamlInput.error());
- // Sanity check.
+ // Soundness check.
if (BP.Header.Version != 1) {
errs() << "Unable to merge data from profile using version "
<< BP.Header.Version << '\n';
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
index d911b58cb8b7e..4b8b411bcc2ef 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -40,7 +40,7 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call");
const auto *DeclRef = Result.Nodes.getNodeAs<DeclRefExpr>("declref");
- // Sanity check: The use might have overriden ::std::make_pair.
+ // Soundness check: The use might have overriden ::std::make_pair.
if (Call->getNumArgs() != 2)
return;
diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
index 3f5cd4b473903..ac66c5bc5d66a 100644
--- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -99,7 +99,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
bool SwitchHasDefault = false;
std::tie(SwitchCaseCount, SwitchHasDefault) = countCaseLabels(Switch);
- // Checks the sanity of 'switch' statements that actually do define
+ // Checks the soundness of 'switch' statements that actually do define
// a default branch but might be degenerated by having no or only one case.
if (SwitchHasDefault) {
handleSwitchWithDefault(Switch, SwitchCaseCount);
diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
index 712f390765957..f22118d5cb7e4 100644
--- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp
@@ -92,7 +92,7 @@ template <typename T, unsigned SmallSize> class SmartSmallSetVector {
void populateSet() {
assert(Set.empty() && "Should not have already utilized the Set.");
// Magical growth factor prediction - to how many elements do we expect to
- // sanely grow after switching away from small-size storage?
+ // soundly grow after switching away from small-size storage?
const size_t NewMaxElts = 4 * Vector.size();
Vector.reserve(NewMaxElts);
Set.reserve(NewMaxElts);
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
index 2f59aaa86b157..b0e4efcbc5cba 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
@@ -133,7 +133,7 @@ struct CognitiveComplexity final {
"that in terms of stack usage. "
"Thus, it is good to minimize the size of the Detail struct.");
SmallVector<Detail, DefaultLimit> Details; // 25 elements is 200 bytes.
- // Yes, 25 is a magic number. This is the seemingly-sane default for the
+ // Yes, 25 is a magic number. This is the seemingly-sound default for the
// upper limit for function cognitive complexity. Thus it would make sense
// to avoid allocations for any function that does not violate the limit.
diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
index 6bb8c394f75cc..1aaad01dea13f 100644
--- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
@@ -61,7 +61,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
Parm->getType()->isSpecificBuiltinType(BuiltinType::Int))
continue;
- // Sanity check the source locations.
+ // Soundness check the source locations.
if (!Parm->getLocation().isValid() || Parm->getLocation().isMacroID() ||
!SM.isWrittenInSameFile(Parm->getBeginLoc(), Parm->getLocation()))
continue;
diff --git a/clang-tools-extra/clangd/CodeCompletionStrings.cpp b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
index 9c4241b54057a..a26b36db7ecad 100644
--- a/clang-tools-extra/clangd/CodeCompletionStrings.cpp
+++ b/clang-tools-extra/clangd/CodeCompletionStrings.cpp
@@ -123,7 +123,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
@@ -146,7 +146,7 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
RC = getCompletionComment(Ctx, &Decl);
if (!RC)
return "";
- // Sanity check that the comment does not come from the PCH. We choose to
+ // Soundness check that the comment does not come from the PCH. We choose to
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));
Doc = RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp
index 8b3865c8a8e5c..ba8766663c411 100644
--- a/clang-tools-extra/clangd/Compiler.cpp
+++ b/clang-tools-extra/clangd/Compiler.cpp
@@ -100,7 +100,7 @@ buildCompilerInvocation(const ParseInputs &Inputs, clang::DiagnosticConsumer &D,
std::vector<const char *> ArgStrs;
ArgStrs.reserve(Argv.size() + 1);
// In asserts builds, CompilerInvocation redundantly reads/parses cc1 args as
- // a sanity test. This is not useful to clangd, and costs 10% of test time.
+ // a soundness test. This is not useful to clangd, and costs 10% of test time.
// To avoid mismatches between assert/production builds, disable it always.
ArgStrs = {Argv.front().c_str(), "-Xclang", "-no-round-trip-args"};
for (const auto &S : Argv.drop_front())
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index e1c50f906de08..17141a52afc6c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -972,7 +972,7 @@ class ReferenceFinder : public index::IndexDataConsumer {
llvm::dyn_cast_or_null<ObjCMethodDecl>(ASTNode.OrigD)) {
OMD->getSelectorLocs(Locs);
}
- // Sanity check: we expect the *first* token to match the reported loc.
+ // Soundness check: we expect the *first* token to match the reported loc.
// Otherwise, maybe it was e.g. some other kind of reference to a Decl.
if (!Locs.empty() && Locs.front() != Loc)
Locs.clear(); // First token doesn't match, assume our guess was wrong.
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index ed56c2a9d2e81..d9d9cd0f40942 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -106,7 +106,7 @@ struct IncludeGraphCollector : public PPCallbacks {
NodeForIncluding.first->getValue().DirectIncludes.push_back(NodeForInclude);
}
- // Sanity check to ensure we have already populated a skipped file.
+ // Soundness check to ensure we have already populated a skipped file.
void FileSkipped(const FileEntryRef &SkippedFile, const Token &FilenameTok,
SrcMgr::CharacteristicKind FileType) override {
#ifndef NDEBUG
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index ada14c9939318..1c443c50866e2 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -854,7 +854,7 @@ TEST(BackgroundQueueTest, Progress) {
using testing::AnyOf;
BackgroundQueue::Stats S;
BackgroundQueue Q([&](BackgroundQueue::Stats New) {
- // Verify values are sane.
+ // Verify values are sound.
// Items are enqueued one at a time (at least in this test).
EXPECT_THAT(New.Enqueued, AnyOf(S.Enqueued, S.Enqueued + 1));
// Items are completed one at a time.
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index 9ea7c3e02411d..63c92671a621a 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -919,7 +919,7 @@ int d;
StartSecond.wait();
Server.addDocument(FooCpp, SourceContentsWithoutErrors);
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for diagnostics";
- ASSERT_EQ(DiagConsumer.Count, 2); // Sanity check - we actually ran both?
+ ASSERT_EQ(DiagConsumer.Count, 2); // Soundness check - we actually ran both?
}
TEST(ClangdServerTest, FormatCode) {
diff --git a/clang-tools-extra/clangd/unittests/QualityTests.cpp b/clang-tools-extra/clangd/unittests/QualityTests.cpp
index 4954659a45e02..1e6d34d58fcc1 100644
--- a/clang-tools-extra/clangd/unittests/QualityTests.cpp
+++ b/clang-tools-extra/clangd/unittests/QualityTests.cpp
@@ -10,7 +10,7 @@
// For interesting cases, both exact scores and "X beats Y" are too brittle to
// make good hard assertions.
//
-// Here we test the signal extraction and sanity-check that signals point in
+// Here we test the signal extraction and soundness-check that signals point in
// the right direction. This should be supplemented by quality metrics which
// we can compute from a corpus of queries and preferred rankings.
//
diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp
index 5d2a77b62a219..b23d62e37e068 100644
--- a/clang-tools-extra/clangd/unittests/RenameTests.cpp
+++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp
@@ -1444,7 +1444,7 @@ TEST(RenameTest, IndexMergeMainFile) {
EXPECT_THAT(Results.GlobalChanges[Main].asTextEdits(),
ElementsAre(newText("xPrime")));
- // Sanity check: we do expect to see index results!
+ // Soundness check: we do expect to see index results!
TU.Filename = "other.cc";
Results = Rename(TU.index().get());
EXPECT_THAT(Results.GlobalChanges.keys(),
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
index 4d1ca669b8d03..c846291329831 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/expand-modular-headers-ppcallbacks.cpp
@@ -1,4 +1,4 @@
-// Sanity-check. Run without modules:
+// Soundness-check. Run without modules:
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: cp %S/Inputs/expand-modular-headers-ppcallbacks/* %t/
diff --git a/clang/docs/AutomaticReferenceCounting.rst b/clang/docs/AutomaticReferenceCounting.rst
index 80bbd25121148..b10e3635e1d5b 100644
--- a/clang/docs/AutomaticReferenceCounting.rst
+++ b/clang/docs/AutomaticReferenceCounting.rst
@@ -1993,7 +1993,7 @@ A program is ill-formed if it refers to the ``NSAutoreleasePool`` class.
dependencies between two calls. It is also very easy to accidentally forget
to drain an autorelease pool when using the manual API, and this can
significantly inflate the process's high-water-mark. The introduction of a
- new scope is unfortunate but basically required for sane interaction with the
+ new scope is unfortunate but basically required for sound interaction with the
rest of the language. Not draining the pool during an unwind is apparently
required by the Objective-C exceptions implementation.
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index bd742273f4ed5..411d3ee3ecec0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -82,7 +82,7 @@ using it. From this file, :program:`tblgen` generates the unique ID of the
diagnostic, the severity of the diagnostic and the English translation + format
string.
-There is little sanity with the naming of the unique ID's right now. Some
+There is little soundness with the naming of the unique ID's right now. Some
start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name.
Since the enum is referenced in the C++ code that produces the diagnostic, it
is somewhat useful for it to be reasonably short.
diff --git a/clang/docs/Modules.rst b/clang/docs/Modules.rst
index acbe45e0be970..515f5838dbe49 100644
--- a/clang/docs/Modules.rst
+++ b/clang/docs/Modules.rst
@@ -1099,7 +1099,7 @@ The module maps will be written using the `module map language`_, which provides
Headers are often missing ``#include`` directives for headers that they actually depend on. As with the problem of conflicting definitions, this only affects unlucky users who don't happen to include headers in the right order. With modules, the headers of a particular module will be parsed in isolation, so the module may fail to build if there are missing includes.
**Headers that vend multiple APIs at different times**
- Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend ``wchar_t`` only when the macro ``__need_wchar_t`` is defined. Such headers are often included many times in a single translation unit, and will have no include guards. There is no sane way to map this header to a submodule. One can either eliminate the header (e.g., by splitting it into separate headers, one per actual API) or simply ``exclude`` it in the module map.
+ Some systems have headers that contain a number of different kinds of API definitions, only some of which are made available with a given include. For example, the header may vend ``size_t`` only when the macro ``__need_size_t`` is defined before that header is included, and also vend...
[truncated]
|
I worry that sound specifically may be interpreted as to do with soundness as in correctness, given that's the term used to talk about the correctness of compiler transformations |
+1 here, I support this change but would argue we need to brainstorm a different alternative. Soundness doesn't quite capture what was intended, and it has a different meaning in the more mathematical side of computing science. In many places where we say "sane", we usually mean "coherent" or "not obviously incorrect". |
I'd like to see this massive change to be backed by an RFC on Discourse. That is also a good place to discuss various options for the exact wording. Such an RFC passing would itself serve as an announcement that changes merged after this PR should also follow the new language. |
Maybe "spot check" instead of "sanity check", though "spot" is not a replacement for "sanity" generally |
@Endilll Fair enough… I opened an RFC pitch thread on the forums. Thanks! |
Also, please split this up. It's super hard to review, and these massive cross-project patches tend to go nowhere. |
For easier access: https://discourse.llvm.org/t/rfc-inclusive-language-migrate-sanity-checks-to-soundness-checks |
As @philnik777 said, regardless of outcome on the RFC, please split in multiple PR (one per subproject), once consensus is reached on the RFC. |
I don't buy that argument at all. "Sound" has plenty of uses. It does not imply "sound of mind". |
The argument, I believe, is that when you replace "sanity" with 'sound', then sound is used as "sound of mind". |
Background
https://discourse.llvm.org/t/-/88192
Inspired by:
Swift
Searching through the repo, we see three main categories of changes:
Ranking from "least" to "most" risky to land without causing any bugs or unintended consequences, let's start here with migrating comments and documentation.
Changes
sanity
tosoundness
sane
tosound
insane
tounsound
sanely
tosoundly
This diff is only intended to migrate comments and documentation. Please feel free to Request Changes if you find a constant string or symbol that was included by mistake. Thanks!