summaryrefslogtreecommitdiff
path: root/legacy/llvm8/scc-insertion.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-22 01:36:05 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-22 03:14:38 -0600
commitcd50a82701f113f26b14850cca88291e77f0a44b (patch)
treeef3682081a25f1359cdb40a6c0a399f6d61aa3c0 /legacy/llvm8/scc-insertion.patch
parentbdd71ef51bdd0b679a1384d3d8cce744ab2c9cc0 (diff)
downloadpackages-cd50a82701f113f26b14850cca88291e77f0a44b.tar.gz
packages-cd50a82701f113f26b14850cca88291e77f0a44b.tar.bz2
packages-cd50a82701f113f26b14850cca88291e77f0a44b.tar.xz
packages-cd50a82701f113f26b14850cca88291e77f0a44b.zip
user/llvm8: Move to legacy/
We don't need LLVM 8 in-tree any more. The last dependent was Qt Creator. LLVM 14 is the new hotness. Closes: #460, #871
Diffstat (limited to 'legacy/llvm8/scc-insertion.patch')
-rw-r--r--legacy/llvm8/scc-insertion.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/legacy/llvm8/scc-insertion.patch b/legacy/llvm8/scc-insertion.patch
new file mode 100644
index 000000000..b2d7d511a
--- /dev/null
+++ b/legacy/llvm8/scc-insertion.patch
@@ -0,0 +1,33 @@
+From f7e9f4f4c50245d10ca9869a9f8f3d431dfb6948 Mon Sep 17 00:00:00 2001
+From: Warren Ristow <warren_ristow@playstation.sony.com>
+Date: Tue, 14 Jan 2020 10:30:24 -0800
+Subject: [PATCH] SCC: Allow ReplaceNode to safely support insertion
+
+If scc_iterator::ReplaceNode is inserting a new entry in the map,
+rather than replacing an existing entry, the possibility of growing
+the map could cause a failure. This change safely implements the
+insertion.
+
+Reviewed By: probinson
+
+Differential Revision: https://reviews.llvm.org/D72469
+---
+ include/llvm/ADT/SCCIterator.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h
+index eb1a5d0938cf..1e642b9f75d3 100644
+--- a/include/llvm/ADT/SCCIterator.h
++++ b/include/llvm/ADT/SCCIterator.h
+@@ -134,7 +134,10 @@ class scc_iterator : public iterator_facade_base<
+ /// has been deleted, and \c New is to be used in its place.
+ void ReplaceNode(NodeRef Old, NodeRef New) {
+ assert(nodeVisitNumbers.count(Old) && "Old not in scc_iterator?");
+- nodeVisitNumbers[New] = nodeVisitNumbers[Old];
++ // Do the assignment in two steps, in case 'New' is not yet in the map, and
++ // inserting it causes the map to grow.
++ auto tempVal = nodeVisitNumbers[Old];
++ nodeVisitNumbers[New] = tempVal;
+ nodeVisitNumbers.erase(Old);
+ }
+ };