From 5e42afd688ae6bc0c72a719f0ed9d4a6a4d50ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Tue, 12 Jan 2016 00:00:14 +0200 Subject: [PATCH] Hotfix Visual Studio 2015 build issues https://llvm.org/bugs/show_bug.cgi?id=26087 and https://llvm.org/bugs/show_bug.cgi?id=26089. Closes https://github.com/kripken/emscripten/issues/4029. --- include/clang/ASTMatchers/ASTMatchersInternal.h | 8 ++++---- unittests/ASTMatchers/CMakeLists.txt | 5 +++++ unittests/Tooling/CMakeLists.txt | 5 +++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/clang/ASTMatchers/ASTMatchersInternal.h b/include/clang/ASTMatchers/ASTMatchersInternal.h index d49909183fd..1d1d7952c16 100644 --- a/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -560,10 +560,10 @@ bool matchesFirstInPointerRange(const MatcherT &Matcher, IteratorT Start, // Metafunction to determine if type T has a member called // getDecl. -#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(__clang__) -// For old versions of MSVC, we use a weird nonstandard __if_exists -// statement, since before MSVC2015, it was not standards-conformant -// enough to compile the usual code below. +#if defined(_MSC_VER) && !defined(__clang__) +// For MSVC, we use a weird nonstandard __if_exists statement, as it +// is not standards-conformant enough to properly compile the standard +// code below. (At least up through MSVC 2015 require this workaround) template struct has_getDecl { __if_exists(T::getDecl) { enum { value = 1 }; diff --git a/unittests/ASTMatchers/CMakeLists.txt b/unittests/ASTMatchers/CMakeLists.txt index 3ace9fe264b..fbcda4239b4 100644 --- a/unittests/ASTMatchers/CMakeLists.txt +++ b/unittests/ASTMatchers/CMakeLists.txt @@ -5,6 +5,11 @@ set(LLVM_LINK_COMPONENTS add_clang_unittest(ASTMatchersTests ASTMatchersTest.cpp) +# XXX Emscripten: Hotfix for bug https://llvm.org/bugs/show_bug.cgi?id=26089 +if (MSVC) + set_source_files_properties(ASTMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj) +endif() + target_link_libraries(ASTMatchersTests clangAST clangASTMatchers diff --git a/unittests/Tooling/CMakeLists.txt b/unittests/Tooling/CMakeLists.txt index 33b2046ae92..1eccd07b73a 100644 --- a/unittests/Tooling/CMakeLists.txt +++ b/unittests/Tooling/CMakeLists.txt @@ -19,6 +19,11 @@ add_clang_unittest(ToolingTests ReplacementsYamlTest.cpp ) +# XXX Emscripten: Hotfix for bug https://llvm.org/bugs/show_bug.cgi?id=26089 +if (MSVC) + set_source_files_properties(RecursiveASTVisitorTestExprVisitor.cpp PROPERTIES COMPILE_FLAGS /bigobj) +endif() + target_link_libraries(ToolingTests clangAST clangASTMatchers