Commit Graph

613 Commits

Author SHA1 Message Date
Dan Gohman
167b8bc24d Add support to FoldingSet for hashing APInt objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 23:09:15 +00:00
Anton Korobeynikov
5c4fb22809 Don't dereference an invalid pointer if string is empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 23:34:40 +00:00
Ted Kremenek
9dc7ab538e Added FoldingSet profiling support to ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 18:50:25 +00:00
Ted Kremenek
95da16e288 Changed profiling method for ImmutableMap to once again just use its
unique ImutAVLTree* for profiling.

Modified ImutAVLTree:
 (1) changed ComputeHash() to ComputeDigest() and
 (2) changed Profile() to use the computed digest and
 (3) modified insertion of IMutAVLTree into the FoldingSet owned by
     the ImutAVLTreeFactory object to use profiling instead of computing
     a direct hash.  This fixes a bug where our abuse of the FoldingSet would
     not work when the FoldingSet was resized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 17:30:43 +00:00
Ted Kremenek
c695ea9e8d Modified 'Profile' method of ImmutableMap to use the 'Profile' method
of the contained ImutAVLTree root.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46719 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 21:17:02 +00:00
Ted Kremenek
f357afb404 Modified node creation of ImutAVLTree to do a hash lookup for an existing
node in the FoldingSet of nodes held by the Factory object.  If we
we find a node with a matching hash, we do a full structural comparison.
Nodes are also now inserted into the FoldingSet only when we mark them
Immutable, as their children can change during intermediate-rebalancing.

The 'Profile' method for ImutAVLTree is no longer used when looking up
existing ImutAVLTrees with a given set of contents; instead the Profile method
is used by other clients that wish to insert such a tree into a folding set.
This means that we are not using FoldingSet in ImutAVLTreeFactory in the way
it was intended, but instead are using it as an opaque hashtable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 21:15:24 +00:00
Ted Kremenek
26e3c445fc Added "bucket_iterators" to FoldingSet. Bucket iterators allow iteration
over all the nodes in a particular bucket.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 21:11:17 +00:00
Ted Kremenek
d9719495c3 constified operator~().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04 16:57:26 +00:00
Anton Korobeynikov
ec3e5c8a39 Add convenient std::string helpers to StringMap. Patch by Mikhail Glushenkov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 23:02:33 +00:00
Anton Korobeynikov
713a13906a Reapply the patch with fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46615 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 17:43:25 +00:00
Chris Lattner
a91cfa9cd0 revert anton's recent stringmap patch, which breaks clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 17:24:51 +00:00
Anton Korobeynikov
f429a519c8 Make StringMap to be more STL'ish. Patch by Mikhail Glushenkov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 12:30:40 +00:00
Anton Korobeynikov
75fb496fc6 Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 12:10:41 +00:00
Ted Kremenek
d25c9cd3ff Altered ctor for APSInt to accept an optional "isUnsigned" flag. Default
behavior is unchanged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 18:55:14 +00:00
Ted Kremenek
7afe973add Added destructor for template class FoldingSetNodeWrapper.
Added getValue() to FoldingSetNodeWrapper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28 22:05:23 +00:00
Ted Kremenek
cadf873c83 Added additional overloaded operators for APSInt to match the operators of
APInt.

While some operators were already specifically overloaded for APSInt, others
resulted in using the overloaded operator methods in APInt, which would result
in the signedness bit being lost.

Modified the APSInt(APInt&) constructor to be "explicit" and to take an
extra (optional) flag to indicate the signedness.  Making the ctor explicit
will catch any implicit conversations between APSInt -> APInt -> APSInt that
results in the signedness flag being lost.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 18:59:52 +00:00
Ted Kremenek
1eed950d7c Added "getRoot()" to ImmutableSet.
Made ImmutableSet::ImmutableSet(ImutAVLTree* Root) public. (this allows handy
casting between trees and sets).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23 19:57:33 +00:00
Ted Kremenek
3387060470 Fixed buggy caching of the hash value of an ImutAVLTree node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:54:46 +00:00
Ted Kremenek
8893b0d3ac Moved method call within a conditional branch because its effects will
be ignored on the false branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:51:35 +00:00
Ted Kremenek
c4125a3c44 Adjusted ImutAVLTree::ComputeHash to compute a hash value that is based on a
clearer sequence of hashing compositions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:50:37 +00:00
Ted Kremenek
c899b33b83 Added "clear" method to FoldingSetNodeID to allow a FoldingSetNodeID object
to be reused to compute multiple object profiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:49:22 +00:00
Ted Kremenek
6518f5fcbf Replaced (FoldingSet) profiling of ImutAVLTree with a hashing based scheme. The
problem was that we previously hashed based on the pointers of the left and
right children, but this is bogus: we can easily have different trees that
represent the same set. Now we use a hashing based scheme that compares the
*contents* of the trees, but not without having to do a full scan of a tree. The
only caveat is that with hashing is that we may have collisions, which result in
two different trees being falsely labeled as equivalent. If this becomes a
problem, we can add extra data to the profile to hopefully resolve most
collisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:33:30 +00:00
Ted Kremenek
187784996c Changed argument name for 'Profile' method to potentially fix a name conflict
reported in pr1929 (http://llvm.org/PR1929).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 17:21:43 +00:00
Ted Kremenek
3cf8bec783 Modified ImmutableSet/ImmutableMap to use FoldingSet profiling using
FoldingSetTrait instead of directly calling a 'Profile' method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:51:55 +00:00
Ted Kremenek
4048a08284 Added FoldingSet style 'profiling' support for APSInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:31:12 +00:00
Ted Kremenek
e420debd26 Added FoldingSet style 'profiling' support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46188 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:23:33 +00:00
Ted Kremenek
0a3fecad0a Made 'FoldingSetNodeID' a proper class instead of a nested class in
'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of
'FoldingSetNodeImpl::NodeID').

Why?  Clients can now easily forward declare 'FoldingSetNodeID' without having
to include FoldingSet.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46187 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:22:50 +00:00
Ted Kremenek
a753f703d1 Made 'profiling' of objects in a FoldingSet trait-based using FoldingSetTrait
instead of always assuming that the stored objects had a method called
'Profile'. The default behavior is to dispatch to a 'Profile' method (as
before), but via template specialization this behavior can now be overridden by
clients.

Added templated class 'FoldingSetNodeWrapper', a generic wrapper class that
allows one to insert objects into a FoldingSet that do not directly inherit from
FoldingSetNode. This is useful for inserting objects that do not always need to
pay the overhead of inheriting from FoldingSetNode, or were designed with that
behavior in mind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46186 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 03:58:00 +00:00
Chris Lattner
4569553432 don't form an std::string with a null pointer, it aborts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 18:54:31 +00:00
Ted Kremenek
e8277538e7 Reverted implementation of ImmutableMap::find() to return a TreeTy* instead of
an iterator, since the implementation returned an iterator that pointed to a
different node! Renamed this implementation to SlimFind() so that users do not
expect it to return an iterator (it is a more efficient implementation than
returning an iterator if the user just wants to find the value of a key).

Added a FIXME to implement ImmutableMap::find() that returns an iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 00:38:04 +00:00
Ted Kremenek
e509e7a178 Implemented "FIXME" in ImutAVLTree: isEqual() now also compares the *data* value
and not just the key value when comparing trees. To do this we added data_type
and data_type_ref to the ImutContainerInfo trait classes. For values stored in
the tree that do not have separate key and data components, data_type is simply
a typedef of bool, and isDataEqual() always evaluates to true. This allows us to
support both ImmutableSet and ImmutableMap using the same underlying logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 17:36:49 +00:00
Ted Kremenek
316e984471 Changed ImmutableMap::find to return an iterator instead of a pointer
to the tree node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 23:53:53 +00:00
Chris Lattner
8874628e30 add operator==/!= to smallvector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 18:42:02 +00:00
Ted Kremenek
6632f95239 Added "getRoot()" to ImmutableMap.
Made the ctor for ImmutableMap to construct a map from an AVL tree public.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 21:05:59 +00:00
Ted Kremenek
0a8cabb178 Fixed 80 col. violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 19:38:55 +00:00
Ted Kremenek
6f2197699a Inverted argument order for ImmutableMap::Profile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 22:18:33 +00:00
Ted Kremenek
3c6255c376 Added iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 21:31:48 +00:00
Chris Lattner
234d529e58 remove attribution from a variety of miscellaneous files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 22:59:10 +00:00
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
Ted Kremenek
48da1edde0 Removed scoped_ptr, as its functionality is subsumed by OwningPtr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 00:15:29 +00:00
Ted Kremenek
3a818a3953 Added OwningArrayPtr smart pointer class to provide an analogous class to
OwningPtr except that it works for pointers to arrays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 19:53:47 +00:00
Chris Lattner
714307207f add new smart pointer for clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 19:14:02 +00:00
Anton Korobeynikov
54c005f465 More eye-candy stuff :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 01:30:27 +00:00
Anton Korobeynikov
08b934edc6 Add iterators for child traversal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 01:21:50 +00:00
Chris Lattner
d2128a7ca5 cleanup this code, making it more "llvm-like".
Add comments to reset indicating that it deletes its pointer.
Add a new take() method, which can be used to get the pointer
without it being deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 18:58:23 +00:00
Anton Korobeynikov
cdd0417ba3 Define addString() and lookup() out-of-line to dissuade the C++ compiler from inlining it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 01:36:16 +00:00
Anton Korobeynikov
11ffccf2a5 Provide GraphTraits and DOTGraphTraits interface for Trie.
Retoss private/public stuff.
Make copy ctor and operator= private.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 01:27:04 +00:00
Anton Korobeynikov
ffe9e63c4a Use references in DF iterators. This eliminates copy-ctor calls on huge objects (graphs)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15 22:23:24 +00:00
Dan Gohman
ded2b0d0fb Add explicit keywords, and fix a minor typo that they uncovered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 15:41:34 +00:00
Anton Korobeynikov
41ff20bff4 Use vector for child storage instead of map. This will also make
our life during future GraphTraits'ing slightly easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44952 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 19:08:44 +00:00
Anton Korobeynikov
765d8e5cbd Remove Trie::Edge class. Now edge labels are stored into nodes itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 21:55:38 +00:00
Wojciech Matyjewicz
ac9d6cc3a1 Use correct member access operator.
(my test commit as well)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 17:46:25 +00:00
Anton Korobeynikov
64735ccb2b Add first and really dirty version of generic Trie structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 06:53:44 +00:00
Ted Kremenek
9324665a78 Added two bounds checks to the BitVector class to detect
out-of-bounds bit accesses.  The checks are only performed
in a Debug build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:28:35 +00:00
Chris Lattner
921f0d40ec remove dead #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:06:21 +00:00
Chris Lattner
73481e04da eliminate dependency on Bitcode headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:01:44 +00:00
Chris Lattner
065d97e7fc remove dead #include, APInt.h already has the needed forward decls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:00:38 +00:00
Chris Lattner
d7205e6ba1 Pass the whole StringMapEntry into StringMapEntryInitializer::Initialize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44432 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:14:41 +00:00
Chris Lattner
aec78708c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44430 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:04:41 +00:00
Chris Lattner
9e513acd31 Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 22:42:31 +00:00
Dan Gohman
adf3eab773 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:30:20 +00:00
Daniel Berlin
07268172ff Fix bugs in iterator invalidation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:06:49 +00:00
Chris Lattner
ab64806af2 Import the boost scoped_ptr class to LLVM. This patch was prepared by
Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44161 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 05:57:06 +00:00
Hartmut Kaiser
729bd28f62 Fixed a strange construct. Please review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:04:06 +00:00
Ted Kremenek
c47dfdde24 Implemented generic serialization of APFloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 18:39:22 +00:00
Ted Kremenek
586504d5ed Fixed default ctor for APInt to properly initialize BitWidth to a
non-random value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 00:27:59 +00:00
Chris Lattner
373a733be0 make smallptrset more const and type correct, which caught a few
minor bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 22:12:43 +00:00
Neil Booth
ee7ae384f5 When converting to integer, do bit manipulations in the destination
memory rather than in a copy of the APFloat.  This avoids problems
when the destination is wider than our significand and is cleaner.

Also provide deterministic values in all cases where conversion
fails, namely zero for NaNs and the minimal or maximal value
respectively for underflow or overflow.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 22:43:37 +00:00
Ted Kremenek
aef806e9cb Added typedef "value_type" to DenseMap (similar typedef appears in std::map).
Added method FindAndConstruct() to DenseMap, which does the same thing as
operator[], except that it refers value_type& (a reference to both the
key and mapped data pair).  This method is useful for clients that wish
to access the stored key value, as opposed to the key used to do the
actual lookup (these need not always be the same).

Redefined operator[] to use FindAndConstruct() (same logic).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43594 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 00:54:57 +00:00
Ted Kremenek
8092406e59 Changed access control within FoldingSet for some ivars from "private"
to "protected".  This allows iterators to work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43559 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 17:12:47 +00:00
Ted Kremenek
20b7907c1c Added member function "size()" to FoldingSet to return the number of
nodes in the FoldingSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:35:55 +00:00
Ted Kremenek
1a43e5ffe1 Added serialization support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 21:50:10 +00:00
Ted Kremenek
7f46734b66 Fixed incorrect "path name" in preamble (comment) of header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43402 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:44:02 +00:00
Ted Kremenek
02760ed19a Fixed incorrect "path name" in preamble (comment) of header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43401 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:42:45 +00:00
Chris Lattner
10c42185d8 add a nice predicate to check to see if nan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43304 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 18:54:28 +00:00
Christopher Lamb
c5ccbdbe32 Add an uppercase conversion utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:31:38 +00:00
Ted Kremenek
52e2d83e65 Changed the return type of type-specific Allocate() methods to return
void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:30:14 +00:00
Ted Kremenek
fa4710427f ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
the new type-aligned Allocate() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43100 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:17:01 +00:00
Ted Kremenek
6740463c74 Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:09:45 +00:00
Ted Kremenek
9080aaba0b Updated StringMap to use llvm::AlignOf to compute the alignment of map
entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:13:50 +00:00
Hartmut Kaiser
efd4a5144b Updated VC++ build system.
Silenced some VC warnings.

I'm getting linker errors, though: unresolved externals:

llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

and

llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

Where are these defined?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:56:40 +00:00
Ted Kremenek
fd9c58adde Fixed incorrect renaming of method name (forgot two characters).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42999 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 19:15:48 +00:00
Ted Kremenek
85d03ae1ae Added more doxygen comments.
Renamed internal method of ImutAVLTree::RemoveMutableFlag to MarkImmutable.
Added enum for bit manipulation (more self-documentating).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 18:52:34 +00:00
Neil Booth
e5e0194583 Consolidate logic for creating NaNs. Silence compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42966 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:39:51 +00:00
Chris Lattner
1ff2ddda08 don't use intptr_t without including it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:16:23 +00:00
Chris Lattner
b89f67e3e6 Make this compute the correct offset, handling alignment of the element
pointer correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 17:49:52 +00:00
Neil Booth
96c7471b39 Implement correctly-rounded decimal->binary conversion, i.e. conversion
from user input strings.

Such conversions are more intricate and subtle than they may appear;
it is unlikely I have got it completely right first time.  I would
appreciate being informed of any bugs and incorrect roundings you
might discover.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42912 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:02:31 +00:00
Chris Lattner
886636445d make operator== work with non-equal sized bitvectors, as long as
the extra bits are all zeros.  This allows  "010" and "010000" to be
treated as equal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42889 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 03:48:59 +00:00
Ted Kremenek
0b22da3d73 Provided accessors to internal allocator for ImutAVLTree and ImmutableSet.
Added postfix ++,-- support for ImmutableSet::iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42877 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 21:51:04 +00:00
Dale Johannesen
a471c2ecda Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:07:22 +00:00
Chris Lattner
343960af31 make bitvector &= do the right thing if vectors have mismatched length.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42860 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 06:12:33 +00:00
Ted Kremenek
bdc2154986 Added iterators to ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:14:49 +00:00
Ted Kremenek
37474bce02 Added some doxygen comments to ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:47:03 +00:00
Ted Kremenek
ac6084dfc2 Removed uninformative assertions that catch problems that will
fire anyway at runtime due to a NULL dereference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:35:04 +00:00
Ted Kremenek
13a21b0237 Removed "height" of an AVL tree node from its Profile. This is
implicitly captured by using the addresses of its children in the
profile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:32:01 +00:00
Ted Kremenek
b308cdbc5f Removed spurious forward declaration to a structure that will no longer be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:45:34 +00:00
Ted Kremenek
ea34bc892c Added some doxygen comments to a few methods of ImutAVLTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:44:21 +00:00
Ted Kremenek
ebdbed3844 Added preliminary support for iterators in ImutAVLTree.
Implemented ImutAVLTree::isEqual.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42833 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 18:11:16 +00:00
Ted Kremenek
be24d91d82 Renamed internal method "Create" of ImutAVLTree to "CreateNode".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 16:27:33 +00:00
Ted Kremenek
33bbed8f2a Added implementation of immutable (functional) maps and sets, as
implemented on top of a functional AVL tree.  The AVL balancing code
is inspired by the OCaml implementation of Map, which also uses a functional
AVL tree.

Documentation is currently limited and cleanups are planned, but this code
compiles and has been tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42813 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:38:09 +00:00