X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FImmutableSet.h;h=be274dbe6758ce18fbdfb540c187996fee0536df;hb=670031666cf4dea0d122a0df2ec1d18822c225e4;hp=ba1262b077c31f1724ebf8a6fa79a207609bdef1;hpb=085a9ebbc705c6e7d3fd8c692ef1c46fdfb885ce;p=oota-llvm.git diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h index ba1262b077c..be274dbe675 100644 --- a/include/llvm/ADT/ImmutableSet.h +++ b/include/llvm/ADT/ImmutableSet.h @@ -86,6 +86,15 @@ public: return NULL; } + + /// getMaxElement - Find the subtree associated with the highest ranged + /// key value. + ImutAVLTree* getMaxElement() { + ImutAVLTree *T = this; + ImutAVLTree *Right = T->getRight(); + while (Right) { T = Right; Right = T->getRight(); } + return T; + } /// size - Returns the number of nodes in the tree, which includes /// both leaves and non-leaf nodes.