Reset StringMap's NumTombstones on clears and rehashes.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 30 Mar 2011 18:32:51 +0000 (18:32 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 30 Mar 2011 18:32:51 +0000 (18:32 +0000)
commit03ef44991768b803ed5b210877ce0d83bf16fd93
tree6efc42db0cf9cbf4c60113e3f5262c55fe54ab8e
parente10fff6f8802d6ab4045d9d0bb22e6f37e6d3d0b
Reset StringMap's NumTombstones on clears and rehashes.

StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128567 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringMap.h
lib/Support/StringMap.cpp