[Build][NFC] Fixes for building on Windows with libc++
authorAndrew Ng <andrew.ng@sony.com>
Thu, 23 Jun 2022 14:16:48 +0000 (15:16 +0100)
committerAndrew Ng <andrew.ng@sony.com>
Fri, 1 Jul 2022 14:37:57 +0000 (15:37 +0100)
Differential Revision: https://reviews.llvm.org/D128514

llvm/include/llvm/Support/RWMutex.h
llvm/lib/Support/NativeFormatting.cpp
llvm/tools/llvm-exegesis/lib/X86/Target.cpp

index 33a5d3e..3dd9625 100644 (file)
@@ -93,8 +93,8 @@ private:
 /// running in multithreaded mode.
 template <bool mt_only> class SmartRWMutex {
   // shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14)
-  // on Windows and always available on MSVC.
-#if defined(_MSC_VER) || __cplusplus > 201402L
+  // on Windows and always available on MSVC except with libc++.
+#if (defined(_MSC_VER) && !defined(_LIBCPP_VERSION)) || __cplusplus > 201402L
   std::shared_mutex impl;
 #else
 #if !defined(LLVM_USE_RW_MUTEX_IMPL)
index 9597132..8a69f75 100644 (file)
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
 
+#if defined(_WIN32) && !defined(__MINGW32__)
+#include <float.h> // For _fpclass in llvm::write_double.
+#endif
+
 using namespace llvm;
 
 template<typename T, std::size_t N>
index 9d3fe2d..2f82759 100644 (file)
@@ -31,6 +31,9 @@
 #include <immintrin.h>
 #include <intrin.h>
 #endif
+#if defined(__x86_64__) && defined(_MSC_VER)
+#include <float.h> // For _clearfp in ~X86SavedState().
+#endif
 
 namespace llvm {
 namespace exegesis {