[clang] 87a5513 - Fix "the the" typo in documentation and user facing strings

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Thu May 5 08:52:46 PDT 2022


Author: Brian Tracy
Date: 2022-05-05T17:52:08+02:00
New Revision: 87a55137e2a2a6684a20223494ad46d2fa33aca8

URL: https://github.com/llvm/llvm-project/commit/87a55137e2a2a6684a20223494ad46d2fa33aca8
DIFF: https://github.com/llvm/llvm-project/commit/87a55137e2a2a6684a20223494ad46d2fa33aca8.diff

LOG: Fix "the the" typo in documentation and user facing strings

There are many more instances of this pattern, but I chose to limit this change to .rst files (docs), anything in libcxx/include, and string literals. These have the highest chance of being seen by end users.

Reviewed By: #libc, Mordante, martong, ldionne

Differential Revision: https://reviews.llvm.org/D124708

Added: 
    

Modified: 
    clang/docs/LanguageExtensions.rst
    clang/docs/MatrixTypes.rst
    clang/docs/UndefinedBehaviorSanitizer.rst
    clang/docs/analyzer/checkers.rst
    clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
    clang/test/Analysis/cert/env34-c.c
    libcxx/include/__iterator/advance.h
    libcxx/src/filesystem/operations.cpp
    llvm/docs/AMDGPUUsage.rst
    llvm/docs/BugLifeCycle.rst
    llvm/docs/CodingStandards.rst
    llvm/docs/CommandGuide/llvm-profdata.rst
    llvm/include/llvm/Analysis/Loads.h
    llvm/include/llvm/ExecutionEngine/Orc/Core.h
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
    llvm/tools/llvm-profdata/llvm-profdata.cpp

Removed: 
    


################################################################################
diff  --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index fbc881a724bb2..426ca4aa24dcd 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -3998,7 +3998,7 @@ Note that ``-ffp-contract=fast`` will override pragmas to fuse multiply and
 addition across statements regardless of any controlling pragmas.
 
 ``#pragma clang fp exceptions`` specifies floating point exception behavior. It
-may take one the the values: ``ignore``, ``maytrap`` or ``strict``. Meaning of
+may take one of the values: ``ignore``, ``maytrap`` or ``strict``. Meaning of
 these values is same as for `constrained floating point intrinsics <http://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics>`_.
 
 .. code-block:: c++

diff  --git a/clang/docs/MatrixTypes.rst b/clang/docs/MatrixTypes.rst
index 616c88f8a474b..2efebbfad9381 100644
--- a/clang/docs/MatrixTypes.rst
+++ b/clang/docs/MatrixTypes.rst
@@ -208,7 +208,7 @@ Definitions:
 ``M2 __builtin_matrix_transpose(M1 matrix)``
 
 **Remarks**: The return type is a cv-unqualified matrix type that has the same
-element type as ``M1`` and has the the same number of rows as ``M1`` has columns and
+element type as ``M1`` and has the same number of rows as ``M1`` has columns and
 the same number of columns as ``M1`` has rows.
 
 **Returns**: A matrix ``Res`` equivalent to the code below, where ``col`` refers to the

diff  --git a/clang/docs/UndefinedBehaviorSanitizer.rst b/clang/docs/UndefinedBehaviorSanitizer.rst
index da6779927e669..a6fac18239aef 100644
--- a/clang/docs/UndefinedBehaviorSanitizer.rst
+++ b/clang/docs/UndefinedBehaviorSanitizer.rst
@@ -114,7 +114,7 @@ Available checks are:
      Issues caught by these sanitizers are not undefined behavior,
      but are often unintentional.
   -  ``-fsanitize=implicit-integer-sign-change``: Implicit conversion between
-     integer types, if that changes the sign of the value. That is, if the the
+     integer types, if that changes the sign of the value. That is, if the
      original value was negative and the new value is positive (or zero),
      or the original value was positive, and the new value is negative.
      Issues caught by this sanitizer are not undefined behavior,

diff  --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index 4b0b53ca8da2b..2fff6e0a63942 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -2466,7 +2466,7 @@ Here, ``ptr`` is the buffer, and its minimum size is ``size * nmemb``
 
     // Below we receive a warning because the 3rd parameter should be the
     // number of elements to read, not the size in bytes. This case is a known
-    // vulnerability described by the the ARR38-C SEI-CERT rule.
+    // vulnerability described by the ARR38-C SEI-CERT rule.
     fread(wbuf, size, nitems, file);
   }
 

diff  --git a/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
index d7d573cd2d3be..a09fa3d33892c 100644
--- a/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/cert/InvalidPtrChecker.cpp
@@ -132,7 +132,7 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall(
         return;
       Out << '\'';
       FD->getNameForDiagnostic(Out, FD->getASTContext().getLangOpts(), true);
-      Out << "' call may invalidate the the result of the previous " << '\'';
+      Out << "' call may invalidate the result of the previous " << '\'';
       FD->getNameForDiagnostic(Out, FD->getASTContext().getLangOpts(), true);
       Out << '\'';
     });

diff  --git a/clang/test/Analysis/cert/env34-c.c b/clang/test/Analysis/cert/env34-c.c
index 3c1a3930d6379..dc7b0340c311e 100644
--- a/clang/test/Analysis/cert/env34-c.c
+++ b/clang/test/Analysis/cert/env34-c.c
@@ -39,7 +39,7 @@ void getenv_test2(void) {
   *p; // no-warning
 
   p2 = getenv("VAR2");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   *p;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -55,7 +55,7 @@ void getenv_test3(void) {
   p = getenv("VAR2");
   // expected-note at -1{{previous function call was here}}
   p2 = getenv("VAR2");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   p3 = getenv("VAR3");
 
@@ -70,7 +70,7 @@ void getenv_test4(void) {
   p = getenv("VAR");
   // expected-note at -1{{previous function call was here}}
   p2 = getenv("VAR2");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
   p3 = getenv("VAR3");
 
   *p;
@@ -85,7 +85,7 @@ void getenv_test5(void) {
   p2 = getenv("VAR2");
   // expected-note at -1{{previous function call was here}}
   p3 = getenv("VAR3");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   *p2;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -103,7 +103,7 @@ void getenv_test6(void) {
 
   p2 = getenv("VAR3");
   // expected-note at -1{{previous function call was here}}
-  // expected-note at -2{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -2{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   *p;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -112,7 +112,7 @@ void getenv_test6(void) {
   *p2; // no-warning
 
   p = getenv("VAR4");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   *p; // no-warning
   *p2;
@@ -127,7 +127,7 @@ void getenv_test7(void) {
   *p; // no-warning
 
   p2 = getenv("VAR2");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   foo(p);
   // expected-warning at -1{{use of invalidated pointer 'p' in a function call}}
@@ -152,7 +152,7 @@ void getenv_test8(void) {
   if( !array[1] )
   // expected-note at -1{{Taking true branch}}
     array[1] = getenv("TMPDIR");
-    // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   *array[0];
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -169,7 +169,7 @@ void getenv_test9(void) {
 
 void getenv_test10(void) {
   strcmp(getenv("VAR1"), getenv("VAR2"));
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
   // expected-note at -2{{previous function call was here}}
   // expected-warning at -3{{use of invalidated pointer 'getenv("VAR1")' in a function call}}
   // expected-note at -4{{use of invalidated pointer 'getenv("VAR1")' in a function call}}
@@ -186,7 +186,7 @@ void getenv_test11(void) {
   // expected-note at -1{{previous function call was here}}
 
   char *pp = getenv("VAR2");
-  // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+  // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
 
   dereference_pointer(p);
   // expected-note at -1{{Calling 'dereference_pointer'}}
@@ -200,7 +200,7 @@ void getenv_test12(int flag1, int flag2) {
     // expected-note at -1{{Assuming 'flag1' is not equal to 0}}
     // expected-note at -2{{Taking true branch}}
     char *pp = getenv("VAR2");
-    // expected-note at -1{{'getenv' call may invalidate the the result of the previous 'getenv'}}
+    // expected-note at -1{{'getenv' call may invalidate the result of the previous 'getenv'}}
   }
 
   if (flag2) {
@@ -222,7 +222,7 @@ void setlocale_test1(void) {
   *p; // no-warning
 
   p2 = setlocale(0, "VAR3");
-  // expected-note at -1{{'setlocale' call may invalidate the the result of the previous 'setlocale'}}
+  // expected-note at -1{{'setlocale' call may invalidate the result of the previous 'setlocale'}}
 
   *p;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -242,7 +242,7 @@ void setlocale_test2(int flag) {
     // expected-note at -1{{Assuming 'flag' is not equal to 0}}
     // expected-note at -2{{Taking true branch}}
     p2 = setlocale(0, "VAR3");
-    // expected-note at -1{{'setlocale' call may invalidate the the result of the previous 'setlocale'}}
+    // expected-note at -1{{'setlocale' call may invalidate the result of the previous 'setlocale'}}
   }
 
   *p;
@@ -261,7 +261,7 @@ void strerror_test1(void) {
   *p; // no-warning
 
   p2 = strerror(2);
-  // expected-note at -1{{'strerror' call may invalidate the the result of the previous 'strerror'}}
+  // expected-note at -1{{'strerror' call may invalidate the result of the previous 'strerror'}}
 
   *p;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -290,7 +290,7 @@ void strerror_test2(int errno) {
     // expected-note at -1{{Assuming 'errno' is not equal to 0}}
     // expected-note at -2{{Taking true branch}}
     p2 = strerror(errno);
-    // expected-note at -1{{'strerror' call may invalidate the the result of the previous 'strerror'}}
+    // expected-note at -1{{'strerror' call may invalidate the result of the previous 'strerror'}}
   }
 
   *p;
@@ -305,7 +305,7 @@ void asctime_test(void) {
   char* p = asctime(t);
   // expected-note at -1{{previous function call was here}}
   char* pp = asctime(tt);
-  // expected-note at -1{{'asctime' call may invalidate the the result of the previous 'asctime'}}
+  // expected-note at -1{{'asctime' call may invalidate the result of the previous 'asctime'}}
 
   *p;
   // expected-warning at -1{{dereferencing an invalid pointer}}
@@ -316,7 +316,7 @@ void localeconv_test1(void) {
   lconv *lc1 = localeconv();
   // expected-note at -1{{previous function call was here}}
   lconv *lc2 = localeconv();
-  // expected-note at -1{{'localeconv' call may invalidate the the result of the previous 'localeconv'}}
+  // expected-note at -1{{'localeconv' call may invalidate the result of the previous 'localeconv'}}
 
   *lc1;
   // expected-warning at -1{{dereferencing an invalid pointer}}

diff  --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h
index acf12e6a3858c..5a02e7d8f10ba 100644
--- a/libcxx/include/__iterator/advance.h
+++ b/libcxx/include/__iterator/advance.h
@@ -141,7 +141,7 @@ struct __fn {
   //   * If `n > 0`, [i, bound) denotes a range.
   //   * If `n == 0`, [i, bound) or [bound, i) denotes a range.
   //   * If `n < 0`, [bound, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model `same_as<I, S>`.
-  // Returns: `n - M`, where `M` is the 
diff erence between the the ending and starting position.
+  // Returns: `n - M`, where `M` is the 
diff erence between the ending and starting position.
   template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
   _LIBCPP_HIDE_FROM_ABI
   constexpr iter_
diff erence_t<_Ip> operator()(_Ip& __i, iter_
diff erence_t<_Ip> __n, _Sp __bound) const {

diff  --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index 562cd8b57d3ff..7467abb7c15df 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -1884,7 +1884,7 @@ path path::lexically_relative(const path& base) const {
   if (ElemCount == 0 && (PP.atEnd() || *PP == PATHSTR("")))
     return PATHSTR(".");
 
-  // return a path constructed with 'n' dot-dot elements, followed by the the
+  // return a path constructed with 'n' dot-dot elements, followed by the
   // elements of '*this' after the mismatch.
   path Result;
   // FIXME: Reserve enough room in Result that it won't have to re-allocate.

diff  --git a/llvm/docs/AMDGPUUsage.rst b/llvm/docs/AMDGPUUsage.rst
index 91dbecaab9b29..2427df15e1f85 100644
--- a/llvm/docs/AMDGPUUsage.rst
+++ b/llvm/docs/AMDGPUUsage.rst
@@ -3627,17 +3627,17 @@ Code object V5 metadata is the same as
                                                        is 1 or 2, then must be 1.
 
                                                      "hidden_remainder_x"
-                                                       The grid dispatch work group size of the the partial work group
+                                                       The grid dispatch work group size of the partial work group
                                                        of the X dimension, if it exists. Must be zero if a partial
                                                        work group does not exist in the X dimension.
 
                                                      "hidden_remainder_y"
-                                                       The grid dispatch work group size of the the partial work group
+                                                       The grid dispatch work group size of the partial work group
                                                        of the Y dimension, if it exists. Must be zero if a partial
                                                        work group does not exist in the Y dimension.
 
                                                      "hidden_remainder_z"
-                                                       The grid dispatch work group size of the the partial work group
+                                                       The grid dispatch work group size of the partial work group
                                                        of the Z dimension, if it exists. Must be zero if a partial
                                                        work group does not exist in the Z dimension.
 

diff  --git a/llvm/docs/BugLifeCycle.rst b/llvm/docs/BugLifeCycle.rst
index 004b677758652..9bf13e64ed56e 100644
--- a/llvm/docs/BugLifeCycle.rst
+++ b/llvm/docs/BugLifeCycle.rst
@@ -99,7 +99,7 @@ Actively working on fixing bugs
 
 Please remember to assign the bug to yourself if you're actively working on
 fixing it and to unassign it when you're no longer actively working on it.  You
-unassign a bug by removing the person from the the ``Assignees`` field.
+unassign a bug by removing the person from the ``Assignees`` field.
 
 .. _Closing:
 

diff  --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index 4ddeea5e111b8..e815eef24aa10 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -1312,7 +1312,7 @@ loops wherever possible for all newly added code. For example:
     ... use I ...
 
 Usage of ``std::for_each()``/``llvm::for_each()`` functions is discouraged,
-unless the the callable object already exists.
+unless the callable object already exists.
 
 Don't evaluate ``end()`` every time through a loop
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

diff  --git a/llvm/docs/CommandGuide/llvm-profdata.rst b/llvm/docs/CommandGuide/llvm-profdata.rst
index acea59daa057f..17de378ceec34 100644
--- a/llvm/docs/CommandGuide/llvm-profdata.rst
+++ b/llvm/docs/CommandGuide/llvm-profdata.rst
@@ -170,7 +170,7 @@ OPTIONS
 .. option:: --zero-counter-threshold=<float>
 
  For the function which is cold in instr profile but hot in sample profile, if
- the ratio of the number of zero counters divided by the the total number of
+ the ratio of the number of zero counters divided by the total number of
  counters is above the threshold, the profile of the function will be regarded
  as being harmful for performance and will be dropped.
 

diff  --git a/llvm/include/llvm/Analysis/Loads.h b/llvm/include/llvm/Analysis/Loads.h
index 09bf98d324ed5..29e3efb38e195 100644
--- a/llvm/include/llvm/Analysis/Loads.h
+++ b/llvm/include/llvm/Analysis/Loads.h
@@ -75,9 +75,9 @@ bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
 /// within the specified loop) would access only dereferenceable memory, and
 /// be properly aligned on every iteration of the specified loop regardless of
 /// its placement within the loop. (i.e. does not require predication beyond
-/// that required by the the header itself and could be hoisted into the header
+/// that required by the header itself and could be hoisted into the header
 /// if desired.)  This is more powerful than the variants above when the
-/// address loaded from is analyzeable by SCEV.  
+/// address loaded from is analyzeable by SCEV.
 bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
                                        ScalarEvolution &SE,
                                        DominatorTree &DT);

diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index c4647148f287b..d525914200a13 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -1331,7 +1331,7 @@ class Platform {
   lookupInitSymbols(ExecutionSession &ES,
                     const DenseMap<JITDylib *, SymbolLookupSet> &InitSyms);
 
-  /// Performs an async lookup for the the given symbols in each of the given
+  /// Performs an async lookup for the given symbols in each of the given
   /// JITDylibs, calling the given handler once all lookups have completed.
   static void
   lookupInitSymbolsAsync(unique_function<void(Error)> OnComplete,

diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
index a72beaf28a208..efca5884fd2fc 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
@@ -196,7 +196,7 @@ class SpillLocationNo {
 };
 
 /// Meta qualifiers for a value. Pair of whatever expression is used to qualify
-/// the the value, and Boolean of whether or not it's indirect.
+/// the value, and Boolean of whether or not it's indirect.
 class DbgValueProperties {
 public:
   DbgValueProperties(const DIExpression *DIExpr, bool Indirect)

diff  --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index aea608897874b..ffb64d71771cc 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -995,7 +995,7 @@ static int merge_main(int argc, const char *argv[]) {
       "zero-counter-threshold", cl::init(0.7), cl::Hidden,
       cl::desc("For the function which is cold in instr profile but hot in "
                "sample profile, if the ratio of the number of zero counters "
-               "divided by the the total number of counters is above the "
+               "divided by the total number of counters is above the "
                "threshold, the profile of the function will be regarded as "
                "being harmful for performance and will be dropped."));
   cl::opt<unsigned> SupplMinSizeThreshold(


        


More information about the cfe-commits mailing list