From: JF Bastien Date: Fri, 2 Aug 2019 22:02:25 +0000 (+0000) Subject: Revert "Remove support for unsupported MSVC versions" X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21d01ea9b6f106371a131fd4676e798ff6382aab;p=platform%2Fupstream%2Fllvm.git Revert "Remove support for unsupported MSVC versions" Mismatched preprocessor, I'll fix in a follow-up. llvm-svn: 367728 --- diff --git a/llvm/include/llvm/Demangle/DemangleConfig.h b/llvm/include/llvm/Demangle/DemangleConfig.h index b7b7dbd..73f89d3 100644 --- a/llvm/include/llvm/Demangle/DemangleConfig.h +++ b/llvm/include/llvm/Demangle/DemangleConfig.h @@ -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 diff --git a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp index 7d0fa0f..4e0b858 100644 --- a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp +++ b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp @@ -73,7 +73,13 @@ static Error LoadDIA(CComPtr &DiaDataSource) { #if !defined(_MSC_VER) return llvm::make_error(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; diff --git a/llvm/lib/Support/Windows/explicit_symbols.inc b/llvm/lib/Support/Windows/explicit_symbols.inc index 0a4fda1..bbbf7ea 100644 --- a/llvm/lib/Support/Windows/explicit_symbols.inc +++ b/llvm/lib/Support/Windows/explicit_symbols.inc @@ -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