aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2020-12-11 12:15:53 -0600
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2020-12-11 15:11:44 -0600
commit2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c (patch)
treeacd317518a0e1f0e2e00c5b0732bc6de643ba63e
parentb5ad32ef5c68c8c6ebf16f1955ea884421b3750e (diff)
downloadllvm-2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c.zip
llvm-2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c.tar.gz
llvm-2d8cc5479b9e9eb96a0e7f70f473c03b82f4084c.tar.bz2
[Hexagon] Workaround for compilation error with VS2017
-rw-r--r--llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp10
1 files changed, 9 insertions, 1 deletions
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<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);