Commit Graph

663 Commits

Author SHA1 Message Date
Anton Korobeynikov
4aad12c9cd Remove bogus assertion. This unbreaks mingw, where ConstantSDNode
has alignment 8 and LoadSDNode (used as LargestT template) - 4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-19 05:52:44 +00:00
Ted Kremenek
a052246590 Inline typedef for alist_iterator::pointer to work with MSVC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 18:28:46 +00:00
Nick Lewycky
066075030a operator[] is not defined for list::iterator. Overload it in ilist::iterator
to prevent silly things from happening accidentally. PR2171


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 07:00:52 +00:00
Ted Kremenek
eca64f0980 Minor tweaks to the ImmutableList iterator interface.
Added partial specialization of DenseMapInfo<T> for ImmutableList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:43:07 +00:00
Ted Kremenek
0ebf14c4bb Make typedef public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:24:20 +00:00
Ted Kremenek
3000357ab5 Make some typedefs public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:09:45 +00:00
Ted Kremenek
ccaa6540fc Make typedefs in ilist public (Visual C++ errors out when they are private).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:58:10 +00:00
Bill Wendling
98fd7f6b2f Pull r53428 from Gaz into mainline:
Remove warnings about unused/shadowed variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:49 +00:00
Ted Kremenek
07f3cf76c6 Added ImmutableMap constructor that accepts a const TreeTy*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:10 +00:00
Dan Gohman
4f4b348437 Tidy up #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:26:19 +00:00
Duncan Sands
df99c29e7b Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 11:21:59 +00:00
Dan Gohman
e14d81deeb Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 22:58:06 +00:00
Dan Gohman
9ff0f0ea39 Make ilist noncopyable too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:43:32 +00:00
Dan Gohman
f178700829 Don't use std::advance just to increment or decrement by one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:39:33 +00:00
Dan Gohman
d24c62c67e Remove unnecessary static_casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:08:20 +00:00
Dan Gohman
ccd95b5f9c Remove an unnecessary reinterpret_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:07:36 +00:00
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Dan Gohman
6b345ee9b2 Make DenseMap's insert return a pair, to more closely resemble std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 17:46:23 +00:00
Ted Kremenek
aa5044d3ce Removed ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new method does the same thing, except that it returns a pointer to the mapped data type, and not to an internal tree node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 16:20:55 +00:00
Dan Gohman
08c09496c2 Use operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 00:59:36 +00:00
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