1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

79 Commits

Author SHA1 Message Date
David Blaikie
007563ca36 Recommit simplification first attempted in r232309 (fixed a bit in r232312, with fixes in r232314)
Messed it up because I didn't realize there were two different iterators
here (& clearly didn't build any of this... ) - still seems easier to
just use the injected class name than introduce a self typedef.

llvm-svn: 232462
2015-03-17 05:49:45 +00:00
Benjamin Kramer
09f8543349 Factor the iterators of ImmutableSet/ImmutableMap into a common base class
This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.

llvm-svn: 232319
2015-03-15 13:26:03 +00:00
David Majnemer
e4b732cd4e ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended.

llvm-svn: 232317
2015-03-15 07:09:20 +00:00
David Majnemer
6c4a4dd821 Restore the gcc build
llvm-svn: 232314
2015-03-15 06:11:24 +00:00
David Blaikie
be05df9e18 Remove iterator I accidentally left behind
llvm-svn: 232312
2015-03-15 03:21:20 +00:00
David Blaikie
9b68e6accb Remove use of reserved identifier and some excess 'inline' usage
llvm-svn: 232309
2015-03-15 03:11:26 +00:00
Aaron Ballman
0b45511a2e Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
llvm-svn: 229340
2015-02-15 22:54:22 +00:00
Craig Topper
c7c3a99ec2 [C++] Use 'nullptr'.
llvm-svn: 207083
2014-04-24 06:44:33 +00:00
Benjamin Kramer
eadee1840d Remove a couple of redundant copies of SmallVector::operator==.
No functionality change.

llvm-svn: 206635
2014-04-18 19:48:03 +00:00
Jordan Rose
2c5904848b Add ImmutableSet profiling info for 'bool'.
Useful for tri-state maps: true, false, and "no data yet".

llvm-svn: 194266
2013-11-08 17:23:49 +00:00
Benjamin Kramer
54adc10532 Add difference_type to ImmutableMap/Set iterators so they have a complete set of typedefs.
llvm-svn: 188579
2013-08-16 21:55:56 +00:00
Francois Pichet
9e29d95f36 Add missing typename to unbreak the MSVC 2012 build.
llvm-svn: 175129
2013-02-14 03:24:14 +00:00
Ryan Govostes
bdb566bf9d Fix iterator definitions for ImmutableSet and ImmutableMap.
llvm-svn: 175097
2013-02-13 22:37:27 +00:00
Ryan Govostes
2d7d8621cf Add iterator_traits to ImmutableMap and ImmutableSet.
llvm-svn: 175085
2013-02-13 21:38:22 +00:00
Jakub Staszak
f1ea1a7f37 Fix include guards so they exactly match file names.
llvm-svn: 172025
2013-01-10 00:45:19 +00:00
Chandler Carruth
ca305491f6 Sort the #include lines for the include/... tree with the script.
AKA: Recompile *ALL* the source code!

This one went much better. No manual edits here. I spot-checked for
silliness and grep-checked for really broken edits and everything seemed
good. It all still compiles. Yell if you see something that looks goofy.

llvm-svn: 169133
2012-12-03 17:02:12 +00:00
Benjamin Kramer
25522ac16c Fix a typo that made ImmutableMap::getMaxElement() useless.
Add a basic unit test for ImmutableMap. Found by inspection.

llvm-svn: 165907
2012-10-14 15:56:39 +00:00
Craig Topper
f2e8b27fbc Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164014
2012-09-17 06:31:17 +00:00
Craig Topper
a71d0f57b9 Tidy up formatting of some elses on a separate line from preceding bracing. No functional change.
llvm-svn: 163992
2012-09-16 03:00:03 +00:00
Craig Topper
239ccf7e3a Tidy up trailing whitespace.
llvm-svn: 163988
2012-09-16 01:20:35 +00:00
Craig Topper
51933d960f Remove unneeded header.
llvm-svn: 163987
2012-09-16 01:18:51 +00:00
Bill Wendling
f720eb7a94 Remove tabs.
llvm-svn: 160471
2012-07-18 23:58:37 +00:00
Jordy Rose
7d6fc98ccf Constify (trivially) ImmutableSet::iterator::getVisitState().
This was probably intended all along.

llvm-svn: 156318
2012-05-07 19:24:40 +00:00
Anna Zaks
b35d6e77c8 Make sure ImmutableSet never inserts Tombstone/Entry into DenseMap.
ImmutAVLTree uses random unsigned values as keys into a DenseMap,
which could possibly happen to be the same value as the Tombstone or
Entry keys in the DenseMap.

Test case is hard to come up with. We randomly get failures on the
internal static analyzer bot, which most likely hits this issue
(hard to be 100% sure without the full stack).

llvm-svn: 153148
2012-03-20 22:56:27 +00:00
Craig Topper
e18a06be4d Convert assert(0) to llvm_unreachable
llvm-svn: 149849
2012-02-05 22:14:15 +00:00
Ted Kremenek
744f9cc17c Make canonicalization of ImmutableSetRef::asImmutableSet() semi-explicit.
llvm-svn: 140959
2011-10-02 01:47:07 +00:00
Ted Kremenek
484a96fab1 Add ImmutableMapRef and ImmutableSetRef, which consolidate Immutable[Map,Set] and its Factory. This may eventually replace Immtuable[Map,Set].
llvm-svn: 139967
2011-09-16 23:01:25 +00:00
Ted Kremenek
bacaf8fbf1 Performance optimization on ImmutableMap/ImmutableSet:
- Use a DenseSet instead of a FoldingSet to cache
canonicalized nodes.  This reduces the overhead
of double-hashing.

- Use reference counts in ImutAVLTree to much
more aggressively recover tree nodes that are
no longer usable.  We can generate many
transient nodes while using add() and remove()
on ImmutableSet/ImmutableMaps to generate a final
set/map.

For the clang static analyzer (the main client
of these data structures), this results in
a slight speedup (0.5%) when analyzing sqlite3,
but much more importantly results in a 30-60%
reduction in peak memory usage when the analyzer
is analyzing a given function in a file.  On
average that's about a ** 44% reduction ** in the
memory footprint of the static analyzer.

llvm-svn: 120459
2010-11-30 20:26:45 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Ted Kremenek
bb322e520d Tweak ImmutableMap/ImmutableSet/ImmutableList APIs
to use lowercase letters for the start of most
method names and to replace some method names
with more descriptive names (e.g., "getLeft()"
instead of "Left()").  No real functionality
change.

llvm-svn: 120070
2010-11-24 00:54:28 +00:00
Dan Gohman
ea25285426 Fix warnings about missing parents between || and &&.
llvm-svn: 119454
2010-11-17 02:40:30 +00:00
Daniel Dunbar
d3c1f99fa1 Fix -Asserts warnings.
llvm-svn: 101191
2010-04-13 23:34:11 +00:00
Zhongxing Xu
e075bd78c6 Add an immutable interval map, prepared to be used by flat memory model
in the analyzer. WIP.

llvm-svn: 94976
2010-02-01 10:43:31 +00:00
Zhongxing Xu
f9abfaa0c2 Simplify code. We can compare TNew with T in one batch.
llvm-svn: 94973
2010-02-01 07:32:52 +00:00
Ted Kremenek
20b78f8eef Store flags in bitfields instead of masking them into the pointer for the left child. This leads to some nice conceptually cleanups.
llvm-svn: 94121
2010-01-22 00:28:27 +00:00
Ted Kremenek
30dee16eed Tidy up assertion syntax. No functionality change.
llvm-svn: 94117
2010-01-21 23:42:57 +00:00
Douglas Gregor
cc2c05cb75 Make a few more LLVM headers parsable as standalone headers.
Fix some problems with the hidden copy constructors for
ImmutableMap/ImmutableSet found by Clang++.

llvm-svn: 86186
2009-11-05 23:01:30 +00:00
Chandler Carruth
766362c707 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Dan Gohman
ae76dc48d6 Delete bogus semicolons.
llvm-svn: 84132
2009-10-14 20:39:01 +00:00
Ted Kremenek
abbc32c042 Provide a mode for ImmutableMap/ImmutableSet to not automatically canonicalize the internal functional AVL trees. This should speedup clients that use ImmutableMap/ImmutableSet but don't require fast comparisons of maps.
llvm-svn: 84010
2009-10-13 19:08:10 +00:00
Ted Kremenek
e4f2f7f6b2 Make ImmutableMap/ImmutableSet quicker by only canonicalizing the tree after an
Add or Remove operation complete, and not while building the intermediate tree.
This trades a little bit more memory usage for less accesses to the FoldingSet.  On a benchmark for the clang static analyzer, this shaves off another 13% of execution time when using field/array sensitivity.

llvm-svn: 80955
2009-09-03 22:07:30 +00:00
Ted Kremenek
6d0baa578a Set the 'cached digest' flag after computing the digest for an
ImutAVLTree.  This was accidentally left out, and essentially caused
digest caching to be ignored in ImmutableMap and ImmutableSet (this
bug was detected from shark traces that showed ComputeDigest was in
the hot path in the clang static analyzer).

This reduces the running time of the clang static analyzer on an
example benchmark by ~32% for both RegionStore (field-sensitivty) and
BasicStore (without field-sensitivity).

llvm-svn: 80877
2009-09-03 04:21:34 +00:00
Ted Kremenek
b29794d828 Make default ctor for ImmutableSet::iterator public.
llvm-svn: 77762
2009-08-01 01:28:23 +00:00
Daniel Dunbar
0686bcbe91 Remove redundant qualifiers.
llvm-svn: 76357
2009-07-19 01:42:34 +00:00
Ted Kremenek
ec0e24ae25 ImmutableMap/ImmutableSet: Allow caching of ImutAVLTree digests while the tree
is still mutable. My experiments show this reduces the amount of times we
compute a full tree digest by over 50% on very small cases, and potentially much
larger on others.

llvm-svn: 75207
2009-07-10 00:33:43 +00:00
Ted Kremenek
c089dcb368 ImmutableSet/ImmutableMap: Allow caching of null digests by properly using a flag to record if the digest of an ImutAVLTree has been cached.
llvm-svn: 75157
2009-07-09 18:34:41 +00:00
Ted Kremenek
d8c425b68d Add ImmutableMap::getMaxElement(), a method that returns the <key,value> pair in a ImmutableMap that has the highest ranked key.
llvm-svn: 65326
2009-02-23 17:27:18 +00:00
Misha Brukman
4637ef9b4b Removed trailing whitespace.
llvm-svn: 65197
2009-02-20 22:54:36 +00:00
Chris Lattner
c21f591628 Add operator->, patch by Ben Laurie!
llvm-svn: 64378
2009-02-12 17:14:49 +00:00
Ted Kremenek
5a94b8568b Add method 'isSingleton()' to ImmutableSet. This returns true if the set contains exactly one element.
llvm-svn: 64359
2009-02-12 05:17:02 +00:00