diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp @@ -138,7 +138,7 @@ 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 --- a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h +++ b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h @@ -19,7 +19,7 @@ /// 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 --- a/clang-tools-extra/clangd/CodeComplete.h +++ b/clang-tools-extra/clangd/CodeComplete.h @@ -142,9 +142,9 @@ /// 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 --- a/clang-tools-extra/clangd/ConfigFragment.h +++ b/clang-tools-extra/clangd/ConfigFragment.h @@ -163,8 +163,8 @@ /// Flags added by the same CompileFlags entry will not be removed. std::vector> 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 --- a/clang-tools-extra/clangd/DumpAST.cpp +++ b/clang-tools-extra/clangd/DumpAST.cpp @@ -111,7 +111,7 @@ // 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 --- a/clang-tools-extra/clangd/HeuristicResolver.cpp +++ b/clang-tools-extra/clangd/HeuristicResolver.cpp @@ -120,8 +120,8 @@ return {}; if (const auto *BT = BaseType->getAs()) { // 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 --- a/clang-tools-extra/clangd/IncludeCleaner.cpp +++ b/clang-tools-extra/clangd/IncludeCleaner.cpp @@ -286,7 +286,7 @@ 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 --- a/clang-tools-extra/clangd/InlayHints.cpp +++ b/clang-tools-extra/clangd/InlayHints.cpp @@ -383,7 +383,7 @@ 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 --- a/clang-tools-extra/clangd/Quality.cpp +++ b/clang-tools-extra/clangd/Quality.cpp @@ -570,7 +570,7 @@ 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 --- 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, 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 --- a/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp +++ b/clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp @@ -61,7 +61,7 @@ return Examples; } -void runDecisionForestPrediciton(const std::vector Examples) { +void runDecisionForestPrediction(const std::vector Examples) { for (const Example &E : Examples) Evaluate(E); } @@ -72,7 +72,7 @@ State.PauseTiming(); const std::vector 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 --- a/clang-tools-extra/clangd/index/CanonicalIncludes.h +++ b/clang-tools-extra/clangd/index/CanonicalIncludes.h @@ -78,7 +78,7 @@ /// - 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 --- a/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp +++ b/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp @@ -1035,7 +1035,7 @@ // 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 --- a/clang-tools-extra/clangd/unittests/XRefsTests.cpp +++ b/clang-tools-extra/clangd/unittests/XRefsTests.cpp @@ -1801,7 +1801,7 @@ } } -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 --- a/clang-tools-extra/pseudo/gen/Main.cpp +++ b/clang-tools-extra/pseudo/gen/Main.cpp @@ -65,7 +65,7 @@ // 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 --- 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 --- 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 @@ // 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: