Commit Graph

643 Commits

Author SHA1 Message Date
Owen Anderson
93ee2fd7da Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 17:29:59 +00:00
Chris Lattner
509e4f30e8 optimize StringMap::clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 05:30:45 +00:00
Chris Lattner
fce6e546aa Add a new (simple) StringMap::clear method, patch by Pratik
Solanki!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 05:26:32 +00:00
Ted Kremenek
445723bfb0 Implemented operator!= for the ImmutableList iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52998 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 00:06:55 +00:00
Owen Anderson
72e61b8501 Add a version of AddString that takes a const char* so we can avoid extraneous
conversions to std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 23:49:59 +00:00
Ted Kremenek
e1bf7fdcb4 Added partial specialization of FoldingSetTrait for pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 22:30:13 +00:00
Seo Sanghyeon
ff4d609ec5 Compilation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 05:27:28 +00:00
Dan Gohman
f4d7708972 Make SmallVector's grow use memcpy in common cases
instead of std::uninitialized_copy, which uses memmove.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 21:45:13 +00:00
Dan Gohman
7c6618926a Use plain operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52927 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 21:33:02 +00:00
Ted Kremenek
30389141c9 Added some comments and some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 20:41:22 +00:00
Ted Kremenek
3771902e92 Added ImmutableList, a companion ADT to ImmutableSet and ImmutableMap that is used to represent a purely functional list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:07:38 +00:00
Chris Lattner
f25381ed35 add convenience 'constructors'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 18:02:44 +00:00
Bill Wendling
8032020cf2 Remove warnings about shadowed and unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 18:11:45 +00:00
Dan Gohman
2b08676ca8 Pass std::string by reference. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 16:40:22 +00:00
Dan Gohman
caf746aa5a Add a clear() method to PriorityQueue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 23:47:46 +00:00
Dan Gohman
2904538fc3 Simplify erase_one slightly. It's not necessary to preserve
the value of the element to be erased while the heap is
being updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:46:21 +00:00
Dan Gohman
84701836bf Add methods to StringMap to erase entries by key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 21:07:03 +00:00
Wojciech Matyjewicz
300c6c5167 First step to fix PR2088. Implement routine to compute the
multiplicative inverse of a given number. Modify udivrem to allow input and 
output pairs of arguments to overlap. Patch is based on the work by Chandler
Carruth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 19:39:50 +00:00
Dan Gohman
3627e34486 Add a priority queue class, which is a wrapper around std::priority_queue
and provides fairly efficient removal of arbitrary elements. Switch
ScheduleDAGRRList from std::set to this new priority queue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 18:35:25 +00:00
Owen Anderson
2b7470eb54 Fix use of placement new to actually use an address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 18:07:43 +00:00
Duncan Sands
8eab8a2798 Remove some DAG combiner assumptions about sizes
of integer types.  Fix the isMask APInt method to
actually work (hopefully) rather than crashing
because it adds apints of different bitwidths.
It looks like isShiftedMask is also broken, but
I'm leaving that one to the APInt people (it is
not used anywhere).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 11:32:28 +00:00
Chris Lattner
d10e467ad9 Add a simple, but efficient, generic scoped hash table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 00:42:10 +00:00
Chris Lattner
b8d0b807fc add a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 18:09:04 +00:00
Dan Gohman
11bf2ace55 Add an operator< for SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:37:47 +00:00
Dan Gohman
cdff51cabc Fix an error in the comment for APInt::getMinSignedBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:46:49 +00:00
Anton Korobeynikov
81fb27cc3a Remove guard, so *each* inclusion will result in a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51708 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:57:11 +00:00
Dan Gohman
1baa88e3de Prune and tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 19:52:31 +00:00
Anton Korobeynikov
b372d59a11 Add file with warning for backward comptibility. Should be removed after 2.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 18:18:15 +00:00
Anton Korobeynikov
1ff4ed726b Update guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 18:17:53 +00:00
Anton Korobeynikov
43d1fd449f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 17:41:17 +00:00
Matthijs Kooijman
8e1cddc11d Use an explicit llvm:: prefix in the STATISTIC macro, so STATISTIC can still be
used when "using namespace llvm" is not in effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 12:41:24 +00:00
Bill Wendling
13d57320bd Remove warnings about unused parameters and shadowed variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 20:15:12 +00:00
Anton Korobeynikov
e269f434b1 Add thin layer over StringMap to form StringSet. By Mikhail Glushenkov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51048 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 15:03:16 +00:00
Ted Kremenek
1fd2e6d84e Make the interface of CStrInCStrNoCase be the same as strcasestr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 20:04:18 +00:00
Ted Kremenek
fdedd5397d Fix some serious logical errors in CStrInCStrNoCase pointed out by Bill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 19:22:36 +00:00
Ted Kremenek
fbd15899b3 Guard for empty strings in CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 18:49:31 +00:00
Ted Kremenek
6925f5074f Added CStrInCStrNoCase, a portable implementation of strcasestr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 18:35:46 +00:00
Nick Lewycky
094aa6ce47 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 06:39:04 +00:00
Evan Cheng
34cd4a484e Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 18:30:58 +00:00
Ted Kremenek
7a07428ad1 Implement operator-> for ImmutableMap iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50603 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 01:05:46 +00:00
Evan Cheng
48e8c80e17 Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-02 21:15:08 +00:00
Chris Lattner
b606dba13b Remove the SmallVector ctor that converts from a SmallVectorImpl. This
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when 
needed.

This patch includes many small cleanups for sdisel also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:44:42 +00:00
Chris Lattner
e49e52d856 restore the copy ctor in SmallVector. This fixes serious
errors I introduced in my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50338 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:32:08 +00:00
Chris Lattner
5da0b73aa1 generalize SmallVector copy ctor, there is no requirement for
the initialization vector to have the same fixed size, just the
same element type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 06:01:06 +00:00
Ted Kremenek
13f7a40508 Implement != for DenseSet iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:49:45 +00:00
Ted Kremenek
ea33c8fed6 Added iterator support for DenseSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 23:48:12 +00:00
Argyrios Kyrtzidis
0861d1fa5c Bring in uint32_t, uint64_t, and int64_t types for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 13:56:31 +00:00
Chris Lattner
036a94ed61 fix off by one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:10:37 +00:00
Chris Lattner
c0814dc606 give smallstring some methods to do 'itoa'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:05:02 +00:00
Chris Lattner
30ac7df857 improvements for IntrusiveRefCntPtr, patch by Mikhail Glushenkov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:42:06 +00:00