Skip to content

Commit

Permalink
[nsan] Use ALIGNED instead of alignas (NFC)
Browse files Browse the repository at this point in the history
When preceded by SANITIZER_INTERFACE_ATTRIBUTE, use the ALIGNED
macro instead of alignas, because clang 15 and older does not
support this. See https://clang.godbolt.org/z/Wj1193xWK.
  • Loading branch information
nikic committed Jul 15, 2024
1 parent 93d7d9b commit 2cc345d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler-rt/lib/nsan/nsan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,23 @@ __nsan_dump_shadow_mem(const u8 *addr, size_t size_bytes, size_t bytes_per_line,
}

SANITIZER_INTERFACE_ATTRIBUTE
alignas(16) thread_local uptr __nsan_shadow_ret_tag = 0;
ALIGNED(16) thread_local uptr __nsan_shadow_ret_tag = 0;

SANITIZER_INTERFACE_ATTRIBUTE
alignas(16) thread_local char __nsan_shadow_ret_ptr[kMaxVectorWidth *
sizeof(__float128)];
ALIGNED(16)
thread_local char __nsan_shadow_ret_ptr[kMaxVectorWidth * sizeof(__float128)];

SANITIZER_INTERFACE_ATTRIBUTE
alignas(16) thread_local uptr __nsan_shadow_args_tag = 0;
ALIGNED(16) thread_local uptr __nsan_shadow_args_tag = 0;

// Maximum number of args. This should be enough for anyone (tm). An alternate
// scheme is to have the generated code create an alloca and make
// __nsan_shadow_args_ptr point ot the alloca.
constexpr const int kMaxNumArgs = 128;
SANITIZER_INTERFACE_ATTRIBUTE
alignas(
16) thread_local char __nsan_shadow_args_ptr[kMaxVectorWidth * kMaxNumArgs *
sizeof(__float128)];
ALIGNED(16)
thread_local char __nsan_shadow_args_ptr[kMaxVectorWidth * kMaxNumArgs *
sizeof(__float128)];

enum ContinuationType { // Keep in sync with instrumentation pass.
kContinueWithShadow = 0,
Expand Down

0 comments on commit 2cc345d

Please sign in to comment.