[compiler-rt] ddac31c - Cleanup for final comment on https://reviews.llvm.org/D103304
Kevin Athey via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 9 13:47:18 PDT 2021
Author: Kevin Athey
Date: 2021-06-09T13:47:12-07:00
New Revision: ddac31c59342a8a7304c759e7b32280386530132
URL: https://github.com/llvm/llvm-project/commit/ddac31c59342a8a7304c759e7b32280386530132
DIFF: https://github.com/llvm/llvm-project/commit/ddac31c59342a8a7304c759e7b32280386530132.diff
LOG: Cleanup for final comment on https://reviews.llvm.org/D103304
Consolidate DEFINE_STACK_MALLOC to simplify.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D103965
Added:
Modified:
compiler-rt/lib/asan/asan_fake_stack.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_fake_stack.cpp b/compiler-rt/lib/asan/asan_fake_stack.cpp
index 486ba194a3cc..bf5c342ee59d 100644
--- a/compiler-rt/lib/asan/asan_fake_stack.cpp
+++ b/compiler-rt/lib/asan/asan_fake_stack.cpp
@@ -239,19 +239,18 @@ static ALWAYS_INLINE void OnFree(uptr ptr, uptr class_id, uptr size) {
// ---------------------- Interface ---------------- {{{1
using namespace __asan;
-#define DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(class_id) \
- extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr \
- __asan_stack_malloc_##class_id(uptr size) { \
- return OnMalloc(class_id, size); \
- } \
- extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_stack_free_##class_id( \
- uptr ptr, uptr size) { \
- OnFree(ptr, class_id, size); \
- }
-#define DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(class_id) \
- extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr \
- __asan_stack_malloc_always_##class_id(uptr size) { \
- return OnMallocAlways(class_id, size); \
+#define DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(class_id) \
+ extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr \
+ __asan_stack_malloc_##class_id(uptr size) { \
+ return OnMalloc(class_id, size); \
+ } \
+ extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr \
+ __asan_stack_malloc_always_##class_id(uptr size) { \
+ return OnMallocAlways(class_id, size); \
+ } \
+ extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __asan_stack_free_##class_id( \
+ uptr ptr, uptr size) { \
+ OnFree(ptr, class_id, size); \
}
DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(0)
@@ -266,18 +265,6 @@ DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(8)
DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(9)
DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID(10)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(0)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(1)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(2)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(3)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(4)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(5)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(6)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(7)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(8)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(9)
-DEFINE_STACK_MALLOC_ALWAYS_WITH_CLASS_ID(10)
-
extern "C" {
// TODO: remove this method and fix tests that use it by setting
// -asan-use-after-return=never, after modal UAR flag lands
More information about the llvm-commits
mailing list