From effbb65875f3e89e3af05f47f03ba362635e81f1 Mon Sep 17 00:00:00 2001 From: Qinkun Bao Date: Fri, 28 Mar 2025 13:15:27 -0700 Subject: [PATCH] Revert "Fix some small typos in compiler-rt. NFC (#133388)" This reverts commit 45b9e24b1ea8f34230cb2a746d624bd7e64e484b. --- 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, 26 insertions(+), 27 deletions(-) diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index d346b0ec01b03..c3e734f72392f 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 build. + # Only add CMAKE_EXE_LINKER_FLAGS when in a standalone bulid. # 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 966a084a535dc..379e2c25949cb 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 "Unsupported XLEN for RISC-V") + message(FATAL_ERROR "Unsupport 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 6d18680f89165..2cdfea9a579a4 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 abstract away two types of value profile data: + * The closure is designed to abstact 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 5796a7cb06eff..1757838600ca6 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 overridden. + // Check if activation flags need to be overriden. 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 6f38a62a25d82..b55c81f07d4bd 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) overridden during compilation of ASan runtime by providing +// 2) overriden during compilation of ASan runtime by providing // compile definition ASAN_DEFAULT_OPTIONS. -// 3) overridden from string returned by user-specified function +// 3) overriden from string returned by user-specified function // __asan_default_options(). -// 4) overridden from env variable ASAN_OPTIONS. -// 5) overridden during ASan activation (for now used on Android only). +// 4) overriden from env variable ASAN_OPTIONS. +// 5) overriden 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 7c9a08b9083a2..247ea1b92f1f4 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 - // Intercept jump-related functions. + // Intecept 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 6302866805f37..45aa607dcda07 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 overridden by user. +// and may be overriden 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 72701d14fbd8d..4dd395a6be94a 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 overridden in a number of ways, each option overrides the +// These values can be overridded 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 8791d5aa5dd70..a90558fdcfbbf 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 sections in the raw profile. + * number of padding bytes after other setions 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 separate file. + * \brief Write custom target-specific profiling data to a seperate 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 e6bab9533146b..47ec4158551c5 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 initialization will truncate the +/* TODO: If there are two DSOs, the second DSO initilization 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, otherwise + profile counters. Returns -1 if there is fatal error, otheriwse 0 is returned. Returning 0 does not mean merge is actually performed. If merge is actually done, *MergeDone is set to 1. */ @@ -850,9 +850,8 @@ static int parseFilenamePattern(const char *FilenamePat, __llvm_profile_set_page_size(getpagesize()); __llvm_profile_enable_continuous_mode(); #else - PROF_WARN("%s", - "Continuous mode is currently only supported for Mach-O," - " ELF and COFF formats."); + PROF_WARN("%s", "Continous 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 5647782527eb7..03df71828b91d 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 getFirstValueProfRecord method. */ + /* Function pointer to getFristValueProfRecord 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 1342eae927794..37aa7b11a231a 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 recursion. +// Check that UAR mode can handle very deep recusrion. // 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 b109a3a23ea5b..3d95a4ba273db 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 right direction, unless we use fake stack. + // Check that the stack grows in the righ 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 27d7f8c4fcb24..4688079dfe6fb 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-instrument-dynamic-allocas yet +// MSVC does not support asan-instrament-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 73ba27ad3a4e2..a66e01e483d77 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 emitted only for ELF binaries +# Binary metadata is currently emited 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 ffe2100634f57..e68e93129be2f 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 // -// Currently fails on darwin/lsan rdar://145873843 +// Curently fails on darwin/lsan rdar://145873843 // XFAIL: darwin && lsan #include 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 b91357c0a0a4f..1e31693cc74d5 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 dereference bad memory leading to SIGBUS being raised. +// present TSan's runtime could derefence 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 26bc15bea9349..1bd812ff6b6a7 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 single-threaded processes. +// which works only in sigle-threaded processes. #include "../test.h" #include diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc index 6d18680f89165..2cdfea9a579a4 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 abstract away two types of value profile data: + * The closure is designed to abstact 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