[compiler-rt] [compiler-rt] using more precise type for the Linux's timerfd api int… (PR #77197)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 6 05:22:41 PST 2024


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 3fb0d8dc808cb7f315670d76109edc9c57cb3d90 6598044906c6c47691dc378b5412ed6d6b99dc14 -- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index a40a771bc3..5544fb9aeb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -6376,7 +6376,8 @@ INTERCEPTOR(char *, getpass, const char *prompt) {
 #endif
 
 #if SANITIZER_INTERCEPT_TIMERFD
-INTERCEPTOR(int, timerfd_settime, int fd, int flags, __sanitizer_itimerspec *new_value,
+INTERCEPTOR(int, timerfd_settime, int fd, int flags,
+            __sanitizer_itimerspec *new_value,
             __sanitizer_itimerspec *old_value) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, timerfd_settime, fd, flags, new_value,
@@ -6396,9 +6397,9 @@ INTERCEPTOR(int, timerfd_gettime, int fd, __sanitizer_itimerspec *curr_value) {
     COMMON_INTERCEPTOR_WRITE_RANGE(ctx, curr_value, struct_itimerspec_sz);
   return res;
 }
-#define INIT_TIMERFD                          \
-  COMMON_INTERCEPT_FUNCTION(timerfd_settime); \
-  COMMON_INTERCEPT_FUNCTION(timerfd_gettime);
+#  define INIT_TIMERFD                          \
+    COMMON_INTERCEPT_FUNCTION(timerfd_settime); \
+    COMMON_INTERCEPT_FUNCTION(timerfd_gettime);
 #else
 #define INIT_TIMERFD
 #endif
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
index 189bbfe728..a9c3356f40 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
@@ -51,9 +51,9 @@
 #  include <linux/aio_abi.h>
 
 #  if !SANITIZER_ANDROID
-#    include <sys/statfs.h>
 #    include <linux/perf_event.h>
 #    include <linux/time.h>
+#    include <sys/statfs.h>
 #  endif
 
 using namespace __sanitizer;
@@ -84,7 +84,7 @@ CHECK_SIZE_AND_OFFSET(perf_event_attr, type);
 CHECK_SIZE_AND_OFFSET(perf_event_attr, size);
 COMPILER_CHECK(sizeof(struct __sanitizer_itimerspec) ==
                sizeof(struct itimerspec));
-#endif
+#  endif
 
 COMPILER_CHECK(iocb_cmd_pread == IOCB_CMD_PREAD);
 COMPILER_CHECK(iocb_cmd_pwrite == IOCB_CMD_PWRITE);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index d0679b8ede..473ee19dd8 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -406,7 +406,7 @@ struct __sanitizer_timeb {
   short dstflag;
 };
 
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#  if SANITIZER_LINUX && !SANITIZER_ANDROID
 struct __sanitizer_timespec {
   __sanitizer_time_t tv_sec;
   long tv_nsec;
@@ -416,7 +416,7 @@ struct __sanitizer_itimerspec {
   struct __sanitizer_timespec it_interval;
   struct __sanitizer_timespec it_value;
 };
-#endif
+#  endif
 
 struct __sanitizer_ether_addr {
   u8 octet[6];

``````````

</details>


https://github.com/llvm/llvm-project/pull/77197


More information about the llvm-commits mailing list