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

1053 Commits

Author SHA1 Message Date
Reid Spencer
47b01d6acb Add names for some of the operators. This is needed for the macros in
the Interpreter.

llvm-svn: 34872
2007-03-03 05:37:23 +00:00
Reid Spencer
e5244b132b Add isPositive for symmetry with isNegative.
llvm-svn: 34862
2007-03-03 00:24:39 +00:00
Chris Lattner
68244ce570 Fix PR1234 by working around a compiler bug.
llvm-svn: 34845
2007-03-02 18:16:29 +00:00
Evan Cheng
44257955c8 Make it 64-bit safe.
llvm-svn: 34829
2007-03-02 02:31:37 +00:00
Reid Spencer
d86182b19b Add an abs() function to get the absolute value.
llvm-svn: 34819
2007-03-01 23:37:09 +00:00
Reid Spencer
003170430b Add doubleToBits and floatToBits methods.
llvm-svn: 34807
2007-03-01 20:39:01 +00:00
Reid Spencer
90b6227b81 Add bitsToDouble and bitsToFloat methods for re-interpretation of bits as FP.
llvm-svn: 34800
2007-03-01 20:06:51 +00:00
Reid Spencer
6a95676875 Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
llvm-svn: 34789
2007-03-01 17:15:32 +00:00
Reid Spencer
b6dd32889e Add a square root function.
llvm-svn: 34775
2007-03-01 05:39:56 +00:00
Reid Spencer
0f2d45e42c Make APInt a little more friendly to its users:
* Add support for + and - of a uint64_t.
  * Make trunc/sext/zext return *this so it can be chained with other ops
  * Add smin, smax, umin, umax functions for getting min/max values.

llvm-svn: 34742
2007-02-28 17:33:36 +00:00
Reid Spencer
949b3612a8 getActiveWords should return the number of words, not the index of the
highest active words. Increment its result by one.

llvm-svn: 34713
2007-02-28 02:20:49 +00:00
Reid Spencer
355cec42d1 Add some syntactic sugar.
llvm-svn: 34704
2007-02-27 23:47:33 +00:00
Reid Spencer
edbe747bab Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000

llvm-svn: 34695
2007-02-27 21:59:26 +00:00
Reid Spencer
9e66d0921a Improve APInt interface:
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
   need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
   so simple.
3. Simplify sdiv and srem code.

llvm-svn: 34680
2007-02-27 20:24:31 +00:00
Reid Spencer
612dfe195b Allow the RoundDoubleToAPInt function to specify a width to use.
llvm-svn: 34672
2007-02-27 18:22:31 +00:00
Reid Spencer
9bc19eab08 Fix indentation.
llvm-svn: 34643
2007-02-26 21:06:05 +00:00
Reid Spencer
18629544d3 1. Split getValue() into getSExtValue() and getZExtValue() to match
ConstantInt better.
2. Add a getHashValue() method.

llvm-svn: 34641
2007-02-26 20:57:12 +00:00
Reid Spencer
11f19f730c Implement inline methods that make transition of ConstantInt to use APInt
easier to comprehend and might be useful elsewhere.

llvm-svn: 34635
2007-02-26 17:50:32 +00:00
Reid Spencer
1252a271a1 Make isNegative() a const function since it doesn't modify the APInt.
llvm-svn: 34630
2007-02-26 07:45:40 +00:00
Reid Spencer
e8e8ea4fba Add an isNegative method to determine if the APInt's value is negative.
This is much less expensive than a test against zero.

llvm-svn: 34619
2007-02-26 01:20:59 +00:00
Reid Spencer
a4ab1c36d2 Fix clearUnusedBits to not depend on "undefined behavior" of >> operator
when the bit size is equal to the word size. This happens to work out okay
on x86, but might not on other platforms. The change just detects when
there are no bits to clear (because BitWidth is a multiple of the word size)
and returns early.

Also, move some comments from .cpp file into header.

llvm-svn: 34602
2007-02-25 19:26:01 +00:00
Reid Spencer
e7d8a0e3b7 Add a private constructor for efficiency.
llvm-svn: 34580
2007-02-25 07:29:03 +00:00
Reid Spencer
a2a4a55915 Improve documentation.
Make divide function internal (it was briefly external for testing).

llvm-svn: 34557
2007-02-24 09:50:13 +00:00
Reid Spencer
807eadb51a Add a dump() method for debugging.
llvm-svn: 34464
2007-02-21 03:56:12 +00:00
Reid Spencer
2e50b9ed5b Add an internal convenience method for division that urem and udiv use.
llvm-svn: 34448
2007-02-20 08:43:42 +00:00
Reid Spencer
6eb099875c Add some new constants.
llvm-svn: 34398
2007-02-19 03:18:22 +00:00
Reid Spencer
79d2fad9f5 1. "unsigned" -> "uint32_t" to gaurantee its bit width on all platforms.
Size matters in this case.
2. Remove the unused whichByte private function, which was also broken.
3. Remove the non-const overload of the getWord function, getWord() is
   never used as an lvalue.
4. Rename some local variables for clarity (e.g. API -> Result).

llvm-svn: 34390
2007-02-18 18:42:35 +00:00
Reid Spencer
62b55a934b Implement signed output for toString.
Fix bugs in countLeadingZeros and countTrailingZeros.

llvm-svn: 34386
2007-02-18 00:44:22 +00:00
Reid Spencer
9c5efbcef2 Fix bugs introduced by constructor parameter order change.
llvm-svn: 34357
2007-02-17 00:18:01 +00:00
Reid Spencer
d22266f456 Review changes:
1. Function style changes.
2. 80-col violations.
3. Better names for things.
4. Arrange constructors so they all take bit width first.
5. Add named signed and unsigned comparison functions and remove the
   corresponding operators.
6. Remove operator&& and operator|| but provide a getBoolValue function which
   converts to bool as comparison against 0. This allows the normal && and
   || operators to be used as if (X.getBoolValue() && Y.getBoolValue())

Note: this still doesn't function 100% yet. I'm working on the bugs now.
llvm-svn: 34353
2007-02-16 22:36:51 +00:00
Evan Cheng
c17b6ab5f7 Proper fix for the off-by-one bug in clear_unused_bits().
llvm-svn: 34328
2007-02-15 21:38:15 +00:00
Reid Spencer
3b68dab779 Fix an off-by-one bug in computing the index of the word to clear.
llvm-svn: 34326
2007-02-15 20:49:10 +00:00
Reid Spencer
6fd2d9d381 Make sure Capacity gets initialized too.
llvm-svn: 34325
2007-02-15 20:14:06 +00:00
Evan Cheng
ca4cab1cd2 Missing a ;
llvm-svn: 34322
2007-02-15 19:29:05 +00:00
Evan Cheng
f73b1abdea BitVector::reference operator=(const reference& rhs) is unnecessary thanks to autoconvert to bool.
llvm-svn: 34320
2007-02-15 19:21:44 +00:00
Evan Cheng
471e882080 Remove unnecessary checks.
llvm-svn: 34319
2007-02-15 19:18:12 +00:00
Evan Cheng
25a8dc8e25 operator== returns false when two bitvectors have different sizes.
llvm-svn: 34317
2007-02-15 19:16:21 +00:00
Evan Cheng
84142d6607 Merges two resize() variants.
llvm-svn: 34316
2007-02-15 19:12:39 +00:00
Evan Cheng
fe4d7486d2 Clear no longer deleting the bits to avoid mallocs.
llvm-svn: 34315
2007-02-15 19:10:34 +00:00
Evan Cheng
21177a5395 BitVector::count() bugs.
llvm-svn: 34314
2007-02-15 19:09:36 +00:00
Evan Cheng
a916761a3a Eliminate a redundent ctor; eliminate one more potential new [0].
llvm-svn: 34313
2007-02-15 19:05:25 +00:00
Evan Cheng
622cd4bd4d 1 -> 1L since BitWord has type unsigned long.
llvm-svn: 34312
2007-02-15 19:03:23 +00:00
Evan Cheng
a8fcf075f1 Eliminate new[0], just set Bits to NULL.
llvm-svn: 34311
2007-02-15 18:59:15 +00:00
Evan Cheng
2216148289 Inverted the condition by accident.
llvm-svn: 34309
2007-02-15 18:48:41 +00:00
Evan Cheng
7ff021d148 Bug fixes: assignment operator forgot to copy over size; copy ctor forgot to clear unused top bits.
llvm-svn: 34305
2007-02-15 08:15:58 +00:00
Zhou Sheng
9868d8d7db Fix some buges:
1. Make getMinValue() returns the right value.
2. Fix the ByteSwap() crash problem.
3. Make Postfix increment work correctly.
4. Fix some bugs in LogBase2, Hi/LoBits and UDiv.

llvm-svn: 34304
2007-02-15 06:36:31 +00:00
Evan Cheng
0cd0f0f232 Add a BitVector class.
llvm-svn: 34301
2007-02-15 05:56:11 +00:00
Reid Spencer
80ac48cfdf Make some minor improvements to APInt:
1. Make all the operators use uppercase
2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is
   redundant.
3. Turn the class on for compilation.

llvm-svn: 34253
2007-02-13 22:41:58 +00:00
Chris Lattner
3490afcd50 fix a critical bug in smallvector, where it would destroy elements that are
not in its range (!).

llvm-svn: 34230
2007-02-13 07:25:36 +00:00
Zhou Sheng
7b47556f5c 1. Make APInt::shl work correctly and more efficiently.
2. Add functions to support the numberical conversion between APInt and
   double/float.

llvm-svn: 34201
2007-02-12 20:02:55 +00:00
Chris Lattner
d61a01003b add new ShouldRehash method to factor out common code. Fix the dtor to not
delete tombstones.

llvm-svn: 34189
2007-02-11 21:46:36 +00:00
Chris Lattner
15eaaa2bbd do not allow hash table to be filled with tombstones.
llvm-svn: 34186
2007-02-11 21:07:36 +00:00
Chris Lattner
ce3f5f906a Add support for removing elements out of StringMap.
llvm-svn: 34185
2007-02-11 20:58:00 +00:00
Chris Lattner
3a9d38035f Replace the ugly FindValue method with STL-like find methods.
llvm-svn: 34183
2007-02-11 19:49:41 +00:00
Chris Lattner
f1e2e9e259 remove support for stringmap visitors now that iterators exist.
llvm-svn: 34180
2007-02-11 08:22:15 +00:00
Chris Lattner
c3396d5ff8 add iterator support, plus support for size() and empty().
llvm-svn: 34178
2007-02-11 08:12:13 +00:00
Chris Lattner
8a8d0a44a6 Split StringMapEntry construction out of StringMap, into StringMapEntry.
llvm-svn: 34170
2007-02-11 00:10:26 +00:00
Chris Lattner
f686454486 Make find return the appropriate iterator/const_iterator
llvm-svn: 34137
2007-02-10 06:58:17 +00:00
Chris Lattner
025607b8b0 Allow DenseMAp to take an explicit DenseMapKeyInfo
llvm-svn: 34134
2007-02-10 06:34:58 +00:00
Zhou Sheng
20d0f4e319 Eliminates friend function declaration inside APInt, instead, adds public
methods as those global function's internal implementation.

llvm-svn: 34083
2007-02-09 07:48:24 +00:00
Chris Lattner
d16cc5ebcb Rename CStringMap -> StringMap, since it now supports nul characters in the
strings.

llvm-svn: 34064
2007-02-08 19:20:57 +00:00
Chris Lattner
3705cf294c Allow cstringmap to contain strings with nul characters in them.
llvm-svn: 34062
2007-02-08 19:08:37 +00:00
Zhou Sheng
6efcdc8049 As Chris and Reid suggested, remove "isSigned" field from APInt, instead,
add some signed/unsigned arithmetic operation functions into APInt.h to
handle the signed/unsigned issue. These functions will be defined inside a
namespace "APIntOps" which is inside llvm namespace.

llvm-svn: 34053
2007-02-08 14:35:19 +00:00
Lauro Ramos Venancio
30734ef2e7 Fix build error.
include/llvm/ADT/APInt.h:326: error: ‘assert’ was not declared in this scope

llvm-svn: 34002
2007-02-07 16:59:17 +00:00
Zhou Sheng
7881ec420f As Chris suggested, fixed some problems. (This is the first part.)
llvm-svn: 33986
2007-02-07 05:58:38 +00:00
Chris Lattner
2c3df2a958 do not let the table fill up with tombstones.
llvm-svn: 33973
2007-02-07 01:11:25 +00:00
Chris Lattner
672550f0b1 Fix a really subtle bug where the entire hash table could fill with
tombstones, causing subsequent insertions to infinitely loop.

llvm-svn: 33972
2007-02-07 00:55:59 +00:00
Lauro Ramos Venancio
a38cfcb65c Fix build error.
UniqueVector.h:66: error: ‘assert’ was not declared in this scope

llvm-svn: 33961
2007-02-06 14:59:28 +00:00
Zhou Sheng
8eba14bd31 As Reid suggested, fixed some problems.
llvm-svn: 33954
2007-02-06 05:59:47 +00:00
Chris Lattner
7a51f3a520 Simplify this a bit, add an assertion
llvm-svn: 33936
2007-02-05 23:24:48 +00:00
Chris Lattner
4ec6868104 Const method must use const_iterator.
llvm-svn: 33933
2007-02-05 23:18:32 +00:00
Zhou Sheng
4967eb71b1 Add a class APInt to represent arbitrary precision constant integral values.
It is a functional replacement for common case integer type like "unsigned",
"uint64_t", but also allows non-byte-width integer type and large integer
value types such as 3-bits, 15-bits, or more than 64-bits of precision. For
more details, see pr1043.

llvm-svn: 33913
2007-02-05 17:29:16 +00:00
Chris Lattner
41ec7b272f add a version of insert that takes the key and value.
llvm-svn: 33856
2007-02-04 00:42:41 +00:00
Chris Lattner
1113f4c8ee Make SmallSetVector useful
llvm-svn: 33854
2007-02-04 00:30:40 +00:00
Chris Lattner
9758cc5fd2 Various bugfixes
llvm-svn: 33848
2007-02-04 00:12:12 +00:00
Chris Lattner
cfdda5e521 Convert SetVector to be a true adapter class and add SmallSetVector.
llvm-svn: 33846
2007-02-03 23:56:03 +00:00
Chris Lattner
71f7b41b05 8 buckets is way too small to start out with. This was only for testing.
llvm-svn: 33835
2007-02-03 19:30:48 +00:00
Chris Lattner
d4bf1bd958 remove a dead header
llvm-svn: 33820
2007-02-03 03:02:10 +00:00
Chris Lattner
c5f2684ba7 silence annoying warning in release-asserts build
llvm-svn: 33797
2007-02-02 21:19:18 +00:00
Chris Lattner
10292e5997 add find/erase, add const iterators, fix bugs in iterators.
llvm-svn: 33791
2007-02-02 20:34:32 +00:00
Chris Lattner
d0c5814b38 add iterators
llvm-svn: 33790
2007-02-02 19:27:13 +00:00
Chris Lattner
fe31060a23 Add a new dense hash table implementation
llvm-svn: 33751
2007-02-01 07:49:59 +00:00
Chris Lattner
a24a3aaa94 rename DenseMap to IndexedMap.
llvm-svn: 33749
2007-02-01 05:32:05 +00:00
Chris Lattner
e61728144b rename DenseMap -> IndexedMap.
llvm-svn: 33748
2007-02-01 05:28:10 +00:00
Chris Lattner
d9c5442b61 add missing ctor
llvm-svn: 33714
2007-01-31 20:08:34 +00:00
Chris Lattner
302032e482 provide a definition for uintptr_t
llvm-svn: 33592
2007-01-27 23:52:33 +00:00
Chris Lattner
38f873d682 Make SmallSet<whatever*, N> faster by transparently implementing it with
SmallPtrSet.  Some clients will need to use SmallPtrSet directly though if
they need to iterate over the set.

llvm-svn: 33584
2007-01-27 08:20:15 +00:00
Chris Lattner
4307892029 add some missing API
llvm-svn: 33583
2007-01-27 08:19:03 +00:00
Chris Lattner
8360d61860 Give SmallSet a reasonable fallback if it gets large: use an std::set.
llvm-svn: 33582
2007-01-27 08:14:53 +00:00
Chris Lattner
2ca5edd29e implement SmallPtrSet::erase
llvm-svn: 33581
2007-01-27 07:59:10 +00:00
Chris Lattner
cc42c6a00d Fix a limitation of SmallPtrSet. Before it would assert if the smallsize
was not a power of two.  Now it rounds up to the next power of two internally.

llvm-svn: 33580
2007-01-27 07:52:27 +00:00
Chris Lattner
6e11e4fb50 add some comments on the algorithm
llvm-svn: 33579
2007-01-27 07:24:51 +00:00
Chris Lattner
22513a4828 Add a new SmallSet ADT specialized for pointers.
llvm-svn: 33577
2007-01-27 07:10:46 +00:00
Chris Lattner
a0210a8d2b simplify insert interface
llvm-svn: 33567
2007-01-27 02:13:58 +00:00
Chris Lattner
8e8ec41bea clean up comment
llvm-svn: 33566
2007-01-27 01:14:20 +00:00
Chris Lattner
c7e278045f fit in 80 cols
llvm-svn: 33553
2007-01-26 21:48:40 +00:00
Chris Lattner
14958b0a08 fix typo
llvm-svn: 33459
2007-01-23 04:59:58 +00:00
Chris Lattner
213c43eaed make the SmallSet interface more std::set-like
llvm-svn: 33458
2007-01-23 01:16:19 +00:00
Chris Lattner
e24cf7736b add a trivial SmallSet class, which operates on a similar principle to
SmallVector.

llvm-svn: 33456
2007-01-23 00:59:15 +00:00
Reid Spencer
f1f0b585a8 For PR1094:
Make the SetVector::iterator be the vector's const_iterator.

llvm-svn: 33279
2007-01-17 02:22:18 +00:00
Chris Lattner
87e0f0787e eliminate constructor from Statistic class. It is now impossible to get a
static constructor for them :).   Transition complete.

llvm-svn: 32710
2006-12-19 23:17:40 +00:00
John Criswell
3b18f0e184 Added operator methods to the Statistic class; some LLVM projects depend
on these.

llvm-svn: 32701
2006-12-19 22:55:57 +00:00
Chris Lattner
c18ec8716e Refactor statistic a big and introduce a horrible-but-necessary macro
(STATISTIC), which allows us to define statistics that don't introduce
static ctors into the .o files.  I'm migrating code over to use this
incrementally.

llvm-svn: 32687
2006-12-19 21:27:47 +00:00
Bill Wendling
899c552208 Removed llvm_ostream and used std::ostream instead.
llvm-svn: 32658
2006-12-18 21:59:00 +00:00
Bill Wendling
7f6a73eb5c Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Chris Lattner
9c52dc6c34 Change the implementation of statistic to not need destructors at all.
Instead, the stat info is printed when llvm_shutdown() is called.
These also don't need static ctors, but getting rid of them is uglier:
still investigating.  This reduces the number of static dtors in llvm from
~1400 to ~750.

llvm-svn: 32372
2006-12-08 20:00:42 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
e626f6de68 merge the Statistic and StatisticBase classes, eliminating virtual methods
and eliminating #includes from the Statistic.h file.

llvm-svn: 32282
2006-12-06 18:20:44 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Bill Wendling
5def3648f4 Support for llvm_ostreams.
llvm-svn: 31988
2006-11-28 23:31:42 +00:00
Chris Lattner
339c732e0b Add a helper function
llvm-svn: 31981
2006-11-28 22:32:35 +00:00
Bill Wendling
4157840bd6 Added a temporary hack to get the llvm-streams to work for future checkins.
llvm-svn: 31978
2006-11-28 22:21:29 +00:00
Jeff Cohen
e1003da1a2 Unbreak VC++ build.
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Jim Laskey
c770e68c11 Allow FoldingSet clients to pump up the initial hash size.
llvm-svn: 31377
2006-11-02 14:21:26 +00:00
Chris Lattner
5c33fa2a37 add a new form of insert.
llvm-svn: 31290
2006-10-30 05:07:51 +00:00
Chris Lattner
9a99a284dc Add SmallString a (currently) minimal class that adapts SmallVector to be
more string-like.

llvm-svn: 31289
2006-10-30 03:39:20 +00:00
Chris Lattner
593e2361b4 add a method
llvm-svn: 31288
2006-10-30 03:14:15 +00:00
Chris Lattner
08b405916c add newline at end of file
llvm-svn: 31287
2006-10-29 23:47:01 +00:00
Chris Lattner
1db6efc297 add a highly efficient hash table that is specialized for mapping C strings
to some other type.

llvm-svn: 31286
2006-10-29 23:42:03 +00:00
Jim Laskey
e65b6c3c60 Clean up
llvm-svn: 31238
2006-10-27 22:52:02 +00:00
Jim Laskey
3d1116e32c Apply editorials.
llvm-svn: 31218
2006-10-27 18:05:12 +00:00
Jim Laskey
69b57830c2 Breakout folding hash set from SelectionDAGCSEMap.
llvm-svn: 31215
2006-10-27 16:16:16 +00:00
Andrew Lenharth
6223a6ce63 Fix build error in gcc 3.4 and make more this general
llvm-svn: 30839
2006-10-09 19:05:44 +00:00
Chris Lattner
e3f0524253 Fix PR897
llvm-svn: 30820
2006-10-08 22:28:34 +00:00
Chris Lattner
7453a7d197 add a simple reserve method.
llvm-svn: 30011
2006-09-01 06:08:16 +00:00
Chris Lattner
e84b1b8352 Instantiate Statistic<> in one place, not in every .o file that uses it.
llvm-svn: 29971
2006-08-30 04:17:00 +00:00
Chris Lattner
4fa85705f6 Add 2nd form of resize
llvm-svn: 29945
2006-08-28 21:52:08 +00:00
Chris Lattner
a6735ae8d1 add resize, move swap out of line
llvm-svn: 29823
2006-08-22 17:28:57 +00:00
Chris Lattner
19d59ce917 add a bunch more operations, including swap, insert, erase, front(), and
bugfixes for operator=.

llvm-svn: 29811
2006-08-22 06:27:16 +00:00
Chris Lattner
402986c13f silence a warning.
llvm-svn: 29734
2006-08-16 22:09:24 +00:00
Chris Lattner
2cd25d1642 Bugfixes for smallvector when the element size is small and N is small.
llvm-svn: 29720
2006-08-16 01:23:31 +00:00
Chris Lattner
67305e3cf6 avoid a warning
llvm-svn: 29674
2006-08-14 21:47:50 +00:00
Chris Lattner
870808beda move code out of line so that GCC doesn't inline it at -O3
llvm-svn: 29636
2006-08-11 23:40:23 +00:00
Chris Lattner
6c9bcb32a3 Split SmallVector into SmallVector and SmallVectorImpl, which allows us to
eliminate code duplication due to the 'N' parameter.

llvm-svn: 29634
2006-08-11 23:19:51 +00:00
Chris Lattner
5f8473bc02 capacity is a pointer, not a value
llvm-svn: 29564
2006-08-08 01:54:17 +00:00
Chris Lattner
03c7b425a2 add a new assign method
llvm-svn: 29562
2006-08-08 01:44:16 +00:00
Chris Lattner
3bb43d2173 Add ctor that initializes from a range.
llvm-svn: 29560
2006-08-08 00:37:50 +00:00
Chris Lattner
3e1a9b0188 Remove assertions from the SmallVector class. They slow down clients of
smallvector too much in a release build.  Removing them speeds up isel 4%.

llvm-svn: 29556
2006-08-07 23:41:59 +00:00
Chris Lattner
a4af471488 Add a clear method to SmallVector
llvm-svn: 29542
2006-08-07 05:45:34 +00:00
Chris Lattner
3bf9d47cf1 Silence a warning on x86-64, reported by chandlerc.
llvm-svn: 29535
2006-08-06 18:12:50 +00:00
Evan Cheng
627a71290f This causes some random crashes.
llvm-svn: 29534
2006-08-05 17:31:00 +00:00
Chris Lattner
b0bf058d33 The smallvector dtor should destroy the elements.
Implement pop_back.
Chage some code to use 'iterator' instead of T*.  This unbreaks operators=.

llvm-svn: 29380
2006-07-28 05:03:42 +00:00
Chris Lattner
f2d0e0296a Use std::copy instead of custom loops to take advantage of STL optimizations.
Add a new append method for appending a range.

llvm-svn: 29323
2006-07-27 03:38:08 +00:00
Chris Lattner
d4d69f64dd Add a new llvm::SmallVector template, which is similar to the vector class, but
contains optimizations to avoid heap allocation if the vector size is smaller
than some threshold.  This can significantly improve the performance of code
that allocates many small vectors by eliminating tons of small malloc/free's.

llvm-svn: 29281
2006-07-26 06:22:30 +00:00
Chris Lattner
6548505f71 Add two helper functions
llvm-svn: 29150
2006-07-14 22:54:06 +00:00
Chris Lattner
a396e6d9ba Add some out-of-line virtual dtors so that the class has a "home", preventing
vtables for (e.g.) Instruction from being emitted into every .o file.

llvm-svn: 28898
2006-06-21 16:53:47 +00:00
Reid Spencer
bbc22e1a8a Favor C++ casts over C casts in C++ code.
llvm-svn: 28622
2006-06-01 07:03:53 +00:00
Chris Lattner
2429ec5fdf Fix utostr once and for all, by making there only be one function named
utostr.  To keep the efficiency in the 32-bit case, make it check to see if
the value is 32-bits and if so switch over to the faster 32-bit case.

llvm-svn: 28601
2006-05-31 21:25:50 +00:00
Andrew Lenharth
ed197672a8 Fix build breakage on alpha, without causing it on x86. as a bonus, all platforms can invent the same number of unique names now
llvm-svn: 28596
2006-05-31 20:18:28 +00:00
Andrew Lenharth
3338cc0b80 revert for now
llvm-svn: 28595
2006-05-31 19:16:26 +00:00
Andrew Lenharth
ec7c3a9662 make 64-bit safe and fix the build on alpha
llvm-svn: 28593
2006-05-31 18:56:42 +00:00
Reid Spencer
574d4e6992 For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.

llvm-svn: 28453
2006-05-24 19:21:13 +00:00
Chris Lattner
ed45ad33b7 Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!

llvm-svn: 26313
2006-02-22 16:23:43 +00:00
Chris Lattner
27ca00bcf7 add some methods for case-insensitive string compares
llvm-svn: 25659
2006-01-26 20:36:29 +00:00
Jim Laskey
bf023c019d Use find instead of lower_bounds.
llvm-svn: 25657
2006-01-26 20:30:51 +00:00
Jim Laskey
f6b249fb50 Add support to find existing entries.
llvm-svn: 25654
2006-01-26 20:09:35 +00:00
Chris Lattner
b1b6b1d541 This only needs <iosfwd> not <iostream>
llvm-svn: 25517
2006-01-22 23:43:45 +00:00
Evan Cheng
a9c4d32e7e Suppress "no newline at end of file" warnings.
llvm-svn: 25400
2006-01-17 19:21:01 +00:00
Jim Laskey
38e4ff875d Reduce memory consumption and force (somewhat) access to entries via ID.
llvm-svn: 25393
2006-01-17 16:29:58 +00:00
Jim Laskey
bf73e50cc5 Redundant inline keyword.
llvm-svn: 25377
2006-01-16 23:44:03 +00:00
Jim Laskey
9f2391c897 UniqueVector template provides a means of enumerating objects uniquely.
llvm-svn: 25376
2006-01-16 23:29:43 +00:00
Chris Lattner
2fbfb322b1 Remove a now-dead map, patch by Saem Ghani, thanks!
llvm-svn: 24629
2005-12-07 05:41:44 +00:00
Chris Lattner
18a2c21fc0 Implement external storage for post-order iteration, implementing PR267
Patch by Saem Ghani, thanks!

llvm-svn: 24617
2005-12-06 07:05:27 +00:00
Jeff Cohen
ca14516b15 Fix comment.
llvm-svn: 24004
2005-10-26 15:02:21 +00:00
Jeff Cohen
342597c279 Eliminate use of sed in Visual Studio builds.
llvm-svn: 24003
2005-10-26 14:48:53 +00:00
Misha Brukman
14a6b6e354 Wrap long lines
llvm-svn: 23009
2005-08-24 14:03:07 +00:00
Reid Spencer
124828d796 Remove some tabs.
Wrap a line.

llvm-svn: 23008
2005-08-24 10:57:30 +00:00
Chris Lattner
a6da5575c8 add a method
llvm-svn: 22985
2005-08-23 21:45:31 +00:00
Nate Begeman
68cd6aa245 Add some operators the PowerPC backend needs to efficiently and correctly
generate conditional branches.

llvm-svn: 22214
2005-06-15 18:28:44 +00:00
Misha Brukman
e2e8059814 Convert tabs to spaces
llvm-svn: 21703
2005-05-05 22:30:40 +00:00
Misha Brukman
d292737471 Convert tabs to spaces
llvm-svn: 21436
2005-04-22 03:27:20 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
5c37c87195 Provide a guaranteed definition of intptr_t. Thansk to Evan Jones for
pointing this out!

llvm-svn: 20721
2005-03-21 01:36:35 +00:00
Misha Brukman
c85dd5e38e Constant-propagate the value of `isL' variable and eliminate it.
llvm-svn: 20698
2005-03-19 23:39:50 +00:00
Jeff Cohen
c5c4aa7911 Silence VC++ warning about mixing intptr_t and bool, and about unused variable isL.
llvm-svn: 20697
2005-03-19 22:36:39 +00:00
Chris Lattner
19068b431e Two fixes for the copy ctor/operator=:
1. Make sure to clear() 'this' before adding elements to it
  2. Make sure that the leaders of the RHS EC are the leaders of the LHS EC.

llvm-svn: 20692
2005-03-19 21:02:12 +00:00
Chris Lattner
d9b3369aa9 add some methods, fix a major bug in getLeader() that was causing things to
not be unified correctly.

llvm-svn: 20691
2005-03-19 20:42:43 +00:00
Chris Lattner
e4d74b8d85 implement a proper copy ctor, operator= and add a helper method.
llvm-svn: 20690
2005-03-19 19:26:14 +00:00
Chris Lattner
b3103a3768 Rewrite this class, making the following improvements:
1. It now actually uses tarjan's algorithm, so it is a efficient inverse
     ackerman's function for union operations, not linear time.
  2. It now stores one copy of the data in the set instead of two.
  3. It now works for elements other than pointers.
  4. It now has a more STL-like interface that exposes iterators instead
     of internal implementation details.

llvm-svn: 20677
2005-03-19 05:14:29 +00:00
Chris Lattner
e0b373b2c3 remove compat_iterator, which is dead in the tree.
llvm-svn: 20644
2005-03-16 22:42:45 +00:00
Jeff Cohen
b169eae709 Don't provide default hash struct instantiation.
llvm-svn: 20639
2005-03-16 05:49:06 +00:00
Jeff Cohen
f52b95ac20 Add adapter class to let VC++ hash_map use GCC's hash struct.
llvm-svn: 20637
2005-03-16 05:25:09 +00:00
Chris Lattner
a43f090dcd remove some more dead templates and a dead macro.
llvm-svn: 20279
2005-02-22 23:36:37 +00:00
Chris Lattner
2024801b74 Remove a bunch of dead templates.
llvm-svn: 20275
2005-02-22 23:19:42 +00:00
Chris Lattner
382abe80a0 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Chris Lattner
3a8cb1178e Rename createNode -> createSentinal.
Add a new method, destroySentinal, that is used to delete it (instead of
requiring use of delete.

llvm-svn: 19921
2005-01-29 18:40:19 +00:00
Reid Spencer
dab05f06a4 Convert some old C-style casts to C++ style.
llvm-svn: 19868
2005-01-28 07:22:20 +00:00
Reid Spencer
5d058e0ec8 Provide support for HP/UX aCC compiler's variant of hash_map and hash_set
(RogueWave). These are implemented in rw/stdex/hash_map.h and
rw/stdex/hash_set.h on HP/UX.

llvm-svn: 19600
2005-01-16 02:58:39 +00:00
Chris Lattner
61bed2fe76 Do not let 'ftostr' return a string that starts with spaces. This allows
the AsmWriter to emit FP constants like 1.0 in normal exponential notation
instead of hex notation.

llvm-svn: 19279
2005-01-04 01:56:28 +00:00
Chris Lattner
5cc8fcda9e Define the pointer hash struct before the string one, to improve compatibility
with ICC.  Patch contributed by Bjørn Wennberg.

llvm-svn: 18663
2004-12-08 20:59:18 +00:00
Chris Lattner
6d1fb33657 ignore generated files
llvm-svn: 18073
2004-11-21 00:01:54 +00:00
Chris Lattner
ae45589b0f Use explicit std:: qualification to avoid relying on Koenig lookup, which
VC++ does not do properly.  Thanks to Morten Ofstad for the patch!

llvm-svn: 16955
2004-10-13 15:11:23 +00:00
Chris Lattner
a4756fd6be Get rid of template templates that were preventing VC from compiling the
set_intersect template.  Thanks to Morten Ofstad and Jeff Cohen for the
patch!

llvm-svn: 16954
2004-10-13 15:09:21 +00:00
Chris Lattner
4463fcc2f8 Fix #include flavor
llvm-svn: 16658
2004-10-04 18:10:18 +00:00
Alkis Evlogimenos
dbf62db0d0 Remove whitespace from the end of the line.
llvm-svn: 16624
2004-09-30 21:39:47 +00:00
Alkis Evlogimenos
4f5920aaef Add includes and use std:: for standard library calls to make code
compile on windows. This patch was contributed by Paolo Invernizzi.

llvm-svn: 16539
2004-09-28 14:42:44 +00:00
John Criswell
8e633294c2 Updated the last two header files so that they are configured with
AC_CONFIG_HEADERS.  This should prevent LLVM from needlessly re-compiling
on a re-configure.

llvm-svn: 16510
2004-09-24 21:19:06 +00:00
John Criswell
bd7cfd3d74 Modified hash_map and hash_set configuration so that they are not
regenerated on every run of configure.

llvm-svn: 16509
2004-09-24 18:28:00 +00:00
Reid Spencer
c362a7299b Fix the replace method to assert if an item was erased from the set but not
found in the vector. Previously, it just ignored this condition.

llvm-svn: 16296
2004-09-11 20:38:25 +00:00
Reid Spencer
605f05bd5a Implement the remove method for deleting entries from the SetVector.
llvm-svn: 16283
2004-09-11 04:25:58 +00:00
Chris Lattner
4c2703cbea Add missing #include
llvm-svn: 16256
2004-09-09 02:37:56 +00:00
Alkis Evlogimenos
2fd7ccfb9c Pull in definition of std::unary_function.
llvm-svn: 16140
2004-09-02 03:24:45 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00