GabrielRavier created this revision.
Herald added subscribers: carlosgalvezp, usaxena95, kadircet, arphaman, 
javed.absar, kbarton, nemanjai.
Herald added a project: All.
GabrielRavier requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130826

Files:
  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

Index: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/virtual-class-destructor.cpp
+++ 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:
Index: clang-tools-extra/pseudo/lib/cxx/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx/cxx.bnf
+++ 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.
 #
Index: clang-tools-extra/pseudo/gen/Main.cpp
===================================================================
--- clang-tools-extra/pseudo/gen/Main.cpp
+++ 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`;
Index: clang-tools-extra/clangd/unittests/XRefsTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/XRefsTests.cpp
+++ 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();
Index: clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
+++ 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.
Index: clang-tools-extra/clangd/index/CanonicalIncludes.h
===================================================================
--- clang-tools-extra/clangd/index/CanonicalIncludes.h
+++ 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.
Index: clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp
===================================================================
--- clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp
+++ clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp
@@ -61,7 +61,7 @@
   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 @@
     State.PauseTiming();
     const std::vector<Example> Examples = generateRandomDataset(1000000);
     State.ResumeTiming();
-    runDecisionForestPrediciton(Examples);
+    runDecisionForestPrediction(Examples);
   }
 }
 BENCHMARK(decisionForestPredict);
Index: clang-tools-extra/clangd/SemanticHighlighting.cpp
===================================================================
--- clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ 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);
   }
Index: clang-tools-extra/clangd/Quality.cpp
===================================================================
--- clang-tools-extra/clangd/Quality.cpp
+++ 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`.
Index: clang-tools-extra/clangd/InlayHints.cpp
===================================================================
--- clang-tools-extra/clangd/InlayHints.cpp
+++ 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;
Index: clang-tools-extra/clangd/IncludeCleaner.cpp
===================================================================
--- clang-tools-extra/clangd/IncludeCleaner.cpp
+++ 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)) {
Index: clang-tools-extra/clangd/HeuristicResolver.cpp
===================================================================
--- clang-tools-extra/clangd/HeuristicResolver.cpp
+++ clang-tools-extra/clangd/HeuristicResolver.cpp
@@ -120,8 +120,8 @@
     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);
Index: clang-tools-extra/clangd/DumpAST.cpp
===================================================================
--- clang-tools-extra/clangd/DumpAST.cpp
+++ 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(); }
Index: clang-tools-extra/clangd/ConfigFragment.h
===================================================================
--- clang-tools-extra/clangd/ConfigFragment.h
+++ clang-tools-extra/clangd/ConfigFragment.h
@@ -163,8 +163,8 @@
     /// 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.
Index: clang-tools-extra/clangd/CodeComplete.h
===================================================================
--- clang-tools-extra/clangd/CodeComplete.h
+++ 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;
 };
Index: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h
===================================================================
--- clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.h
+++ 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).
 ///
Index: clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
+++ 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() ||
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to