[compiler-rt] [ASan][Windows] Add __cdecl to public sanitizer functions (PR #69625)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 11:40:28 PDT 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff e87cdda35e062f39e72b5912a255821bf002041d da8510c99b3295d764865671918d699fd7acd97f -- compiler-rt/include/sanitizer/allocator_interface.h compiler-rt/include/sanitizer/asan_interface.h compiler-rt/include/sanitizer/common_interface_defs.h compiler-rt/include/sanitizer/coverage_interface.h compiler-rt/include/sanitizer/dfsan_interface.h compiler-rt/include/sanitizer/hwasan_interface.h compiler-rt/include/sanitizer/lsan_interface.h compiler-rt/include/sanitizer/memprof_interface.h compiler-rt/include/sanitizer/msan_interface.h compiler-rt/include/sanitizer/scudo_interface.h compiler-rt/include/sanitizer/tsan_interface.h compiler-rt/include/sanitizer/tsan_interface_atomic.h compiler-rt/include/sanitizer/ubsan_interface.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/include/sanitizer/allocator_interface.h b/compiler-rt/include/sanitizer/allocator_interface.h
index a1c14d8cd9c2..19af06969e08 100644
--- a/compiler-rt/include/sanitizer/allocator_interface.h
+++ b/compiler-rt/include/sanitizer/allocator_interface.h
@@ -67,7 +67,7 @@ size_t SANITIZER_CDECL __sanitizer_get_unmapped_bytes(void);
__sanitizer_free_hook(ptr) is called immediately before
deallocation of "ptr". */
void SANITIZER_CDECL __sanitizer_malloc_hook(const volatile void *ptr,
- size_t size);
+ size_t size);
void SANITIZER_CDECL __sanitizer_free_hook(const volatile void *ptr);
/* Installs a pair of hooks for malloc/free.
diff --git a/compiler-rt/include/sanitizer/asan_interface.h b/compiler-rt/include/sanitizer/asan_interface.h
index 5505922c61df..de3ea3ddb440 100644
--- a/compiler-rt/include/sanitizer/asan_interface.h
+++ b/compiler-rt/include/sanitizer/asan_interface.h
@@ -32,7 +32,7 @@ extern "C" {
/// \param addr Start of memory region.
/// \param size Size of memory region.
void SANITIZER_CDECL __asan_poison_memory_region(void const volatile *addr,
- size_t size);
+ size_t size);
/// Marks a memory region (<c>[addr, addr+size)</c>) as addressable.
///
@@ -47,7 +47,7 @@ void SANITIZER_CDECL __asan_poison_memory_region(void const volatile *addr,
/// \param addr Start of memory region.
/// \param size Size of memory region.
void SANITIZER_CDECL __asan_unpoison_memory_region(void const volatile *addr,
- size_t size);
+ size_t size);
// Macros provided for convenience.
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
@@ -193,9 +193,9 @@ const char *SANITIZER_CDECL __asan_get_report_description(void);
///
/// \returns Returns the category of the given pointer as a constant string.
const char *SANITIZER_CDECL __asan_locate_address(void *addr, char *name,
- size_t name_size,
- void **region_address,
- size_t *region_size);
+ size_t name_size,
+ void **region_address,
+ size_t *region_size);
/// Gets the allocation stack trace and thread ID for a heap address (useful
/// for calling from the debugger).
@@ -210,7 +210,7 @@ const char *SANITIZER_CDECL __asan_locate_address(void *addr, char *name,
///
/// \returns Returns the number of stored frames or 0 on error.
size_t SANITIZER_CDECL __asan_get_alloc_stack(void *addr, void **trace,
- size_t size, int *thread_id);
+ size_t size, int *thread_id);
/// Gets the free stack trace and thread ID for a heap address (useful for
/// calling from the debugger).
@@ -225,7 +225,7 @@ size_t SANITIZER_CDECL __asan_get_alloc_stack(void *addr, void **trace,
///
/// \returns Returns the number of stored frames or 0 on error.
size_t SANITIZER_CDECL __asan_get_free_stack(void *addr, void **trace,
- size_t size, int *thread_id);
+ size_t size, int *thread_id);
/// Gets the current shadow memory mapping (useful for calling from the
/// debugger).
@@ -233,7 +233,7 @@ size_t SANITIZER_CDECL __asan_get_free_stack(void *addr, void **trace,
/// \param[out] shadow_scale Shadow scale value.
/// \param[out] shadow_offset Offset value.
void SANITIZER_CDECL __asan_get_shadow_mapping(size_t *shadow_scale,
- size_t *shadow_offset);
+ size_t *shadow_offset);
/// This is an internal function that is called to report an error. However,
/// it is still a part of the interface because you might want to set a
@@ -246,8 +246,8 @@ void SANITIZER_CDECL __asan_get_shadow_mapping(size_t *shadow_scale,
/// \param is_write True if the error is a write error; false otherwise.
/// \param access_size Size of the memory access of the ASan error.
void SANITIZER_CDECL __asan_report_error(void *pc, void *bp, void *sp,
- void *addr, int is_write,
- size_t access_size);
+ void *addr, int is_write,
+ size_t access_size);
// Deprecated. Call __sanitizer_set_death_callback instead.
void SANITIZER_CDECL __asan_set_death_callback(void (*callback)(void));
@@ -310,9 +310,8 @@ void *SANITIZER_CDECL __asan_get_current_fake_stack(void);
/// \param[out] beg Beginning of fake frame.
/// \param[out] end End of fake frame.
/// \returns Stack address or NULL.
-void *SANITIZER_CDECL __asan_addr_is_in_fake_stack(void *fake_stack,
- void *addr, void **beg,
- void **end);
+void *SANITIZER_CDECL __asan_addr_is_in_fake_stack(void *fake_stack, void *addr,
+ void **beg, void **end);
/// Performs shadow memory cleanup of the current thread's stack before a
/// function marked with the <c>[[noreturn]]</c> attribute is called.
diff --git a/compiler-rt/include/sanitizer/common_interface_defs.h b/compiler-rt/include/sanitizer/common_interface_defs.h
index 0ce0970dcd1c..0bbade454244 100644
--- a/compiler-rt/include/sanitizer/common_interface_defs.h
+++ b/compiler-rt/include/sanitizer/common_interface_defs.h
@@ -215,8 +215,8 @@ void SANITIZER_CDECL __sanitizer_annotate_double_ended_contiguous_container(
/// \returns True if the contiguous container <c>[beg, end)</c> is properly
/// poisoned.
int SANITIZER_CDECL __sanitizer_verify_contiguous_container(const void *beg,
- const void *mid,
- const void *end);
+ const void *mid,
+ const void *end);
/// Returns true if the double ended contiguous
/// container <c>[storage_beg, storage_end)</c> is properly poisoned.
@@ -286,13 +286,13 @@ void SANITIZER_CDECL __sanitizer_print_stack_trace(void);
// The format syntax is described in
// lib/sanitizer_common/sanitizer_stacktrace_printer.h.
void SANITIZER_CDECL __sanitizer_symbolize_pc(void *pc, const char *fmt,
- char *out_buf,
- size_t out_buf_size);
+ char *out_buf,
+ size_t out_buf_size);
// Same as __sanitizer_symbolize_pc, but for data section (i.e. globals).
void SANITIZER_CDECL __sanitizer_symbolize_global(void *data_ptr,
- const char *fmt,
- char *out_buf,
- size_t out_buf_size);
+ const char *fmt,
+ char *out_buf,
+ size_t out_buf_size);
// Determine the return address.
#if !defined(_MSC_VER) || defined(__clang__)
#define __sanitizer_return_address() \
@@ -325,9 +325,9 @@ void SANITIZER_CDECL __sanitizer_set_death_callback(void (*callback)(void));
/// \param n Number of bytes to compare.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_memcmp(void *called_pc,
- const void *s1,
- const void *s2, size_t n,
- int result);
+ const void *s1,
+ const void *s2, size_t n,
+ int result);
/// Interceptor hook for <c>strncmp()</c>.
///
@@ -337,9 +337,9 @@ void SANITIZER_CDECL __sanitizer_weak_hook_memcmp(void *called_pc,
/// \param n Number of bytes to compare.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_strncmp(void *called_pc,
- const char *s1,
- const char *s2, size_t n,
- int result);
+ const char *s1,
+ const char *s2, size_t n,
+ int result);
/// Interceptor hook for <c>strncasecmp()</c>.
///
@@ -349,9 +349,9 @@ void SANITIZER_CDECL __sanitizer_weak_hook_strncmp(void *called_pc,
/// \param n Number of bytes to compare.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_strncasecmp(void *called_pc,
- const char *s1,
- const char *s2,
- size_t n, int result);
+ const char *s1,
+ const char *s2, size_t n,
+ int result);
/// Interceptor hook for <c>strcmp()</c>.
///
@@ -360,8 +360,8 @@ void SANITIZER_CDECL __sanitizer_weak_hook_strncasecmp(void *called_pc,
/// \param s2 Pointer to block of memory.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_strcmp(void *called_pc,
- const char *s1,
- const char *s2, int result);
+ const char *s1,
+ const char *s2, int result);
/// Interceptor hook for <c>strcasecmp()</c>.
///
@@ -370,9 +370,9 @@ void SANITIZER_CDECL __sanitizer_weak_hook_strcmp(void *called_pc,
/// \param s2 Pointer to block of memory.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_strcasecmp(void *called_pc,
- const char *s1,
- const char *s2,
- int result);
+ const char *s1,
+ const char *s2,
+ int result);
/// Interceptor hook for <c>strstr()</c>.
///
@@ -381,19 +381,18 @@ void SANITIZER_CDECL __sanitizer_weak_hook_strcasecmp(void *called_pc,
/// \param s2 Pointer to block of memory.
/// \param result Value returned by the intercepted function.
void SANITIZER_CDECL __sanitizer_weak_hook_strstr(void *called_pc,
- const char *s1,
- const char *s2,
- char *result);
+ const char *s1,
+ const char *s2, char *result);
void SANITIZER_CDECL __sanitizer_weak_hook_strcasestr(void *called_pc,
- const char *s1,
- const char *s2,
- char *result);
+ const char *s1,
+ const char *s2,
+ char *result);
void SANITIZER_CDECL __sanitizer_weak_hook_memmem(void *called_pc,
- const void *s1, size_t len1,
- const void *s2, size_t len2,
- void *result);
+ const void *s1, size_t len1,
+ const void *s2, size_t len2,
+ void *result);
// Prints stack traces for all live heap allocations ordered by total
// allocation size until top_percent of total live heap is shown. top_percent
@@ -431,8 +430,8 @@ void SANITIZER_CDECL __sanitizer_print_memory_profile(
/// \param bottom Bottom address of stack.
/// \param size Size of stack in bytes.
void SANITIZER_CDECL __sanitizer_start_switch_fiber(void **fake_stack_save,
- const void *bottom,
- size_t size);
+ const void *bottom,
+ size_t size);
/// Notify ASan that a fiber switch has completed (required only if
/// implementing your own fiber library).
@@ -446,8 +445,8 @@ void SANITIZER_CDECL __sanitizer_start_switch_fiber(void **fake_stack_save,
/// \param[out] bottom_old Bottom address of old stack.
/// \param[out] size_old Size of old stack in bytes.
void SANITIZER_CDECL __sanitizer_finish_switch_fiber(void *fake_stack_save,
- const void **bottom_old,
- size_t *size_old);
+ const void **bottom_old,
+ size_t *size_old);
// Get full module name and calculate pc offset within it.
// Returns 1 if pc belongs to some module, 0 if module was not found.
diff --git a/compiler-rt/include/sanitizer/coverage_interface.h b/compiler-rt/include/sanitizer/coverage_interface.h
index d80cf25cd07c..6235dfc2d4ba 100644
--- a/compiler-rt/include/sanitizer/coverage_interface.h
+++ b/compiler-rt/include/sanitizer/coverage_interface.h
@@ -27,7 +27,7 @@ void SANITIZER_CDECL __sanitizer_cov_reset(void);
// Dump collected coverage info. Sorts pcs by module into individual .sancov
// files.
void SANITIZER_CDECL __sanitizer_dump_coverage(const uintptr_t *pcs,
- uintptr_t len);
+ uintptr_t len);
#ifdef __cplusplus
} // extern "C"
diff --git a/compiler-rt/include/sanitizer/dfsan_interface.h b/compiler-rt/include/sanitizer/dfsan_interface.h
index f2f7c654f060..1084ec1f53cc 100644
--- a/compiler-rt/include/sanitizer/dfsan_interface.h
+++ b/compiler-rt/include/sanitizer/dfsan_interface.h
@@ -25,9 +25,8 @@ typedef uint8_t dfsan_label;
typedef uint32_t dfsan_origin;
/// Signature of the callback argument to dfsan_set_write_callback().
-typedef void (*SANITIZER_CDECL dfsan_write_callback_t)(int fd,
- const void *buf,
- size_t count);
+typedef void (*SANITIZER_CDECL dfsan_write_callback_t)(int fd, const void *buf,
+ size_t count);
/// Signature of the callback argument to dfsan_set_conditional_callback().
typedef void (*SANITIZER_CDECL dfsan_conditional_callback_t)(
@@ -44,12 +43,12 @@ dfsan_label SANITIZER_CDECL dfsan_union(dfsan_label l1, dfsan_label l2);
/// Sets the label for each address in [addr,addr+size) to \c label.
void SANITIZER_CDECL dfsan_set_label(dfsan_label label, void *addr,
- size_t size);
+ size_t size);
/// Sets the label for each address in [addr,addr+size) to the union of the
/// current label for that address and \c label.
void SANITIZER_CDECL dfsan_add_label(dfsan_label label, void *addr,
- size_t size);
+ size_t size);
/// Retrieves the label associated with the given data.
///
@@ -70,8 +69,8 @@ dfsan_label SANITIZER_CDECL dfsan_read_label(const void *addr, size_t size);
/// Return the origin associated with the first taint byte in the size bytes
/// from the address addr.
-dfsan_origin SANITIZER_CDECL
-dfsan_read_origin_of_first_taint(const void *addr, size_t size);
+dfsan_origin SANITIZER_CDECL dfsan_read_origin_of_first_taint(const void *addr,
+ size_t size);
/// Returns whether the given label contains the label elem.
int SANITIZER_CDECL dfsan_has_label(dfsan_label label, dfsan_label elem);
@@ -123,21 +122,21 @@ dfsan_label SANITIZER_CDECL dfsan_get_labels_in_signal_reaches_function();
/// needs to see the parameters of the function and the labels.
/// FIXME: implement more hooks.
void SANITIZER_CDECL dfsan_weak_hook_memcmp(void *caller_pc, const void *s1,
- const void *s2, size_t n,
- dfsan_label s1_label,
- dfsan_label s2_label,
- dfsan_label n_label);
+ const void *s2, size_t n,
+ dfsan_label s1_label,
+ dfsan_label s2_label,
+ dfsan_label n_label);
void SANITIZER_CDECL dfsan_weak_hook_strncmp(void *caller_pc, const char *s1,
- const char *s2, size_t n,
- dfsan_label s1_label,
- dfsan_label s2_label,
- dfsan_label n_label);
+ const char *s2, size_t n,
+ dfsan_label s1_label,
+ dfsan_label s2_label,
+ dfsan_label n_label);
/// Prints the origin trace of the label at the address addr to stderr. It also
/// prints description at the beginning of the trace. If origin tracking is not
/// on, or the address is not labeled, it prints nothing.
void SANITIZER_CDECL dfsan_print_origin_trace(const void *addr,
- const char *description);
+ const char *description);
/// As above, but use an origin id from dfsan_get_origin() instead of address.
/// Does not include header line with taint label and address information.
void SANITIZER_CDECL dfsan_print_origin_id_trace(dfsan_origin origin);
@@ -177,14 +176,14 @@ void SANITIZER_CDECL dfsan_print_origin_id_trace(dfsan_origin origin);
/// (not including trailing null byte '\0'). Thus, the string is truncated iff
/// return value is not less than \p out_buf_size.
size_t SANITIZER_CDECL dfsan_sprint_origin_trace(const void *addr,
- const char *description,
- char *out_buf,
- size_t out_buf_size);
+ const char *description,
+ char *out_buf,
+ size_t out_buf_size);
/// As above, but use an origin id from dfsan_get_origin() instead of address.
/// Does not include header line with taint label and address information.
size_t SANITIZER_CDECL dfsan_sprint_origin_id_trace(dfsan_origin origin,
- char *out_buf,
- size_t out_buf_size);
+ char *out_buf,
+ size_t out_buf_size);
/// Prints the stack trace leading to this call to a pre-allocated output
/// buffer.
@@ -198,7 +197,7 @@ size_t SANITIZER_CDECL dfsan_sprint_origin_id_trace(dfsan_origin origin,
/// (not including trailing null byte '\0'). Thus, the string is truncated iff
/// return value is not less than \p out_buf_size.
size_t SANITIZER_CDECL dfsan_sprint_stack_trace(char *out_buf,
- size_t out_buf_size);
+ size_t out_buf_size);
/// Retrieves the very first origin associated with the data at the given
/// address.
diff --git a/compiler-rt/include/sanitizer/hwasan_interface.h b/compiler-rt/include/sanitizer/hwasan_interface.h
index c24e15ed1f74..abe310c06669 100644
--- a/compiler-rt/include/sanitizer/hwasan_interface.h
+++ b/compiler-rt/include/sanitizer/hwasan_interface.h
@@ -38,11 +38,11 @@ void SANITIZER_CDECL __hwasan_disable_allocator_tagging(void);
// Mark region of memory with the given tag. Both address and size need to be
// 16-byte aligned.
void SANITIZER_CDECL __hwasan_tag_memory(const volatile void *p,
- unsigned char tag, size_t size);
+ unsigned char tag, size_t size);
/// Set pointer tag. Previous tag is lost.
void *SANITIZER_CDECL __hwasan_tag_pointer(const volatile void *p,
- unsigned char tag);
+ unsigned char tag);
// Set memory tag from the current SP address to the given address to zero.
// This is meant to annotate longjmp and other non-local jumps.
@@ -65,8 +65,7 @@ void SANITIZER_CDECL __hwasan_thread_exit();
// Print shadow and origin for the memory range to stderr in a human-readable
// format.
-void SANITIZER_CDECL __hwasan_print_shadow(const volatile void *x,
- size_t size);
+void SANITIZER_CDECL __hwasan_print_shadow(const volatile void *x, size_t size);
// Print one-line report about the memory usage of the current process.
void SANITIZER_CDECL __hwasan_print_memory_usage();
@@ -74,19 +73,18 @@ void SANITIZER_CDECL __hwasan_print_memory_usage();
/* Returns the offset of the first byte in the memory range that can not be
* accessed through the pointer in x, or -1 if the whole range is good. */
intptr_t SANITIZER_CDECL __hwasan_test_shadow(const volatile void *x,
- size_t size);
+ size_t size);
/* Sets the callback function to be called during HWASan error reporting. */
void SANITIZER_CDECL
__hwasan_set_error_report_callback(void (*callback)(const char *));
-int SANITIZER_CDECL __sanitizer_posix_memalign(void **memptr,
- size_t alignment, size_t size);
+int SANITIZER_CDECL __sanitizer_posix_memalign(void **memptr, size_t alignment,
+ size_t size);
void *SANITIZER_CDECL __sanitizer_memalign(size_t alignment, size_t size);
-void *SANITIZER_CDECL __sanitizer_aligned_alloc(size_t alignment,
- size_t size);
+void *SANITIZER_CDECL __sanitizer_aligned_alloc(size_t alignment, size_t size);
void *SANITIZER_CDECL __sanitizer___libc_memalign(size_t alignment,
- size_t size);
+ size_t size);
void *SANITIZER_CDECL __sanitizer_valloc(size_t size);
void *SANITIZER_CDECL __sanitizer_pvalloc(size_t size);
void SANITIZER_CDECL __sanitizer_free(void *ptr);
@@ -98,7 +96,7 @@ void SANITIZER_CDECL __sanitizer_malloc_stats(void);
void *SANITIZER_CDECL __sanitizer_calloc(size_t nmemb, size_t size);
void *SANITIZER_CDECL __sanitizer_realloc(void *ptr, size_t size);
void *SANITIZER_CDECL __sanitizer_reallocarray(void *ptr, size_t nmemb,
- size_t size);
+ size_t size);
void *SANITIZER_CDECL __sanitizer_malloc(size_t size);
#ifdef __cplusplus
} // extern "C"
diff --git a/compiler-rt/include/sanitizer/lsan_interface.h b/compiler-rt/include/sanitizer/lsan_interface.h
index 09c214db8d20..18f3456a126c 100644
--- a/compiler-rt/include/sanitizer/lsan_interface.h
+++ b/compiler-rt/include/sanitizer/lsan_interface.h
@@ -38,8 +38,7 @@ void SANITIZER_CDECL __lsan_ignore_object(const void *p);
// - the implementation is not optimized for performance. This interface is
// intended to be used for a small number of relatively static regions.
void SANITIZER_CDECL __lsan_register_root_region(const void *p, size_t size);
-void SANITIZER_CDECL __lsan_unregister_root_region(const void *p,
- size_t size);
+void SANITIZER_CDECL __lsan_unregister_root_region(const void *p, size_t size);
// Check for leaks now. This function behaves identically to the default
// end-of-process leak check. In particular, it will terminate the process if
diff --git a/compiler-rt/include/sanitizer/memprof_interface.h b/compiler-rt/include/sanitizer/memprof_interface.h
index 65798f4427a7..fe0a2fc5ef02 100644
--- a/compiler-rt/include/sanitizer/memprof_interface.h
+++ b/compiler-rt/include/sanitizer/memprof_interface.h
@@ -25,7 +25,7 @@ extern "C" {
/// \param addr Start of memory region.
/// \param size Size of memory region.
void SANITIZER_CDECL __memprof_record_access_range(void const volatile *addr,
- size_t size);
+ size_t size);
/// Records access to a memory address <c><i>addr</i></c>.
///
diff --git a/compiler-rt/include/sanitizer/msan_interface.h b/compiler-rt/include/sanitizer/msan_interface.h
index 94b45b5cacf3..459de8768948 100644
--- a/compiler-rt/include/sanitizer/msan_interface.h
+++ b/compiler-rt/include/sanitizer/msan_interface.h
@@ -20,7 +20,7 @@ extern "C" {
#endif
/* Set raw origin for the memory range. */
void SANITIZER_CDECL __msan_set_origin(const volatile void *a, size_t size,
- uint32_t origin);
+ uint32_t origin);
/* Get raw origin for an address. */
uint32_t SANITIZER_CDECL __msan_get_origin(const volatile void *a);
@@ -29,7 +29,7 @@ uint32_t SANITIZER_CDECL __msan_get_origin(const volatile void *a);
* "descendant" here means they are part of the same chain, created with
* __msan_chain_origin. */
int SANITIZER_CDECL __msan_origin_is_descendant_or_same(uint32_t this_id,
- uint32_t prev_id);
+ uint32_t prev_id);
/* Returns non-zero if tracking origins. */
int SANITIZER_CDECL __msan_get_track_origins(void);
@@ -55,17 +55,17 @@ void SANITIZER_CDECL __msan_poison(const volatile void *a, size_t size);
/* Make memory region partially uninitialized (without changing its contents).
*/
void SANITIZER_CDECL __msan_partial_poison(const volatile void *data,
- void *shadow, size_t size);
+ void *shadow, size_t size);
/* Returns the offset of the first (at least partially) poisoned byte in the
memory range, or -1 if the whole range is good. */
intptr_t SANITIZER_CDECL __msan_test_shadow(const volatile void *x,
- size_t size);
+ size_t size);
/* Checks that memory range is fully initialized, and reports an error if it
* is not. */
void SANITIZER_CDECL __msan_check_mem_is_initialized(const volatile void *x,
- size_t size);
+ size_t size);
/* For testing:
__msan_set_expect_umr(1);
@@ -93,15 +93,14 @@ int SANITIZER_CDECL __msan_has_dynamic_component(void);
/* Tell MSan about newly allocated memory (ex.: custom allocator).
Memory will be marked uninitialized, with origin at the call site. */
void SANITIZER_CDECL __msan_allocated_memory(const volatile void *data,
- size_t size);
+ size_t size);
/* Tell MSan about newly destroyed memory. Mark memory as uninitialized. */
void SANITIZER_CDECL __sanitizer_dtor_callback(const volatile void *data,
- size_t size);
-void SANITIZER_CDECL
-__sanitizer_dtor_callback_fields(const volatile void *data, size_t size);
-void SANITIZER_CDECL
-__sanitizer_dtor_callback_vptr(const volatile void *data);
+ size_t size);
+void SANITIZER_CDECL __sanitizer_dtor_callback_fields(const volatile void *data,
+ size_t size);
+void SANITIZER_CDECL __sanitizer_dtor_callback_vptr(const volatile void *data);
/* This function may be optionally provided by user and should return
a string containing Msan runtime options. See msan_flags.h for details. */
@@ -116,8 +115,7 @@ __msan_set_death_callback(void (*SANITIZER_CDECL callback)(void));
actual application memory, it only updates shadow and origin for such
copy. Source and destination regions can overlap. */
void SANITIZER_CDECL __msan_copy_shadow(const volatile void *dst,
- const volatile void *src,
- size_t size);
+ const volatile void *src, size_t size);
/* Disables uninitialized memory checks in interceptors. */
void SANITIZER_CDECL __msan_scoped_disable_interceptor_checks(void);
@@ -126,10 +124,9 @@ void SANITIZER_CDECL __msan_scoped_disable_interceptor_checks(void);
call to __msan_scoped_disable_interceptor_checks. */
void SANITIZER_CDECL __msan_scoped_enable_interceptor_checks(void);
-void SANITIZER_CDECL __msan_start_switch_fiber(const void *bottom,
- size_t size);
+void SANITIZER_CDECL __msan_start_switch_fiber(const void *bottom, size_t size);
void SANITIZER_CDECL __msan_finish_switch_fiber(const void **bottom_old,
- size_t *size_old);
+ size_t *size_old);
#ifdef __cplusplus
} // extern "C"
diff --git a/compiler-rt/include/sanitizer/tsan_interface.h b/compiler-rt/include/sanitizer/tsan_interface.h
index d7dd7bc5f0c9..3ef79ab81dd5 100644
--- a/compiler-rt/include/sanitizer/tsan_interface.h
+++ b/compiler-rt/include/sanitizer/tsan_interface.h
@@ -98,7 +98,7 @@ void SANITIZER_CDECL __tsan_mutex_pre_lock(void *addr, unsigned flags);
// - __tsan_mutex_recursive_lock
// - all mutex creation flags
void SANITIZER_CDECL __tsan_mutex_post_lock(void *addr, unsigned flags,
- int recursion);
+ int recursion);
// Annotate start of unlock operation.
// Supported flags:
@@ -139,12 +139,12 @@ void SANITIZER_CDECL __tsan_mutex_post_divert(void *addr, unsigned flags);
// - __tsan_external_assign_tag can optionally mark a heap object with a tag
void *SANITIZER_CDECL __tsan_external_register_tag(const char *object_type);
void SANITIZER_CDECL __tsan_external_register_header(void *tag,
- const char *header);
+ const char *header);
void SANITIZER_CDECL __tsan_external_assign_tag(void *addr, void *tag);
void SANITIZER_CDECL __tsan_external_read(void *addr, void *caller_pc,
- void *tag);
+ void *tag);
void SANITIZER_CDECL __tsan_external_write(void *addr, void *caller_pc,
- void *tag);
+ void *tag);
// Fiber switching API.
// - TSAN context for fiber can be created by __tsan_create_fiber
@@ -215,8 +215,8 @@ int SANITIZER_CDECL __tsan_get_report_data(
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_stack(void *report, unsigned long idx,
- void **trace,
- unsigned long trace_size);
+ void **trace,
+ unsigned long trace_size);
/// Returns information about memory operations included in the report.
///
@@ -231,10 +231,9 @@ int SANITIZER_CDECL __tsan_get_report_stack(void *report, unsigned long idx,
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_mop(void *report, unsigned long idx,
- int *tid, void **addr, int *size,
- int *write, int *atomic,
- void **trace,
- unsigned long trace_size);
+ int *tid, void **addr, int *size,
+ int *write, int *atomic, void **trace,
+ unsigned long trace_size);
/// Returns information about locations included in the report.
///
@@ -251,11 +250,11 @@ int SANITIZER_CDECL __tsan_get_report_mop(void *report, unsigned long idx,
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_loc(void *report, unsigned long idx,
- const char **type, void **addr,
- void **start, unsigned long *size,
- int *tid, int *fd,
- int *suppressable, void **trace,
- unsigned long trace_size);
+ const char **type, void **addr,
+ void **start, unsigned long *size,
+ int *tid, int *fd, int *suppressable,
+ void **trace,
+ unsigned long trace_size);
/// Returns information about mutexes included in the report.
///
@@ -268,9 +267,9 @@ int SANITIZER_CDECL __tsan_get_report_loc(void *report, unsigned long idx,
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_mutex(void *report, unsigned long idx,
- uint64_t *mutex_id, void **addr,
- int *destroyed, void **trace,
- unsigned long trace_size);
+ uint64_t *mutex_id, void **addr,
+ int *destroyed, void **trace,
+ unsigned long trace_size);
/// Returns information about threads included in the report.
///
@@ -285,10 +284,10 @@ int SANITIZER_CDECL __tsan_get_report_mutex(void *report, unsigned long idx,
/// \param trace_size Size in bytes of the trace buffer.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_thread(void *report, unsigned long idx,
- int *tid, uint64_t *os_id,
- int *running, const char **name,
- int *parent_tid, void **trace,
- unsigned long trace_size);
+ int *tid, uint64_t *os_id,
+ int *running, const char **name,
+ int *parent_tid, void **trace,
+ unsigned long trace_size);
/// Returns information about unique thread IDs included in the report.
///
@@ -297,7 +296,7 @@ int SANITIZER_CDECL __tsan_get_report_thread(void *report, unsigned long idx,
/// \param[out] tid Unique thread ID of the report.
/// \returns Returns 1 if successful, 0 if not.
int SANITIZER_CDECL __tsan_get_report_unique_tid(void *report,
- unsigned long idx, int *tid);
+ unsigned long idx, int *tid);
/// Returns the current report.
///
diff --git a/compiler-rt/include/sanitizer/tsan_interface_atomic.h b/compiler-rt/include/sanitizer/tsan_interface_atomic.h
index 89c1960f477d..de3a1c393609 100644
--- a/compiler-rt/include/sanitizer/tsan_interface_atomic.h
+++ b/compiler-rt/include/sanitizer/tsan_interface_atomic.h
@@ -56,21 +56,21 @@ __tsan_atomic128 SANITIZER_CDECL __tsan_atomic128_load(
#endif
void SANITIZER_CDECL __tsan_atomic8_store(volatile __tsan_atomic8 *a,
- __tsan_atomic8 v,
- __tsan_memory_order mo);
+ __tsan_atomic8 v,
+ __tsan_memory_order mo);
void SANITIZER_CDECL __tsan_atomic16_store(volatile __tsan_atomic16 *a,
- __tsan_atomic16 v,
- __tsan_memory_order mo);
+ __tsan_atomic16 v,
+ __tsan_memory_order mo);
void SANITIZER_CDECL __tsan_atomic32_store(volatile __tsan_atomic32 *a,
- __tsan_atomic32 v,
- __tsan_memory_order mo);
+ __tsan_atomic32 v,
+ __tsan_memory_order mo);
void SANITIZER_CDECL __tsan_atomic64_store(volatile __tsan_atomic64 *a,
- __tsan_atomic64 v,
- __tsan_memory_order mo);
+ __tsan_atomic64 v,
+ __tsan_memory_order mo);
#if __TSAN_HAS_INT128
void SANITIZER_CDECL __tsan_atomic128_store(volatile __tsan_atomic128 *a,
- __tsan_atomic128 v,
- __tsan_memory_order mo);
+ __tsan_atomic128 v,
+ __tsan_memory_order mo);
#endif
__tsan_atomic8 SANITIZER_CDECL __tsan_atomic8_exchange(
``````````
</details>
https://github.com/llvm/llvm-project/pull/69625
More information about the llvm-commits
mailing list