From 2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Fri, 11 Dec 2020 12:15:53 -0600 Subject: [PATCH] [Hexagon] Workaround for compilation error with VS2017 --- llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp index 7791fb9..cee620e 100644 --- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp +++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp @@ -292,8 +292,16 @@ template <> StoreInst *isCandidate(Instruction *In) { return getIfUnordered(dyn_cast(In)); } +#if !defined(_MSC_VER) || _MSC_VER >= 1920 +// VS2017 has trouble compiling this: +// error C2976: 'std::map': too few template arguments template -void erase_if(std::map &map, Pred p) { +void erase_if(std::map &map, Pred p) +#else +template +void erase_if(std::map &map, Pred p) +#endif +{ for (auto i = map.begin(), e = map.end(); i != e;) { if (p(*i)) i = map.erase(i); -- 2.7.4