Author: Peiyuan Song Date: 2020-08-05T19:53:00+02:00 New Revision: a862618aab2551540e175dff3a6a1d1d7c4b4a29
URL: https://github.com/llvm/llvm-project/commit/a862618aab2551540e175dff3a6a1d1d7c4b4a29 DIFF: https://github.com/llvm/llvm-project/commit/a862618aab2551540e175dff3a6a1d1d7c4b4a29.diff LOG: [compiler-rt] [profile] fix profile generate for mingw x86_64 Differential Revision: https://reviews.llvm.org/D84757 (cherry picked from commit 14c1b4017422cbf374086ea4c4fa74e16fb56779) Added: Modified: compiler-rt/lib/profile/CMakeLists.txt compiler-rt/lib/profile/InstrProfilingPort.h Removed: ################################################################################ diff --git a/compiler-rt/lib/profile/CMakeLists.txt b/compiler-rt/lib/profile/CMakeLists.txt index ece674b2daa1..29c6c02f2d03 100644 --- a/compiler-rt/lib/profile/CMakeLists.txt +++ b/compiler-rt/lib/profile/CMakeLists.txt @@ -1,11 +1,11 @@ CHECK_CXX_SOURCE_COMPILES(" -#ifdef _MSC_VER -#include <Intrin.h> /* Workaround for PR19898. */ +#ifdef _WIN32 +#include <intrin.h> /* Workaround for PR19898. */ #include <windows.h> #endif int main() { -#ifdef _MSC_VER +#ifdef _WIN32 volatile LONG val = 1; MemoryBarrier(); InterlockedCompareExchange(&val, 0, 1); diff --git a/compiler-rt/lib/profile/InstrProfilingPort.h b/compiler-rt/lib/profile/InstrProfilingPort.h index 20cf5d660c6a..4493dd512ff0 100644 --- a/compiler-rt/lib/profile/InstrProfilingPort.h +++ b/compiler-rt/lib/profile/InstrProfilingPort.h @@ -53,9 +53,9 @@ #endif #if COMPILER_RT_HAS_ATOMICS == 1 -#ifdef _MSC_VER +#ifdef _WIN32 #include <windows.h> -#if _MSC_VER < 1900 +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif #if defined(_WIN64) @@ -73,7 +73,7 @@ (DomType *)InterlockedExchangeAdd((LONG volatile *)&PtrVar, \ (LONG)sizeof(DomType) * PtrIncr) #endif -#else /* !defined(_MSC_VER) */ +#else /* !defined(_WIN32) */ #define COMPILER_RT_BOOL_CMPXCHG(Ptr, OldV, NewV) \ __sync_bool_compare_and_swap(Ptr, OldV, NewV) #define COMPILER_RT_PTR_FETCH_ADD(DomType, PtrVar, PtrIncr) \ _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
