diff options
author | Marcos Pividori <mpividori@google.com> | 2017-01-20 21:09:36 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-01-20 21:09:36 +0000 |
commit | b69e84dee887092596a6b9037b7ae71a5c4879ad (patch) | |
tree | 9abe49b1ea00593ed1dfbdd9135f4e81785f0a4e /lib/sanitizer_common/sanitizer_win.cc | |
parent | 3c3e150467551cde5760652ccff0c46a3fdba3c0 (diff) | |
download | compiler-rt-b69e84dee887092596a6b9037b7ae71a5c4879ad.tar.gz |
[sanitizer] [asan] Use macros to simplify weak aliases on Windows.
This patch adds some useful macros for dealing with pragma directives on
Windows. Also, I add appropriate documentation for future users.
Differential Revision: https://reviews.llvm.org/D28525
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_win.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_win.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sanitizer_common/sanitizer_win.cc b/lib/sanitizer_common/sanitizer_win.cc index 9682d2921..645041d5a 100644 --- a/lib/sanitizer_common/sanitizer_win.cc +++ b/lib/sanitizer_common/sanitizer_win.cc @@ -30,6 +30,7 @@ #include "sanitizer_procmaps.h" #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" +#include "sanitizer_win_defs.h" // A macro to tell the compiler that this part of the code cannot be reached, // if the compiler supports this feature. Since we're using this in @@ -946,11 +947,8 @@ void GetMemoryProfile(fill_profile_f cb, uptr *stats, uptr stats_size) { } // of null. extern "C" void __sanitizer_print_memory_profile(int top_percent) {} -#ifdef _WIN64 -#pragma comment(linker, "/alternatename:__sanitizer_print_memory_profile=__sanitizer_default_print_memory_profile") // NOLINT -#else -#pragma comment(linker, "/alternatename:___sanitizer_print_memory_profile=___sanitizer_default_print_memory_profile") // NOLINT -#endif +WIN_WEAK_ALIAS(__sanitizer_print_memory_profile, + __sanitizer_default_print_memory_profile) #endif #endif // _WIN32 |