llvm-project/compiler-rt/lib/lsan
Fangrui Song 2fec8860d8 [sanitizer] Set IndentPPDirectives: AfterHash in .clang-format
Code patterns like this are common, `#` at the line beginning
(https://google.github.io/styleguide/cppguide.html#Preprocessor_Directives),
one space indentation for if/elif/else directives.
```
#if SANITIZER_LINUX
# if defined(__aarch64__)
# endif
#endif
```

However, currently clang-format wants to reformat the code to
```
#if SANITIZER_LINUX
#if defined(__aarch64__)
#endif
#endif
```

This significantly harms readability in my review.  Use `IndentPPDirectives:
AfterHash` to defeat the diagnostic. clang-format will now suggest:

```
#if SANITIZER_LINUX
#  if defined(__aarch64__)
#  endif
#endif
```

Unfortunately there is no clang-format option using indent with 1 for
just preprocessor directives. However, this is still one step forward
from the current behavior.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D100238
2021-05-03 13:49:41 -07:00
..
.clang-format [sanitizer] Set IndentPPDirectives: AfterHash in .clang-format 2021-05-03 13:49:41 -07:00
CMakeLists.txt
lsan.cpp Revert "[sanitizer] Simplify GetTls with dl_iterate_phdr on Linux" 2021-04-05 19:00:18 -04:00
lsan.h
lsan_allocator.cpp
lsan_allocator.h
lsan_common.cpp
lsan_common.h sanitizer_common: introduce kInvalidTid/kMainTid 2021-04-30 15:58:05 +02:00
lsan_common_fuchsia.cpp
lsan_common_linux.cpp
lsan_common_mac.cpp
lsan_flags.inc
lsan_fuchsia.cpp
lsan_fuchsia.h
lsan_interceptors.cpp sanitizer_common: introduce kInvalidTid/kMainTid 2021-04-30 15:58:05 +02:00
lsan_linux.cpp
lsan_mac.cpp
lsan_malloc_mac.cpp
lsan_posix.cpp sanitizer_common: introduce kInvalidTid/kMainTid 2021-04-30 15:58:05 +02:00
lsan_posix.h
lsan_preinit.cpp
lsan_thread.cpp sanitizer_common: introduce kInvalidTid/kMainTid 2021-04-30 15:58:05 +02:00
lsan_thread.h
weak_symbols.txt