Author: Gabriel Ravier Date: 2022-08-01T15:32:25+02:00 New Revision: 0ed2bd9311fd54f0b414549b96a2cd4036ef0945
URL: https://github.com/llvm/llvm-project/commit/0ed2bd9311fd54f0b414549b96a2cd4036ef0945 DIFF: https://github.com/llvm/llvm-project/commit/0ed2bd9311fd54f0b414549b96a2cd4036ef0945.diff LOG: [clang-tools-extra] Fixed a number of typos I went over the output of the following mess of a command: `(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)` and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D130826 Added: Modified: clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h clang-tools-extra/clangd/CodeComplete.h clang-tools-extra/clangd/ConfigFragment.h clang-tools-extra/clangd/DumpAST.cpp clang-tools-extra/clangd/HeuristicResolver.cpp clang-tools-extra/clangd/IncludeCleaner.cpp clang-tools-extra/clangd/InlayHints.cpp clang-tools-extra/clangd/Quality.cpp clang-tools-extra/clangd/SemanticHighlighting.cpp clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp clang-tools-extra/clangd/index/CanonicalIncludes.h clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp clang-tools-extra/clangd/unittests/XRefsTests.cpp clang-tools-extra/pseudo/gen/Main.cpp clang-tools-extra/pseudo/lib/cxx/cxx.bnf clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp index 024a06bf3aa70..f9dd542b5c996 100644 --- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp @@ -138,7 +138,7 @@ static bool hasRValueOverload(const CXXConstructorDecl *Ctor, const int ParamIdx = Param->getFunctionScopeIndex(); const CXXRecordDecl *Record = Ctor->getParent(); - // Check whether a ctor `C` forms a pair with `Ctor` under the aforementionned + // Check whether a ctor `C` forms a pair with `Ctor` under the aforementioned // rules. const auto IsRValueOverload = [&Ctor, ParamIdx](const CXXConstructorDecl *C) { if (C == Ctor || C->isDeleted() || diff --git a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h index 28050e079cf5c..dee1e2149ab6e 100644 --- a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h +++ b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h @@ -19,7 +19,7 @@ namespace performance { /// Finds calls to C math library functions with implicit float to double /// promotions. /// -/// For example, warns on ::sin(0.f), because this funciton's parameter is a +/// For example, warns on ::sin(0.f), because this function's parameter is a /// double. You probably meant to call std::sin(0.f) (in C++), or sinf(0.f) (in /// C). /// diff --git a/clang-tools-extra/clangd/CodeComplete.h b/clang-tools-extra/clangd/CodeComplete.h index 73139ba40e765..ebd451c95c76c 100644 --- a/clang-tools-extra/clangd/CodeComplete.h +++ b/clang-tools-extra/clangd/CodeComplete.h @@ -142,9 +142,9 @@ struct CodeCompleteOptions { /// CompletionScore is NameMatch * pow(Base, Prediction). /// The optimal value of Base largely depends on the semantics of the model /// and prediction score (e.g. algorithm used during training, number of - /// trees, etc.). Usually if the range of Prediciton is [-20, 20] then a Base + /// trees, etc.). Usually if the range of Prediction is [-20, 20] then a Base /// in [1.2, 1.7] works fine. - /// Semantics: E.g. For Base = 1.3, if the Prediciton score reduces by 2.6 + /// Semantics: E.g. For Base = 1.3, if the Prediction score reduces by 2.6 /// points then completion score reduces by 50% or 1.3^(-2.6). float DecisionForestBase = 1.3f; }; diff --git a/clang-tools-extra/clangd/ConfigFragment.h b/clang-tools-extra/clangd/ConfigFragment.h index 5950f8ff655c3..98923b516752b 100644 --- a/clang-tools-extra/clangd/ConfigFragment.h +++ b/clang-tools-extra/clangd/ConfigFragment.h @@ -163,8 +163,8 @@ struct Fragment { /// Flags added by the same CompileFlags entry will not be removed. std::vector<Located<std::string>> Remove; - /// Directory to search for compilation database (compile_comands.json etc). - /// Valid values are: + /// Directory to search for compilation database (compile_commands.json + /// etc). Valid values are: /// - A single path to a directory (absolute, or relative to the fragment) /// - Ancestors: search all parent directories (the default) /// - None: do not use a compilation database, just default flags. diff --git a/clang-tools-extra/clangd/DumpAST.cpp b/clang-tools-extra/clangd/DumpAST.cpp index 8f640ad821f8c..3e2d7ceb2925a 100644 --- a/clang-tools-extra/clangd/DumpAST.cpp +++ b/clang-tools-extra/clangd/DumpAST.cpp @@ -111,7 +111,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> { // Attr just uses a weird method name. Maybe we should fix it instead? SourceRange getSourceRange(const Attr *Node) { return Node->getRange(); } - // Kind is usualy the class name, without the suffix ("Type" etc). + // Kind is usually the class name, without the suffix ("Type" etc). // Where there's a set of variants instead, we use the 'Kind' enum values. std::string getKind(const Decl *D) { return D->getDeclKindName(); } diff --git a/clang-tools-extra/clangd/HeuristicResolver.cpp b/clang-tools-extra/clangd/HeuristicResolver.cpp index 37e8f134efdfc..1a09cbe45a859 100644 --- a/clang-tools-extra/clangd/HeuristicResolver.cpp +++ b/clang-tools-extra/clangd/HeuristicResolver.cpp @@ -120,8 +120,8 @@ std::vector<const NamedDecl *> HeuristicResolver::resolveMemberExpr( return {}; if (const auto *BT = BaseType->getAs<BuiltinType>()) { // If BaseType is the type of a dependent expression, it's just - // represented as BultinType::Dependent which gives us no information. We - // can get further by analyzing the depedent expression. + // represented as BuiltinType::Dependent which gives us no information. We + // can get further by analyzing the dependent expression. Expr *Base = ME->isImplicitAccess() ? nullptr : ME->getBase(); if (Base && BT->getKind() == BuiltinType::Dependent) { BaseType = resolveExprToType(Base); diff --git a/clang-tools-extra/clangd/IncludeCleaner.cpp b/clang-tools-extra/clangd/IncludeCleaner.cpp index e5b5187e030c5..0bdf32c6d69dd 100644 --- a/clang-tools-extra/clangd/IncludeCleaner.cpp +++ b/clang-tools-extra/clangd/IncludeCleaner.cpp @@ -286,7 +286,7 @@ static bool mayConsiderUnused(const Inclusion &Inc, ParsedAST &AST, return false; } for (auto &Filter : Cfg.Diagnostics.Includes.IgnoreHeader) { - // Convert the path to Unix slashes and try to match aginast the fiilter. + // Convert the path to Unix slashes and try to match against the filter. llvm::SmallString<64> Path(Inc.Resolved); llvm::sys::path::native(Path, llvm::sys::path::Style::posix); if (Filter(Inc.Resolved)) { diff --git a/clang-tools-extra/clangd/InlayHints.cpp b/clang-tools-extra/clangd/InlayHints.cpp index 9b3b2b1c53224..8983f6b7a9eb8 100644 --- a/clang-tools-extra/clangd/InlayHints.cpp +++ b/clang-tools-extra/clangd/InlayHints.cpp @@ -383,7 +383,7 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> { if (!Cfg.InlayHints.Parameters || Args.size() == 0 || !Callee) return; - // If the anchor location comes from a macro defintion, there's nowhere to + // If the anchor location comes from a macro definition, there's nowhere to // put hints. if (!AST.getSourceManager().getTopMacroCallerLoc(Anchor).isFileID()) return; diff --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp index 0024e63955334..6fa9861b1dab2 100644 --- a/clang-tools-extra/clangd/Quality.cpp +++ b/clang-tools-extra/clangd/Quality.cpp @@ -570,7 +570,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality, DecisionForestScores Scores; // Exponentiating DecisionForest prediction makes the score of each tree a // multiplciative boost (like NameMatch). This allows us to weigh the - // prediciton score and NameMatch appropriately. + // prediction score and NameMatch appropriately. Scores.ExcludingName = pow(Base, Evaluate(E)); // Following cases are not part of the generated training dataset: // - Symbols with `NeedsFixIts`. diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp index 7599c1eff0181..4a50853455b92 100644 --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -925,7 +925,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, HighlightingKind K) { llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, HighlightingModifier K) { switch (K) { case HighlightingModifier::Declaration: - return OS << "decl"; // abbrevation for common case + return OS << "decl"; // abbreviation for common case default: return OS << toSemanticTokenModifier(K); } diff --git a/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp b/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp index 47d4a76c4dd85..7ca760abb41b0 100644 --- a/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp +++ b/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp @@ -61,7 +61,7 @@ std::vector<Example> generateRandomDataset(int NumExamples) { return Examples; } -void runDecisionForestPrediciton(const std::vector<Example> Examples) { +void runDecisionForestPrediction(const std::vector<Example> Examples) { for (const Example &E : Examples) Evaluate(E); } @@ -72,7 +72,7 @@ static void decisionForestPredict(benchmark::State &State) { State.PauseTiming(); const std::vector<Example> Examples = generateRandomDataset(1000000); State.ResumeTiming(); - runDecisionForestPrediciton(Examples); + runDecisionForestPrediction(Examples); } } BENCHMARK(decisionForestPredict); diff --git a/clang-tools-extra/clangd/index/CanonicalIncludes.h b/clang-tools-extra/clangd/index/CanonicalIncludes.h index c3ac9c3b80623..3e35efaa8b1c5 100644 --- a/clang-tools-extra/clangd/index/CanonicalIncludes.h +++ b/clang-tools-extra/clangd/index/CanonicalIncludes.h @@ -78,7 +78,7 @@ class CanonicalIncludes { /// - export: this is common and potentially interesting, there are three cases: /// * Points to a public header (common): we can suppress include2 if you /// already have include1. Only marginally useful. -/// * Points to a private header annotated with `private` (somewhat commmon): +/// * Points to a private header annotated with `private` (somewhat common): /// Not incrementally useful as we support private. /// * Points to a private header without pragmas (rare). This is a reversed /// private pragma, and is valuable but too rare to be worthwhile. diff --git a/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp b/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp index 8cb1ba93a5929..33c92b3425e89 100644 --- a/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp +++ b/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp @@ -1035,7 +1035,7 @@ TEST_F(TUSchedulerTests, TUStatus) { // Starts handling the update action and blocks until the // first preamble is built. ASTAction::RunningAction, - // Afterwqards it builds an AST for that preamble to publish + // Afterwards it builds an AST for that preamble to publish // diagnostics. ASTAction::Building, // Then goes idle. diff --git a/clang-tools-extra/clangd/unittests/XRefsTests.cpp b/clang-tools-extra/clangd/unittests/XRefsTests.cpp index 0f3a12b7398ef..40650c36046cb 100644 --- a/clang-tools-extra/clangd/unittests/XRefsTests.cpp +++ b/clang-tools-extra/clangd/unittests/XRefsTests.cpp @@ -1801,7 +1801,7 @@ TEST(FindImplementations, Inheritance) { } } -TEST(FindImplementations, CaptureDefintion) { +TEST(FindImplementations, CaptureDefinition) { llvm::StringRef Test = R"cpp( struct Base { virtual void F^oo(); diff --git a/clang-tools-extra/pseudo/gen/Main.cpp b/clang-tools-extra/pseudo/gen/Main.cpp index 5cc33aa3f8b27..25cb26563837a 100644 --- a/clang-tools-extra/pseudo/gen/Main.cpp +++ b/clang-tools-extra/pseudo/gen/Main.cpp @@ -65,7 +65,7 @@ namespace { // Mangles a symbol name into a valid identifier. // // These follow names in the grammar fairly closely: -// nonterminal: `ptr-declartor` becomes `ptr_declarator`; +// nonterminal: `ptr-declarator` becomes `ptr_declarator`; // punctuator: `,` becomes `COMMA`; // keyword: `INT` becomes `INT`; // terminal: `IDENTIFIER` becomes `IDENTIFIER`; diff --git a/clang-tools-extra/pseudo/lib/cxx/cxx.bnf b/clang-tools-extra/pseudo/lib/cxx/cxx.bnf index e1667fe8ea732..5f1cba4503948 100644 --- a/clang-tools-extra/pseudo/lib/cxx/cxx.bnf +++ b/clang-tools-extra/pseudo/lib/cxx/cxx.bnf @@ -1,7 +1,7 @@ # This is a C++ grammar from the C++ standard [1]. # # The grammar is a superset of the true grammar requring semantic constraints to -# resolve ambiguties. The grammar is context-free and ambiguous (beyond the +# resolve ambiguities. The grammar is context-free and ambiguous (beyond the # limit of LR(k)). We use general parsing algorithm (e.g GLR) to handle the # grammar and generate a transition table which is used to drive the parsing. # diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp index 61e565075b15d..c599fc0d17c13 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp @@ -143,7 +143,7 @@ class PublicNonVirtualBaseClass { // CHECK-FIXES: virtual ~PublicNonVirtualBaseClass() {} }; -class PublicNonVirtualNonBaseClass { // OK accoring to C.35, since this class does not have any virtual methods. +class PublicNonVirtualNonBaseClass { // OK according to C.35, since this class does not have any virtual methods. void f(); public: _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits