Skip to content

Commit 8891267

Browse files
committed
[asan][NFCI] Rename asan_(malloc_)?linux.cpp to ...unix.cpp
asan_(malloc_)?linux.cpp are misleadingly named because they cover many non-Linux OSes, such as BSDs, Fuchsia and Solaris. This is a footgun where changes may be made to these files without remembering it is not Linux-specific (e.g., I broke the Solaris build - see llvm#131975 (comment)). This patch mitigates the issue by renaming the file from ...linux to ...unix, which should hopefully give pause to anyone (me) when making Linux-specific changes.
1 parent adb5775 commit 8891267

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

compiler-rt/lib/asan/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ set(ASAN_SOURCES
1313
asan_globals_win.cpp
1414
asan_interceptors.cpp
1515
asan_interceptors_memintrinsics.cpp
16-
asan_linux.cpp
1716
asan_mac.cpp
18-
asan_malloc_linux.cpp
1917
asan_malloc_mac.cpp
18+
asan_malloc_unix.cpp
2019
asan_malloc_win.cpp
2120
asan_memory_profile.cpp
2221
asan_poisoning.cpp
@@ -29,6 +28,7 @@ set(ASAN_SOURCES
2928
asan_stats.cpp
3029
asan_suppressions.cpp
3130
asan_thread.cpp
31+
asan_unix.cpp
3232
asan_win.cpp
3333
)
3434

compiler-rt/lib/asan/asan_malloc_linux.cpp renamed to compiler-rt/lib/asan/asan_malloc_unix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- asan_malloc_linux.cpp ---------------------------------------------===//
1+
//===-- asan_malloc_unix.cpp ----------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -8,7 +8,7 @@
88
//
99
// This file is a part of AddressSanitizer, an address sanity checker.
1010
//
11-
// Linux-specific malloc interception.
11+
// Unix-like-specific malloc interception.
1212
// We simply define functions like malloc, free, realloc, etc.
1313
// They will replace the corresponding libc functions automagically.
1414
//===----------------------------------------------------------------------===//

compiler-rt/lib/asan/asan_linux.cpp renamed to compiler-rt/lib/asan/asan_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- asan_linux.cpp ----------------------------------------------------===//
1+
//===-- asan_unix.cpp -----------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

llvm/utils/gn/secondary/compiler-rt/lib/asan/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ if (current_toolchain == host_toolchain) {
3333
"asan_interface.inc",
3434
"asan_interface_internal.h",
3535
"asan_internal.h",
36-
"asan_linux.cpp",
3736
"asan_mac.cpp",
38-
"asan_malloc_linux.cpp",
3937
"asan_malloc_mac.cpp",
38+
"asan_malloc_unix.cpp",
4039
"asan_malloc_win.cpp",
4140
"asan_mapping.h",
4241
"asan_memory_profile.cpp",
@@ -58,6 +57,7 @@ if (current_toolchain == host_toolchain) {
5857
"asan_suppressions.h",
5958
"asan_thread.cpp",
6059
"asan_thread.h",
60+
"asan_unix.cpp",
6161
"asan_win.cpp",
6262
]
6363
if (current_os != "mac" && current_os != "win") {

0 commit comments

Comments
 (0)