summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_win.cc
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vlad@tsyrklevich.net>2019-03-02 00:46:54 +0000
committerVlad Tsyrklevich <vlad@tsyrklevich.net>2019-03-02 00:46:54 +0000
commit9d0e6a411b76b0ef05f56c0ad939f6340aeb055b (patch)
tree6235d6bcdf1fc9c50bac275e96a7d826f6ad9dc2 /lib/sanitizer_common/sanitizer_win.cc
parent5dd3aa7c8f550754b2a1a2240cd62010373de6e2 (diff)
downloadcompiler-rt-9d0e6a411b76b0ef05f56c0ad939f6340aeb055b.tar.gz
Revert "Revert "[sanitizers] Don't use Windows Trace Logging on MinGW""
This reverts my orignal revert in r355250, I misread the buildbot logs. Volodymyr's commit in r355244 fixed the build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_win.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_win.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_win.cc b/lib/sanitizer_common/sanitizer_win.cc
index 95d3a3fcc..457cecb8c 100644
--- a/lib/sanitizer_common/sanitizer_win.cc
+++ b/lib/sanitizer_common/sanitizer_win.cc
@@ -20,7 +20,6 @@
#include <io.h>
#include <psapi.h>
#include <stdlib.h>
-#include <TraceLoggingProvider.h>
#include "sanitizer_common.h"
#include "sanitizer_file.h"
@@ -32,6 +31,8 @@
#if defined(PSAPI_VERSION) && PSAPI_VERSION == 1
#pragma comment(lib, "psapi")
#endif
+#if SANITIZER_WIN_TRACE
+#include <traceloggingprovider.h>
// Windows trace logging provider init
#pragma comment(lib, "advapi32.lib")
TRACELOGGING_DECLARE_PROVIDER(g_asan_provider);
@@ -39,6 +40,9 @@ TRACELOGGING_DECLARE_PROVIDER(g_asan_provider);
TRACELOGGING_DEFINE_PROVIDER(g_asan_provider, "AddressSanitizerLoggingProvider",
(0x6c6c766d, 0x3846, 0x4e6a, 0xa4, 0xfb, 0x5b,
0x53, 0x0b, 0xd0, 0xf3, 0xfa));
+#else
+#define TraceLoggingUnregister(x)
+#endif
// 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
@@ -1080,6 +1084,7 @@ u32 GetNumberOfCPUs() {
return sysinfo.dwNumberOfProcessors;
}
+#if SANITIZER_WIN_TRACE
// TODO(mcgov): Rename this project-wide to PlatformLogInit
void AndroidLogInit(void) {
HRESULT hr = TraceLoggingRegister(g_asan_provider);
@@ -1103,6 +1108,7 @@ void LogFullErrorReport(const char *buffer) {
TraceLoggingValue(buffer, "AsanReportContents"));
}
}
+#endif // SANITIZER_WIN_TRACE
} // namespace __sanitizer