aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringMapTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-11-19Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie1-6/+4
Having two ways to do this doesn't seem terribly helpful and consistently using the insert version (which we already has) seems like it'll make the code easier to understand to anyone working with standard data structures. (I also updated many references to the Entry's key and value to use first() and second instead of getKey{Data,Length,} and get/setValue - for similar consistency) Also removes the GetOrCreateValue functions so there's less surface area to StringMap to fix/improve/change/accommodate move semantics, etc. llvm-svn: 222319
2014-11-14StringMap: Test and finish off supporting perfectly forwarded values in ↵David Blaikie1-1/+15
StringMap operations. Followup to r221946. llvm-svn: 221958
2014-06-23Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with ↵David Blaikie1-2/+40
private, but non-deleted, move members. Certain versions of GCC (~4.7) couldn't handle the SFINAE on access control, but with "= delete" (hidden behind a macro for portability) this issue is worked around/addressed. Patch by Agustín Bergé llvm-svn: 211525
2014-06-20Revert "Add StringMap::insert(pair) consistent with the standard associative ↵Rafael Espindola1-38/+0
container concept." This reverts commit r211309. It looks like it broke some bots: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio llvm-svn: 211328
2014-06-19Add StringMap::insert(pair) consistent with the standard associative ↵David Blaikie1-0/+38
container concept. Patch by Agustín Bergé. llvm-svn: 211309
2014-06-11Convert StringMapEntry::Create to use StringRef instead of start/end ↵Craig Topper1-3/+3
pointers. Simpliies all in tree call sites. No functional change. llvm-svn: 210638
2014-05-09Remove use of = default/= delete as they're unsupported on MSVC2012David Blaikie1-4/+9
llvm-svn: 208388
2014-05-08Missed formattingDavid Blaikie1-11/+11
llvm-svn: 208362
2014-05-08StringMap: Move assignment and move construction.David Blaikie1-0/+67
llvm-svn: 208361
2014-05-08StringMap support for move-only values.David Blaikie1-0/+16
llvm-svn: 208359
2014-01-03Fix break introduced in r198377 due to using a local type as a template ↵David Blaikie1-6/+6
parameter. llvm-svn: 198379
2014-01-02Test coverage for non-default-constructible elements in a StringMapDavid Blaikie1-0/+15
This functionality was enabled by r198374. Here's a test to ensure it works and we don't regress it. Based on a patch by Maciej Piechotka. llvm-svn: 198377
2014-01-02Remove StringMapEntryInitializer support.David Blaikie1-17/+0
It was never specialized so let's just remove that unused configurability and always do the default. llvm-svn: 198374
2012-06-19Fix PR13148, an inf-loop in StringMap.Chandler Carruth1-0/+22
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
2012-06-19Remove some superfluous SCOPED_TRACEs from this unit test.Chandler Carruth1-6/+0
GoogleTest already prints errors with all the information about which test case contained the error. llvm-svn: 158724
2011-07-14The key of a StringMap can contain nul's in it, so having first() returnChris Lattner1-3/+3
const char* doesn't make sense. Have it return StringRef instead. llvm-svn: 135167
2010-11-29Merge System into Support.Michael J. Spencer1-1/+1
llvm-svn: 120298
2010-02-11Fix (harmless) memory leak found by memcheck.Jeffrey Yasskin1-0/+1
llvm-svn: 95862
2009-10-26Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth1-1/+1
direct inclusion edge from System to Support. llvm-svn: 85086
2009-07-23Convert StringMap to using StringRef for its APIs.Daniel Dunbar1-10/+13
- 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-21unbreak unit-tests on gcc-4.4.Torok Edwin1-0/+1
llvm-svn: 76542
2009-01-08Some generic clean-ups. Also make the StringMapEntryInitializer ↵Bill Wendling1-45/+44
specialization apply only to the tests that are actually testing it. llvm-svn: 61923
2009-01-08* Don't explicitly cast "0" to "void*". This doesn't work well with specializedBill Wendling1-3/+17
StringMapEntryInitializer classes. Leave it for the compiler to figure out what the type is and what "0" should be transformed into. * Un-disable the unit tests which test the StringMapEntryInitializer class. llvm-svn: 61922
2009-01-0880-column violation fix.Bill Wendling1-1/+1
llvm-svn: 61919
2009-01-08* Added unittests for StringMapMisha Brukman1-0/+189
* Fixed but in StringMap::clear() * Removed trailing whitespace Original patch by Talin. llvm-svn: 61914