make traits more flexible by splitting out node-related fragment
[oota-llvm.git] / include / llvm / ADT / ImmutableMap.h
index 07cdb56a9ab0c08de4c5a27b6ac548f6c92ed4c4..52708bc8a10873ae2e11f9c08b5b60d46f5afc67 100644 (file)
@@ -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()->getValue()) : 0;
+  }
 
   //===--------------------------------------------------===//
   // Utility methods.