Author: Krzysztof Parzyszek Date: 2020-12-11T15:11:44-06:00 New Revision: 2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c
URL: https://github.com/llvm/llvm-project/commit/2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c DIFF: https://github.com/llvm/llvm-project/commit/2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c.diff LOG: [Hexagon] Workaround for compilation error with VS2017 Added: Modified: llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp Removed: ################################################################################ diff --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp index 7791fb9a1a74..cee620e03b00 100644 --- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp +++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp @@ -292,8 +292,16 @@ template <> StoreInst *isCandidate<StoreInst>(Instruction *In) { return getIfUnordered(dyn_cast<StoreInst>(In)); } +#if !defined(_MSC_VER) || _MSC_VER >= 1920 +// VS2017 has trouble compiling this: +// error C2976: 'std::map': too few template arguments template <typename Pred, typename... Ts> -void erase_if(std::map<Ts...> &map, Pred p) { +void erase_if(std::map<Ts...> &map, Pred p) +#else +template <typename Pred, typename T, typename U> +void erase_if(std::map<T, U> &map, Pred p) +#endif +{ for (auto i = map.begin(), e = map.end(); i != e;) { if (p(*i)) i = map.erase(i); _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits