summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StringMap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add some __builtin_expect magic to StringMap.Benjamin Kramer2012-08-291-4/+5
| | | | | | | | | Tombstones and full hash collisions are rare, mark the "empty" and "no collision" paths as likely. The bug in simplifycfg that prevented the hints from being picked during selfhost up was fixed recently :) llvm-svn: 162874
* Fix PR13148, an inf-loop in StringMap.Chandler Carruth2012-06-191-1/+1
| | | | | | | | | | | | | | | StringMap suffered from the same bug as DenseMap: when you explicitly construct it with a small number of buckets, you can arrange for the tombstone-based growth path to be followed when the number of buckets was less than '8'. In that case, even with a full map, it would compare '0' as not less than '0', and refuse to grow the table, leading to inf-loops trying to find an empty bucket on the next insertion. The fix is very simple: use '<=' as the comparison. The same fix was applied to DenseMap as well during its recent refactoring. Thanks to Alex Bolz for the great report and test case. =] llvm-svn: 158725
* Switch StringMap from an array of structures to a structure of arrays.Benjamin Kramer2011-12-271-27/+34
| | | | | | | - -25% memory usage of the main table on x86_64 (was wasted in struct padding). - no significant performance change. llvm-svn: 147294
* Reset StringMap's NumTombstones on clears and rehashes.Jakob Stoklund Olesen2011-03-301-0/+3
| | | | | | | | | | | | | 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
* Prevent infinite growth of SmallMap instances.Jakob Stoklund Olesen2011-03-301-1/+13
| | | | | | | | Rehash but don't grow when full of tombstones. Patch by José Fonseca! llvm-svn: 128565
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-1/+1
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* Pass StringRef by value.Daniel Dunbar2009-11-061-3/+3
| | | | llvm-svn: 86251
* Move StringMap's string has function into StringExtras.hDaniel Dunbar2009-10-171-16/+3
| | | | llvm-svn: 84344
* Convert StringMap to using StringRef for its APIs.Daniel Dunbar2009-07-231-16/+10
| | | | | | | | | | | | - 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
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* stringmap memory managed with malloc nowChris Lattner2007-04-041-1/+1
| | | | llvm-svn: 35666
* use calloc instead of new/memset, it is more efficientChris Lattner2007-04-041-4/+2
| | | | llvm-svn: 35644
* Extend StringMap to support being initialized as completely empty. WhenChris Lattner2007-04-041-2/+22
| | | | | | initialized this way, they do not do a malloc to allocate their buckets. llvm-svn: 35642
* greatly reduce hte default size of stringmap.Chris Lattner2007-04-031-1/+1
| | | | llvm-svn: 35632
* Add support for removing elements out of StringMap.Chris Lattner2007-02-111-11/+52
| | | | llvm-svn: 34185
* Replace the ugly FindValue method with STL-like find methods.Chris Lattner2007-02-111-0/+43
| | | | llvm-svn: 34183
* remove support for stringmap visitors now that iterators exist.Chris Lattner2007-02-111-13/+0
| | | | llvm-svn: 34180
* add support for iterators.Chris Lattner2007-02-111-2/+9
| | | | llvm-svn: 34179
* Rename CStringMap -> StringMap, since it now supports nul characters in theChris Lattner2007-02-081-0/+138
strings. llvm-svn: 34064
OpenPOWER on IntegriCloud