From e0a234029b1b65f21169536f4c45e83743ed3cfa Mon Sep 17 00:00:00 2001
From: Jeffrey Yasskin
Date: Thu, 22 Oct 2009 20:10:20 +0000
Subject: Add a ValueMap type. ValueMap is
safe to use even when keys get RAUWed and deleted during its lifetime. By
default the keys act like WeakVHs, but users can pass a third template
parameter to configure how updates work and whether to do anything beyond
updating the map on each action.
It's also possible to automatically acquire a lock around ValueMap updates
triggered by RAUWs and deletes, to support the ExecutionEngine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84890 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/ProgrammersManual.html | 18 ++
include/llvm/ADT/ValueMap.h | 365 +++++++++++++++++++++++++++++++++++++
include/llvm/Support/type_traits.h | 9 +
unittests/ADT/ValueMapTest.cpp | 291 +++++++++++++++++++++++++++++
4 files changed, 683 insertions(+)
create mode 100644 include/llvm/ADT/ValueMap.h
create mode 100644 unittests/ADT/ValueMapTest.cpp
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index 68367de..e4e3dc2 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -83,6 +83,7 @@ option
"llvm/ADT/StringMap.h"
"llvm/ADT/IndexedMap.h"
"llvm/ADT/DenseMap.h"
+ "llvm/ADT/ValueMap.h"
<map>
Other Map-Like Container Options
@@ -1492,6 +1493,23 @@ inserted into the map) that it needs internally.
+
+
+ValueMap is a wrapper around a DenseMap mapping
+Value*s (or subclasses) to another type. When a Value is deleted or RAUW'ed,
+ValueMap will update itself so the new version of the key is mapped to the same
+value, just as if the key were a WeakVH. You can configure exactly how this
+happens, and what else happens on these two events, by passing
+a Config
parameter to the ValueMap template.
+
+
+
+
+