Commit Graph

22 Commits

Author SHA1 Message Date
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner 581f006f5d make smallptrset more const and type correct, which caught a few
minor bugs.

llvm-svn: 43782
2007-11-06 22:12:43 +00:00
Anton Korobeynikov b61c63ecd0 Properly use const qualifiers
llvm-svn: 41111
2007-08-15 21:12:30 +00:00
Chris Lattner 44f7d3aa0b When clearing a SmallPtrSet, if the set had a huge capacity, but the
contents of the set were small, deallocate and shrink the set.  This
avoids having us to memset as much data, significantly speeding up
some pathological cases.  For example, this speeds up the verifier
from 0.3899s to 0.0763 (5.1x) on the testcase from PR1432 in a 
release build.

llvm-svn: 40837
2007-08-05 07:32:14 +00:00
Owen Anderson 49f037ac29 Allow SmallPtrSet to hold pointers to const data.
llvm-svn: 40556
2007-07-27 18:07:02 +00:00
Owen Anderson 4c54024319 Make the copy constructor of SmallPtrSet much faster.
llvm-svn: 40474
2007-07-24 21:31:23 +00:00
Owen Anderson ee99010782 Remember to free the heap allocated array if we're not going to use it.
llvm-svn: 40043
2007-07-19 06:45:33 +00:00
Owen Anderson e21f270858 Fix an issue where assignments that caused a SmallPtrSet to become non-small
would result in calling realloc() on a null pointer.  Instead, if we encounter
this situation, make a normal call to malloc().

llvm-svn: 40014
2007-07-18 19:54:15 +00:00
Reid Spencer 5060fd0fa3 Unbreak the build by putting calls to free into the implementation file and
having that implementation file #include <cstdlib>.

llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Owen Anderson 81990a3fc3 Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Owen Anderson e33356b18e Make the assignment operator for SmallPtrSet much faster for normal cases.
llvm-svn: 38474
2007-07-09 22:27:20 +00:00
Owen Anderson 3364abbb36 Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy
ctor while I'm at it.

Thanks to Chris Lattner for help with this patch.

llvm-svn: 38470
2007-07-09 20:59:01 +00:00
Owen Anderson aee901745d Fix an error in the assignment operator that was causing an infinite loop in GVNPRE.cpp.
Patch by Chis Lattner.

llvm-svn: 38467
2007-07-09 18:51:15 +00:00
Chris Lattner 85049a470e implement operator= for smallptrset
llvm-svn: 38460
2007-07-09 16:54:03 +00:00
Owen Anderson 6d7b6f1ab8 Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
llvm-svn: 37697
2007-06-22 00:11:18 +00:00
Chris Lattner 836e8f3f39 Two changes:
1. Make SmallPtrSet::erase faster in the small case by replacing a memmove
    with a pointer copy.
 2. Fix a bug where the null terminator at the end of the array in the small
    case was not copied

llvm-svn: 37696
2007-06-21 23:23:32 +00:00
Jeff Cohen e7ce8f23f6 Fix PR1329.
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Chris Lattner e346767f06 do not let the table fill up with tombstones.
llvm-svn: 33973
2007-02-07 01:11:25 +00:00
Chris Lattner 92c5d1185f Fix a bug in smallptrset::erase: in the small case, return true if the
element was in the set.

llvm-svn: 33931
2007-02-05 23:10:31 +00:00
Chris Lattner 39ab70cf80 implement SmallPtrSet::erase
llvm-svn: 33581
2007-01-27 07:59:10 +00:00
Chris Lattner ab5d0ba168 add a note
llvm-svn: 33578
2007-01-27 07:18:32 +00:00
Chris Lattner 74102df857 Add a new SmallSet ADT specialized for pointers.
llvm-svn: 33577
2007-01-27 07:10:46 +00:00