[llvm] r367728 - Revert "Remove support for unsupported MSVC versions"
JF Bastien via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 15:02:25 PDT 2019
Author: jfb
Date: Fri Aug 2 15:02:25 2019
New Revision: 367728
URL: http://llvm.org/viewvc/llvm-project?rev=367728&view=rev
Log:
Revert "Remove support for unsupported MSVC versions"
Mismatched preprocessor, I'll fix in a follow-up.
Modified:
llvm/trunk/include/llvm/Demangle/DemangleConfig.h
llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp
llvm/trunk/lib/Support/Windows/explicit_symbols.inc
Modified: llvm/trunk/include/llvm/Demangle/DemangleConfig.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Demangle/DemangleConfig.h?rev=367728&r1=367727&r2=367728&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Demangle/DemangleConfig.h (original)
+++ llvm/trunk/include/llvm/Demangle/DemangleConfig.h Fri Aug 2 15:02:25 2019
@@ -15,6 +15,13 @@
#ifndef LLVM_DEMANGLE_COMPILER_H
#define LLVM_DEMANGLE_COMPILER_H
+#ifdef _MSC_VER
+// snprintf is implemented in VS 2015
+#if _MSC_VER < 1900
+#define snprintf _snprintf_s
+#endif
+#endif
+
#ifndef __has_feature
#define __has_feature(x) 0
#endif
Modified: llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp?rev=367728&r1=367727&r2=367728&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp Fri Aug 2 15:02:25 2019
@@ -73,7 +73,13 @@ static Error LoadDIA(CComPtr<IDiaDataSou
#if !defined(_MSC_VER)
return llvm::make_error<PDBError>(pdb_error_code::dia_failed_loading);
#else
- const wchar_t *msdia_dll = L"msdia140.dll";
+ const wchar_t *msdia_dll = nullptr;
+#if _MSC_VER >= 1900 && _MSC_VER < 2000
+ msdia_dll = L"msdia140.dll"; // VS2015
+#elif _MSC_VER >= 1800
+ msdia_dll = L"msdia120.dll"; // VS2013
+#else
+#error "Unknown Visual Studio version."
#endif
HRESULT HR;
Modified: llvm/trunk/lib/Support/Windows/explicit_symbols.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/explicit_symbols.inc?rev=367728&r1=367727&r2=367728&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/explicit_symbols.inc (original)
+++ llvm/trunk/lib/Support/Windows/explicit_symbols.inc Fri Aug 2 15:02:25 2019
@@ -90,6 +90,12 @@
INLINE_DEF_FLOAT_SYMBOL(tanf, 1)
INLINE_DEF_FLOAT_SYMBOL(tanhf, 1)
+ // These were added in VS 2013.
+#if (1800 <= _MSC_VER && _MSC_VER < 1900)
+ INLINE_DEF_FLOAT_SYMBOL(copysignf, 2)
+ INLINE_DEF_FLOAT_SYMBOL(fminf, 2)
+ INLINE_DEF_FLOAT_SYMBOL(fmaxf, 2)
+#endif
#undef INLINE_DEF_FLOAT_SYMBOL
#endif
More information about the llvm-commits
mailing list