Benjamin Kramer
77f9c9f719
Switch StringMap from an array of structures to a structure of arrays.
...
- -25% memory usage of the main table on x86_64 (was wasted in struct padding).
- no significant performance change.
llvm-svn: 147294
2011-12-27 20:35:07 +00:00
Jakob Stoklund Olesen
37134e568d
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!
llvm-svn: 128567
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
0daa5f56cb
Prevent infinite growth of SmallMap instances.
...
Rehash but don't grow when full of tombstones.
Patch by José Fonseca!
llvm-svn: 128565
2011-03-30 18:32:44 +00:00
Jeffrey Yasskin
a199652a3e
Change all self assignments X=X to (void)X, so that we can turn on a
...
new gcc warning that complains on self-assignments and
self-initializations.
llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Daniel Dunbar
4daaf9d3f4
Pass StringRef by value.
...
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Daniel Dunbar
0107265e33
Move StringMap's string has function into StringExtras.h
...
llvm-svn: 84344
2009-10-17 18:21:06 +00:00
Daniel Dunbar
b5adc13728
Convert StringMap to using StringRef for its APIs.
...
- Yay for '-'s and simplifications!
- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.
- NIFC.
llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
ed593d6789
stringmap memory managed with malloc now
...
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Chris Lattner
8a4ca643dd
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
dbf6a79a71
Extend StringMap to support being initialized as completely empty. When
...
initialized this way, they do not do a malloc to allocate their buckets.
llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Chris Lattner
59994ede6b
greatly reduce hte default size of stringmap.
...
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Chris Lattner
ce3f5f906a
Add support for removing elements out of StringMap.
...
llvm-svn: 34185
2007-02-11 20:58:00 +00:00
Chris Lattner
3a9d38035f
Replace the ugly FindValue method with STL-like find methods.
...
llvm-svn: 34183
2007-02-11 19:49:41 +00:00
Chris Lattner
f1e2e9e259
remove support for stringmap visitors now that iterators exist.
...
llvm-svn: 34180
2007-02-11 08:22:15 +00:00
Chris Lattner
e98f4bc0ce
add support for iterators.
...
llvm-svn: 34179
2007-02-11 08:20:35 +00:00
Chris Lattner
d16cc5ebcb
Rename CStringMap -> StringMap, since it now supports nul characters in the
...
strings.
llvm-svn: 34064
2007-02-08 19:20:57 +00:00