1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

93 Commits

Author SHA1 Message Date
Chris Lattner
ab2419e712 give StringMap a new ctor which allows you to initialize it
with an existing allocator.  The interesting use case of this
is that it allows "StringMap<whatever, BumpPtrAllocator&>" for
when you want to allocate out of a preexisting bump pointer
allocator owned by someone else.

llvm-svn: 109213
2010-07-23 03:29:59 +00:00
Chris Lattner
93b617fac4 Add a method to get a StringMapEntry from a pointer to the string
data it contains (similar to GetStringMapEntryFromValue).  
Patch by Greg Clayton!

llvm-svn: 99371
2010-03-24 00:53:27 +00:00
Daniel Dunbar
4daaf9d3f4 Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58: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
Jay Foad
16d48d2595 Use v.data() instead of &v[0] when SmallVector v might be empty.
llvm-svn: 72210
2009-05-21 09:52:38 +00:00
Daniel Dunbar
a3c65dba44 Add StringMap::lookup.
llvm-svn: 66750
2009-03-12 01:16:06 +00:00
Chris Lattner
49498bdff4 fix a pretty serious bug in StringMap where GetOrCreate(strstart,strend, z)
would not set new values to Z.

llvm-svn: 63707
2009-02-04 01:54:10 +00:00
Bill Wendling
71f808dfa2 * Don't explicitly cast "0" to "void*". This doesn't work well with specialized
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-08 08:26:46 +00:00
Misha Brukman
4044287626 * Added unittests for StringMap
* Fixed but in StringMap::clear()
* Removed trailing whitespace

Original patch by Talin.

llvm-svn: 61914
2009-01-08 04:48:20 +00:00
Ted Kremenek
d0f8118dc1 Add typedef to StringMapEntry.
llvm-svn: 60134
2008-11-27 00:17:25 +00:00
Chris Lattner
441571cc05 optimize StringMap::clear
llvm-svn: 53009
2008-07-02 05:30:45 +00:00
Chris Lattner
06545d1c4a Add a new (simple) StringMap::clear method, patch by Pratik
Solanki!

llvm-svn: 53008
2008-07-02 05:26:32 +00:00
Bill Wendling
36ebc296c1 Remove warnings about shadowed and unused variables.
llvm-svn: 52791
2008-06-26 18:11:45 +00:00
Dan Gohman
d1ec941698 Pass std::string by reference. Thanks Chris!
llvm-svn: 52678
2008-06-24 16:40:22 +00:00
Dan Gohman
54b67be86a Add methods to StringMap to erase entries by key.
llvm-svn: 52640
2008-06-23 21:07:03 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Anton Korobeynikov
b1576212e7 Don't dereference an invalid pointer if string is empty.
llvm-svn: 46781
2008-02-05 23:34:40 +00:00
Anton Korobeynikov
1cc154d068 Add convenient std::string helpers to StringMap. Patch by Mikhail Glushenkov!
llvm-svn: 46625
2008-01-31 23:02:33 +00:00
Anton Korobeynikov
91b7d99e8a Reapply the patch with fix.
llvm-svn: 46615
2008-01-31 17:43:25 +00:00
Chris Lattner
87c2925656 revert anton's recent stringmap patch, which breaks clang.
llvm-svn: 46614
2008-01-31 17:24:51 +00:00
Anton Korobeynikov
55998b56a0 Make StringMap to be more STL'ish. Patch by Mikhail Glushenkov!
llvm-svn: 46612
2008-01-31 12:30:40 +00:00
Anton Korobeynikov
45e5afd820 Whitespace cleanup
llvm-svn: 46611
2008-01-31 12:10:41 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Dan Gohman
80af3e255d Add explicit keywords, and fix a minor typo that they uncovered.
llvm-svn: 45034
2007-12-14 15:41:34 +00:00
Chris Lattner
2190758012 Pass the whole StringMapEntry into StringMapEntryInitializer::Initialize.
llvm-svn: 44432
2007-11-29 06:14:41 +00:00
Chris Lattner
5d29c4130c provide an optional API to allow datatypes in a stringmap to be *gasp*
initialized with a value if they want, by specializing the 
StringMapEntryInitializer class.

llvm-svn: 44430
2007-11-29 06:04:41 +00:00
Dan Gohman
760d574313 Add explicit keywords.
llvm-svn: 44234
2007-11-19 15:30:20 +00:00
Ted Kremenek
24219dc48a Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects.  No functionality change.

llvm-svn: 43097
2007-10-17 22:09:45 +00:00
Ted Kremenek
307fa3bed5 Updated StringMap to use llvm::AlignOf to compute the alignment of map
entries.

llvm-svn: 43089
2007-10-17 21:13:50 +00:00
Chris Lattner
18867ab274 don't use intptr_t without including it.
llvm-svn: 42921
2007-10-12 18:16:23 +00:00
Chris Lattner
e80faf3036 Make this compute the correct offset, handling alignment of the element
pointer correctly.

llvm-svn: 42918
2007-10-12 17:49:52 +00:00
Chris Lattner
c013b7f395 Add a helper useful when mapping from a map element to its hash node.
llvm-svn: 42480
2007-09-30 08:31:46 +00:00
Chris Lattner
06bdb78751 Disable the string map copy ctor and assignment operators,
they don't do the right thing.  

Implement StringMap::erase.

Fix a nasty bug in the default ctor.

llvm-svn: 40395
2007-07-22 20:08:01 +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
d61a01003b add new ShouldRehash method to factor out common code. Fix the dtor to not
delete tombstones.

llvm-svn: 34189
2007-02-11 21:46:36 +00:00
Chris Lattner
15eaaa2bbd do not allow hash table to be filled with tombstones.
llvm-svn: 34186
2007-02-11 21:07:36 +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
c3396d5ff8 add iterator support, plus support for size() and empty().
llvm-svn: 34178
2007-02-11 08:12:13 +00:00
Chris Lattner
8a8d0a44a6 Split StringMapEntry construction out of StringMap, into StringMapEntry.
llvm-svn: 34170
2007-02-11 00:10:26 +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