[compiler-rt] 3378912 - [NFC][tsan] Add include guards

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 16:00:01 PDT 2023


Author: Vitaly Buka
Date: 2023-03-20T15:59:49-07:00
New Revision: 33789125ca384c27d408cd0c2ecf2c03bb23f610

URL: https://github.com/llvm/llvm-project/commit/33789125ca384c27d408cd0c2ecf2c03bb23f610
DIFF: https://github.com/llvm/llvm-project/commit/33789125ca384c27d408cd0c2ecf2c03bb23f610.diff

LOG: [NFC][tsan] Add include guards

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/print_address.h
    compiler-rt/test/tsan/java.h
    compiler-rt/test/tsan/test.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/print_address.h b/compiler-rt/test/sanitizer_common/print_address.h
index 1128c928b0534..df31322246a08 100644
--- a/compiler-rt/test/sanitizer_common/print_address.h
+++ b/compiler-rt/test/sanitizer_common/print_address.h
@@ -1,6 +1,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#ifndef __SANITIZER_COMMON_PRINT_ADDRESS_H__
+#  define __SANITIZER_COMMON_PRINT_ADDRESS_H__
+
 void print_address(const char *str, int n, ...) {
   fprintf(stderr, "%s", str);
   va_list ap;
@@ -21,3 +24,5 @@ void print_address(const char *str, int n, ...) {
   }
   fprintf(stderr, "\n");
 }
+
+#endif // __SANITIZER_COMMON_PRINT_ADDRESS_H__
\ No newline at end of file

diff  --git a/compiler-rt/test/tsan/java.h b/compiler-rt/test/tsan/java.h
index 9df7fb6f9fcc2..b6a71292ced92 100644
--- a/compiler-rt/test/tsan/java.h
+++ b/compiler-rt/test/tsan/java.h
@@ -1,3 +1,6 @@
+#ifndef __TSAN_JAVA_H__
+#define __TSAN_JAVA_H__
+
 #include "test.h"
 
 extern "C" {
@@ -27,3 +30,5 @@ void __tsan_func_exit();
 }
 
 const jptr kExternalPCBit = 1ULL << 60;
+
+#endif // __TSAN_JAVA_H__
\ No newline at end of file

diff  --git a/compiler-rt/test/tsan/test.h b/compiler-rt/test/tsan/test.h
index efd66cbf91a43..7406318243c57 100644
--- a/compiler-rt/test/tsan/test.h
+++ b/compiler-rt/test/tsan/test.h
@@ -1,3 +1,6 @@
+#ifndef __TSAN_TEST_H__
+#define __TSAN_TEST_H__
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -133,3 +136,5 @@ void WTFAnnotateBenignRaceSized(const char *f, int l, const volatile void *mem,
 #else
 #define ASM_SYMBOL(symbol) #symbol
 #endif
+
+#endif // __TSAN_TEST_H__


        


More information about the llvm-commits mailing list