[compiler-rt] [llvm] Fix some small typos in compiler-rt. NFC (PR #133388)

Qinkun Bao via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 28 01:09:31 PDT 2025


https://github.com/qinkunbao updated https://github.com/llvm/llvm-project/pull/133388

>From b99c76af9adbed258305e56bf9445f82bf82cf23 Mon Sep 17 00:00:00 2001
From: Qinkun Bao <qinkun at google.com>
Date: Fri, 28 Mar 2025 07:09:01 +0000
Subject: [PATCH] Fix some small typos in compiler-rt.

---
 compiler-rt/cmake/Modules/AddCompilerRT.cmake            | 2 +-
 compiler-rt/cmake/Modules/CompilerRTUtils.cmake          | 2 +-
 compiler-rt/include/profile/InstrProfData.inc            | 2 +-
 compiler-rt/lib/asan/asan_activation.cpp                 | 2 +-
 compiler-rt/lib/asan/asan_flags.h                        | 8 ++++----
 compiler-rt/lib/asan/asan_interceptors.cpp               | 2 +-
 compiler-rt/lib/asan/asan_report.cpp                     | 2 +-
 compiler-rt/lib/memprof/memprof_flags.h                  | 2 +-
 compiler-rt/lib/profile/InstrProfiling.h                 | 4 ++--
 compiler-rt/lib/profile/InstrProfilingFile.c             | 9 +++++----
 compiler-rt/lib/profile/InstrProfilingInternal.h         | 2 +-
 .../test/asan/TestCases/Posix/deep_call_stack.cpp        | 2 +-
 compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp | 2 +-
 .../asan/TestCases/alloca_instruments_all_paddings.cpp   | 2 +-
 compiler-rt/test/metadata/lit.cfg.py                     | 2 +-
 .../sanitizer_common/TestCases/Darwin/malloc_zone.cpp    | 2 +-
 .../test/tsan/Darwin/no_call_setenv_in_symbolize.cpp     | 2 +-
 compiler-rt/test/tsan/Linux/clone_setns.cpp              | 2 +-
 llvm/include/llvm/ProfileData/InstrProfData.inc          | 2 +-
 19 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index c3e734f72392f..d346b0ec01b03 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -525,7 +525,7 @@ function(add_compiler_rt_test test_suite test_name arch)
   # when linking, not the compiler. Here, we hack it to use the compiler
   # because we want to use -fsanitize flags.
 
-  # Only add CMAKE_EXE_LINKER_FLAGS when in a standalone bulid.
+  # Only add CMAKE_EXE_LINKER_FLAGS when in a standalone build.
   # Or else CMAKE_EXE_LINKER_FLAGS contains flags for build compiler of Clang/llvm.
   # This might not be the same as what the COMPILER_RT_TEST_COMPILER supports.
   # eg: the build compiler use lld linker and we build clang with default ld linker
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 379e2c25949cb..966a084a535dc 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -213,7 +213,7 @@ macro(detect_target_arch)
     elseif(CMAKE_SIZEOF_VOID_P EQUAL "8")
       add_default_target_arch(riscv64)
     else()
-      message(FATAL_ERROR "Unsupport XLEN for RISC-V")
+      message(FATAL_ERROR "Unsupported XLEN for RISC-V")
     endif()
   elseif(__S390X)
     add_default_target_arch(s390x)
diff --git a/compiler-rt/include/profile/InstrProfData.inc b/compiler-rt/include/profile/InstrProfData.inc
index 2cdfea9a579a4..6d18680f89165 100644
--- a/compiler-rt/include/profile/InstrProfData.inc
+++ b/compiler-rt/include/profile/InstrProfData.inc
@@ -490,7 +490,7 @@ typedef struct ValueProfData {
 } ValueProfData;
 
 /*
- * The closure is designed to abstact away two types of value profile data:
+ * The closure is designed to abstract away two types of value profile data:
  * - InstrProfRecord which is the primary data structure used to
  *   represent profile data in host tools (reader, writer, and profile-use)
  * - value profile runtime data structure suitable to be used by C
diff --git a/compiler-rt/lib/asan/asan_activation.cpp b/compiler-rt/lib/asan/asan_activation.cpp
index 1757838600ca6..5796a7cb06eff 100644
--- a/compiler-rt/lib/asan/asan_activation.cpp
+++ b/compiler-rt/lib/asan/asan_activation.cpp
@@ -58,7 +58,7 @@ static struct AsanDeactivatedFlags {
     cf.verbosity = Verbosity();
     cf.help = false; // this is activation-specific help
 
-    // Check if activation flags need to be overriden.
+    // Check if activation flags need to be overridden.
     if (const char *env = GetEnv("ASAN_ACTIVATION_OPTIONS")) {
       parser.ParseString(env);
     }
diff --git a/compiler-rt/lib/asan/asan_flags.h b/compiler-rt/lib/asan/asan_flags.h
index b55c81f07d4bd..6f38a62a25d82 100644
--- a/compiler-rt/lib/asan/asan_flags.h
+++ b/compiler-rt/lib/asan/asan_flags.h
@@ -19,12 +19,12 @@
 
 // ASan flag values can be defined in four ways:
 // 1) initialized with default values at startup.
-// 2) overriden during compilation of ASan runtime by providing
+// 2) overridden during compilation of ASan runtime by providing
 //    compile definition ASAN_DEFAULT_OPTIONS.
-// 3) overriden from string returned by user-specified function
+// 3) overridden from string returned by user-specified function
 //    __asan_default_options().
-// 4) overriden from env variable ASAN_OPTIONS.
-// 5) overriden during ASan activation (for now used on Android only).
+// 4) overridden from env variable ASAN_OPTIONS.
+// 5) overridden during ASan activation (for now used on Android only).
 
 namespace __asan {
 
diff --git a/compiler-rt/lib/asan/asan_interceptors.cpp b/compiler-rt/lib/asan/asan_interceptors.cpp
index 247ea1b92f1f4..7c9a08b9083a2 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -826,7 +826,7 @@ void InitializeAsanInterceptors() {
   ASAN_INTERCEPT_FUNC(__isoc23_strtoll);
 #  endif
 
-  // Intecept jump-related functions.
+  // Intercept jump-related functions.
   ASAN_INTERCEPT_FUNC(longjmp);
 
 #  if ASAN_INTERCEPT_SWAPCONTEXT
diff --git a/compiler-rt/lib/asan/asan_report.cpp b/compiler-rt/lib/asan/asan_report.cpp
index 45aa607dcda07..6302866805f37 100644
--- a/compiler-rt/lib/asan/asan_report.cpp
+++ b/compiler-rt/lib/asan/asan_report.cpp
@@ -592,5 +592,5 @@ void __sanitizer_ptr_cmp(void *a, void *b) {
 } // extern "C"
 
 // Provide default implementation of __asan_on_error that does nothing
-// and may be overriden by user.
+// and may be overridden by user.
 SANITIZER_INTERFACE_WEAK_DEF(void, __asan_on_error, void) {}
diff --git a/compiler-rt/lib/memprof/memprof_flags.h b/compiler-rt/lib/memprof/memprof_flags.h
index 4dd395a6be94a..72701d14fbd8d 100644
--- a/compiler-rt/lib/memprof/memprof_flags.h
+++ b/compiler-rt/lib/memprof/memprof_flags.h
@@ -18,7 +18,7 @@
 #include "sanitizer_common/sanitizer_internal_defs.h"
 
 // Default MemProf flags are defined in memprof_flags.inc and sancov_flags.inc.
-// These values can be overridded in a number of ways, each option overrides the
+// These values can be overridden in a number of ways, each option overrides the
 // prior one:
 //  1) by setting MEMPROF_DEFAULT_OPTIONS during the compilation of the MemProf
 //     runtime
diff --git a/compiler-rt/lib/profile/InstrProfiling.h b/compiler-rt/lib/profile/InstrProfiling.h
index a90558fdcfbbf..8791d5aa5dd70 100644
--- a/compiler-rt/lib/profile/InstrProfiling.h
+++ b/compiler-rt/lib/profile/InstrProfiling.h
@@ -277,7 +277,7 @@ uint64_t __llvm_profile_get_vtable_section_size(const VTableProfData *Begin,
 
 /* ! \brief Given the sizes of the data and counter information, computes the
  * number of padding bytes before and after the counter section, as well as the
- * number of padding bytes after other setions in the raw profile.
+ * number of padding bytes after other sections in the raw profile.
  * Returns -1 upon errors and 0 upon success. Output parameters should be used
  * iff return value is 0.
  *
@@ -302,7 +302,7 @@ int __llvm_profile_get_padding_sizes_for_counters(
 void __llvm_profile_set_dumped(void);
 
 /*!
- * \brief Write custom target-specific profiling data to a seperate file.
+ * \brief Write custom target-specific profiling data to a separate file.
  * Used by offload PGO.
  */
 int __llvm_write_custom_profile(const char *Target,
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 47ec4158551c5..d98298b69ecdb 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -234,7 +234,7 @@ COMPILER_RT_VISIBILITY extern int64_t INSTR_PROF_PROFILE_BITMAP_BIAS_VAR
 #endif
 static const int ContinuousModeSupported = 1;
 static const int UseBiasVar = 1;
-/* TODO: If there are two DSOs, the second DSO initilization will truncate the
+/* TODO: If there are two DSOs, the second DSO initialization will truncate the
  * first profile file. */
 static const char *FileOpenMode = "w+b";
 /* This symbol is defined by the compiler when runtime counter relocation is
@@ -438,7 +438,7 @@ static int mmapProfileForMerging(FILE *ProfileFile, uint64_t ProfileFileSize,
 }
 
 /* Read profile data in \c ProfileFile and merge with in-memory
-   profile counters. Returns -1 if there is fatal error, otheriwse
+   profile counters. Returns -1 if there is fatal error, otheriwise
    0 is returned. Returning 0 does not mean merge is actually
    performed. If merge is actually done, *MergeDone is set to 1.
 */
@@ -850,8 +850,9 @@ static int parseFilenamePattern(const char *FilenamePat,
         __llvm_profile_set_page_size(getpagesize());
         __llvm_profile_enable_continuous_mode();
 #else
-        PROF_WARN("%s", "Continous mode is currently only supported for Mach-O,"
-                        " ELF and COFF formats.");
+        PROF_WARN("%s",
+                  "Continuous mode is currently only supported for Mach-O,"
+                  " ELF and COFF formats.");
         return -1;
 #endif
       } else {
diff --git a/compiler-rt/lib/profile/InstrProfilingInternal.h b/compiler-rt/lib/profile/InstrProfilingInternal.h
index 03df71828b91d..5647782527eb7 100644
--- a/compiler-rt/lib/profile/InstrProfilingInternal.h
+++ b/compiler-rt/lib/profile/InstrProfilingInternal.h
@@ -128,7 +128,7 @@ typedef struct VPDataReaderType {
                            uint8_t *SiteCountArray[]);
   /* Function pointer to getValueProfRecordHeader method. */
   uint32_t (*GetValueProfRecordHeaderSize)(uint32_t NumSites);
-  /* Function pointer to getFristValueProfRecord method. */  
+  /* Function pointer to getFirstValueProfRecord method. */
   struct ValueProfRecord *(*GetFirstValueProfRecord)(struct ValueProfData *);
   /* Return the number of value data for site \p Site.  */
   uint32_t (*GetNumValueDataForSite)(uint32_t VK, uint32_t Site);
diff --git a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
index 37aa7b11a231a..1342eae927794 100644
--- a/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp
@@ -1,4 +1,4 @@
-// Check that UAR mode can handle very deep recusrion.
+// Check that UAR mode can handle very deep recursion.
 // REQUIRES: shell
 // RUN: %clangxx_asan -O2 %s -o %t
 // RUN: ulimit -s 4096
diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp
index 3d95a4ba273db..b109a3a23ea5b 100644
--- a/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp
@@ -71,7 +71,7 @@ void recursive_func(uintptr_t parent_frame_address) {
   z13 = t13;
 #else
   char buf[BS];
-  // Check that the stack grows in the righ direction, unless we use fake stack.
+  // Check that the stack grows in the right direction, unless we use fake stack.
   assert(parent_frame_address > (uintptr_t)__builtin_frame_address(0));
   buf[rand() % BS] = 1;
   buf[rand() % BS] = 2;
diff --git a/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp b/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
index 4688079dfe6fb..27d7f8c4fcb24 100644
--- a/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
+++ b/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cpp
@@ -2,7 +2,7 @@
 // RUN: %clangxx_asan -O3 -mllvm -asan-instrument-dynamic-allocas %s -o %t
 // RUN: %run %t 2>&1
 //
-// MSVC does not support asan-instrament-dynamic-allocas yet
+// MSVC does not support asan-instrument-dynamic-allocas yet
 // UNSUPPORTED: msvc
 
 #include "sanitizer/asan_interface.h"
diff --git a/compiler-rt/test/metadata/lit.cfg.py b/compiler-rt/test/metadata/lit.cfg.py
index a66e01e483d77..73ba27ad3a4e2 100644
--- a/compiler-rt/test/metadata/lit.cfg.py
+++ b/compiler-rt/test/metadata/lit.cfg.py
@@ -3,7 +3,7 @@
 config.name = "SanitizerBinaryMetadata"
 config.test_source_root = os.path.dirname(__file__)
 config.suffixes = [".cpp"]
-# Binary metadata is currently emited only for ELF binaries
+# Binary metadata is currently emitted only for ELF binaries
 # and sizes of stack arguments depend on the arch.
 if config.host_os not in ["Linux"] or config.target_arch not in ["x86_64"]:
     config.unsupported = True
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
index e68e93129be2f..ffe2100634f57 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
@@ -17,7 +17,7 @@
 // UBSan does not install a malloc zone.
 // XFAIL: ubsan
 //
-// Curently fails on darwin/lsan rdar://145873843
+// Currently fails on darwin/lsan rdar://145873843
 // XFAIL: darwin && lsan
 
 #include <malloc/malloc.h>
diff --git a/compiler-rt/test/tsan/Darwin/no_call_setenv_in_symbolize.cpp b/compiler-rt/test/tsan/Darwin/no_call_setenv_in_symbolize.cpp
index 1e31693cc74d5..b91357c0a0a4f 100644
--- a/compiler-rt/test/tsan/Darwin/no_call_setenv_in_symbolize.cpp
+++ b/compiler-rt/test/tsan/Darwin/no_call_setenv_in_symbolize.cpp
@@ -1,6 +1,6 @@
 // RUN: %clangxx_tsan -O1 %s -o %t
 // `handle_sigbus=0` is required because when the rdar://problem/58789439 bug was
-// present TSan's runtime could derefence bad memory leading to SIGBUS being raised.
+// present TSan's runtime could dereference bad memory leading to SIGBUS being raised.
 // If the signal was caught TSan would deadlock because it would try to run the
 // symbolizer again.
 // RUN: %env_tsan_opts=handle_sigbus=0,symbolize=1 %run %t 2>&1 | FileCheck %s
diff --git a/compiler-rt/test/tsan/Linux/clone_setns.cpp b/compiler-rt/test/tsan/Linux/clone_setns.cpp
index 1bd812ff6b6a7..26bc15bea9349 100644
--- a/compiler-rt/test/tsan/Linux/clone_setns.cpp
+++ b/compiler-rt/test/tsan/Linux/clone_setns.cpp
@@ -2,7 +2,7 @@
 
 // The test models how sandbox2 unshares user namespace after clone:
 // https://github.com/google/sandboxed-api/blob/c95837a6c131fbdf820db352a97d54fcbcbde6c0/sandboxed_api/sandbox2/forkserver.cc#L249
-// which works only in sigle-threaded processes.
+// which works only in single-threaded processes.
 
 #include "../test.h"
 #include <errno.h>
diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc
index 2cdfea9a579a4..6d18680f89165 100644
--- a/llvm/include/llvm/ProfileData/InstrProfData.inc
+++ b/llvm/include/llvm/ProfileData/InstrProfData.inc
@@ -490,7 +490,7 @@ typedef struct ValueProfData {
 } ValueProfData;
 
 /*
- * The closure is designed to abstact away two types of value profile data:
+ * The closure is designed to abstract away two types of value profile data:
  * - InstrProfRecord which is the primary data structure used to
  *   represent profile data in host tools (reader, writer, and profile-use)
  * - value profile runtime data structure suitable to be used by C



More information about the llvm-commits mailing list