aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ImmutableMap.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-23 17:27:18 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-23 17:27:18 +0000
commit1c7a666fcef22e75dc675b06444f5a894f54d7be (patch)
tree90c4ff8ee69fd5f82d5da3990050c96c09210365 /include/llvm/ADT/ImmutableMap.h
parente2abdd3ff0dd54a59edbd114ebb1d7728040a2d9 (diff)
downloadexternal_llvm-1c7a666fcef22e75dc675b06444f5a894f54d7be.zip
external_llvm-1c7a666fcef22e75dc675b06444f5a894f54d7be.tar.gz
external_llvm-1c7a666fcef22e75dc675b06444f5a894f54d7be.tar.bz2
Add ImmutableMap::getMaxElement(), a method that returns the <key,value> pair in a ImmutableMap that has the highest ranked key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ImmutableMap.h')
-rw-r--r--include/llvm/ADT/ImmutableMap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h
index 07cdb56..00d5902 100644
--- a/include/llvm/ADT/ImmutableMap.h
+++ b/include/llvm/ADT/ImmutableMap.h
@@ -202,6 +202,13 @@ public:
return 0;
}
+
+ /// getMaxElement - Returns the <key,value> pair in the ImmutableMap for
+ /// which key is the highest in the ordering of keys in the map. This
+ /// method returns NULL if the map is empty.
+ value_type* getMaxElement() const {
+ return Root ? &(Root->getMaxElement()) : 0;
+ }
//===--------------------------------------------------===//
// Utility methods.