Daniel Dunbar
73e76a1d60
Fix a few more conversion warnings on 4.0
...
llvm-svn: 82232
2009-09-18 17:48:05 +00:00
Daniel Dunbar
0ec4ed7b74
Another try at fixing compile warnings on 4.0
...
llvm-svn: 82148
2009-09-17 17:46:53 +00:00
Daniel Dunbar
4498168753
Add StringRef::{rfind, rsplit}
...
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Daniel Dunbar
6ced391121
Attempt to fix some 4.0.0 build warnings.
...
llvm-svn: 81752
2009-09-14 02:38:53 +00:00
Daniel Dunbar
da30ecdcdd
Simplify, now that gtest supports raw_ostream directly.
...
llvm-svn: 81102
2009-09-06 02:31:26 +00:00
Daniel Dunbar
bc52e4fe73
Add test for PR4873, which works for me.
...
llvm-svn: 80965
2009-09-03 22:57:02 +00:00
Chris Lattner
0ffe0e096d
split raw_os_ostream out to its own header and implementation file. This
...
means that raw_ostream no longer has to #include <iosfwd>. Nothing in llvm
should use raw_os_ostream.h, but llvm-gcc and some unit tests do.
llvm-svn: 79886
2009-08-24 04:02:06 +00:00
Daniel Dunbar
40b384eade
Unbreak unit tests.
...
llvm-svn: 79879
2009-08-24 02:02:58 +00:00
Bill Wendling
ef793ccbdc
Correct for recent assert change.
...
llvm-svn: 79601
2009-08-21 06:35:41 +00:00
Erick Tryzelaar
dadb1571b7
Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.
...
llvm-svn: 79593
2009-08-21 03:15:28 +00:00
Erick Tryzelaar
1264bcb4de
Allow '+' to appear in APInt strings, and add more unit tests.
...
llvm-svn: 79592
2009-08-21 03:15:14 +00:00
Erick Tryzelaar
da666c801c
Add support for including '+' in APFloat strings, more asserts,
...
and many new unit tests.
llvm-svn: 79574
2009-08-20 23:30:43 +00:00
Daniel Dunbar
bf5998edfb
Fix two APFloat bugs in converting hexadecimal constants.
...
llvm-svn: 79540
2009-08-20 17:12:33 +00:00
Benjamin Kramer
902ccf22b4
Remove SmallString::append_*int* unit tests.
...
llvm-svn: 79451
2009-08-19 19:41:05 +00:00
Daniel Dunbar
825e955e40
Add SmallVector::{capacity,set_size}.
...
- These allow clients to make use of the extra elements in the vector which
have already been allocated, without requiring them to be value initialized.
llvm-svn: 79433
2009-08-19 17:48:28 +00:00
Daniel Dunbar
959323a260
Improve Triple to recognize the OS in i386-mingw32.
...
llvm-svn: 79359
2009-08-18 19:26:55 +00:00
Daniel Dunbar
3828a99ba6
Fix pasto in StringRef::count(char)
...
llvm-svn: 79356
2009-08-18 18:34:22 +00:00
Daniel Dunbar
5736db6527
Add StringRef::count({char,StringRef})
...
llvm-svn: 79354
2009-08-18 18:26:35 +00:00
Erick Tryzelaar
927191f179
Wrap unit test death tests in GTEST_HAS_DEATH_TEST
...
llvm-svn: 79218
2009-08-17 00:55:33 +00:00
Erick Tryzelaar
bc0d74944e
Change APFloatTest from using ASSERTs to EXPECTs
...
llvm-svn: 79216
2009-08-17 00:14:11 +00:00
Erick Tryzelaar
19f63b2e4d
Modify APFloat to take a StringRef instead of a c string.
...
This also adds unit tests to APFloat that mainly tests the
string handling of APFloat, but not much else of it's api.
llvm-svn: 79210
2009-08-16 23:36:19 +00:00
Erick Tryzelaar
2b01eab81c
Add failure tests to APInt unit test.
...
llvm-svn: 79209
2009-08-16 23:36:01 +00:00
Daniel Dunbar
3a1efd11bb
Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
...
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.
llvm-svn: 78885
2009-08-13 02:33:34 +00:00
Daniel Dunbar
a1e04d43c4
StringRef: Add find(char) and find(StringRef).
...
Also, regroup functions.
llvm-svn: 78712
2009-08-11 20:47:15 +00:00
Daniel Dunbar
bd8556e0fb
Twine: Use raw_ostream::write_hex, remove unused itohexstr method.
...
llvm-svn: 77617
2009-07-30 18:30:19 +00:00
Daniel Dunbar
e8b3236284
Twine: Provide [u]int{32,64} conversions via implicit constructors instead of
...
explicitly.
llvm-svn: 77576
2009-07-30 03:47:15 +00:00
Benjamin Kramer
a6d0436b97
fix unittest on platforms with unsigned chars (e.g. linux-ppc)
...
llvm-svn: 77471
2009-07-29 16:48:32 +00:00
Daniel Dunbar
b49994ad7e
Twines: Support numeric conversion directly (uitostr, etc).
...
- Provides static constructors for doing number to string conversions without
using temporaries.
- There are several ways to do this, I think given the Twine constraints this
is the simplest one.
- One FIXME for fast number -> hex conversion.
- Added another comment on one last major bit of perf work Twines need, which
is to make raw_svector_ostream more efficient.
llvm-svn: 77445
2009-07-29 07:08:44 +00:00
Daniel Dunbar
19e7076ddd
Update Triple to use StringRef/Twine based APIs.
...
- This is now shorter, simpler, safer, and more efficient, what a deal.
llvm-svn: 77119
2009-07-26 03:31:47 +00:00
Daniel Dunbar
56563f33f7
Add StringRef::{slice, split}, two convenient string operations which are simple
...
and efficient on a StringRef.
llvm-svn: 77117
2009-07-26 03:18:15 +00:00
Jeffrey Yasskin
f4e1db1722
Add a missing ilist_node.h #include to SparseBitVector, and add a very short
...
test for it. The test is by no means complete, but it tests the problem I was
fixing.
llvm-svn: 77025
2009-07-25 00:33:57 +00:00
Daniel Dunbar
afcf5b30cb
Add Twine ADT.
...
- Not currently used.
llvm-svn: 76956
2009-07-24 07:04:27 +00:00
Daniel Dunbar
5bf72e20eb
Convert StringMap to using StringRef for its APIs.
...
- Yay for '-'s and simplifications!
- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.
- NIFC.
llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Daniel Dunbar
e23388b25c
Support writing a StringRef to a raw_ostream directly.
...
llvm-svn: 76754
2009-07-22 17:13:20 +00:00
Daniel Dunbar
1f982105a6
Add StringRef::{substr, startswith}.
...
llvm-svn: 76559
2009-07-21 09:18:49 +00:00
Daniel Dunbar
25f9fc5851
Add StringRef class, with fixes.
...
llvm-svn: 76543
2009-07-21 07:28:51 +00:00
Torok Edwin
e32cd94b47
unbreak unit-tests on gcc-4.4.
...
llvm-svn: 76542
2009-07-21 07:09:05 +00:00
Daniel Dunbar
e5df197e70
Add SmallString unit test.
...
- Patch by Ryan Flynn!
llvm-svn: 76081
2009-07-16 17:00:06 +00:00
Daniel Dunbar
6d6023b5f7
Clarify a FIXME.
...
llvm-svn: 75422
2009-07-12 19:45:34 +00:00
Dan Gohman
10f1733d9a
Reapply 74494, this time removing the conflicting definition of operator<<
...
in APIntTest.cpp.
llvm-svn: 74550
2009-06-30 20:10:56 +00:00
Daniel Dunbar
ec6fdb6750
Revert my intentional breakage.
...
llvm-svn: 74531
2009-06-30 16:26:57 +00:00
Daniel Dunbar
c9de159696
Intentionally break a unittest to test my buildbot gtest command.
...
- Apologies in advance for the noise.
llvm-svn: 74530
2009-06-30 16:11:58 +00:00
Misha Brukman
67a1ffa59c
Reversed order of args in EXPECT_EQ() macros to be in the correct order:
...
EXPECT_EQ(expected, actual) . This will make error messages understandable as
it uses terms such as "expected" and "actual" based on the order of arguments.
llvm-svn: 73150
2009-06-09 21:48:57 +00:00
Stuart Hastings
e54523d56e
Prevent looping when DenseSet is abused.
...
llvm-svn: 70572
2009-05-01 20:47:53 +00:00
Chris Lattner
b869a0ade1
Fix PR4040: APInt's string constructor is too strict
...
patch by Jeff Yasskin!
llvm-svn: 70058
2009-04-25 18:34:04 +00:00
Owen Anderson
d4f5537c5e
Use the testcase from PR2791.
...
llvm-svn: 69846
2009-04-23 00:15:26 +00:00
Misha Brukman
680336d12f
* Fixed calls to APInt ctor to work for negative values on Darwin/x86
...
* Converted C-style casts to C++-style casts
llvm-svn: 68613
2009-04-08 16:17:23 +00:00
Daniel Dunbar
4abd56677d
Add llvm::Triple class for abstracting access to target triples.
...
- The code is silly, I'm just amusing myself. Rewrite to be efficient
if you like. :)
Also, if you wish to debate the proper names of the triple components
I'm all ears.
llvm-svn: 68252
2009-04-01 21:53:23 +00:00
Misha Brukman
d1d2c50ea7
Converted a1.ll to unittests.
...
llvm-svn: 67652
2009-03-24 21:36:09 +00:00
Misha Brukman
5182b758a0
Renamed unittest files to have a consistent {Tt}est suffix.
...
llvm-svn: 67326
2009-03-19 19:09:48 +00:00