Torok Edwin
ce0c81e7dd
Add regular expression matching support, based on OpenBSD regexec()/regcomp()
...
implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 08:24:09 +00:00
Chris Lattner
32e1eef631
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 04:02:06 +00:00
Daniel Dunbar
2571440d1e
Unbreak unit tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79879 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 02:02:58 +00:00
Daniel Dunbar
9441cfe488
Fix off-by-one in llvm::Format::print.
...
- This also shortens the Format.h implementation, and uses the print buffer
fully (it was wasting a character).
- This manifested as llvm-test failures, because one side effect was that
raw_ostream would write garbage '\x00' values into the output stream if it
happened that the string was at the end of the buffer. This meant that grep
would report 'Binary file matches', which meant the silly pattern matching
llvm-test eventually does would fail. Cute. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 20:31:39 +00:00
Chris Lattner
8142ce568d
convert all the constant range EXPECT_EQ tests to use EXPECT_TRUE since
...
ConstantRange doesn't have an std::ostream inserter anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 06:32:25 +00:00
Chris Lattner
0c47a41207
upgrade for removed functions.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 04:47:35 +00:00
Bill Wendling
5504225c2a
Correct for recent assert change.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 06:35:41 +00:00
Erick Tryzelaar
ae8f78d4de
Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 03:15:28 +00:00
Erick Tryzelaar
bb97531a5a
Allow '+' to appear in APInt strings, and add more unit tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21 03:15:14 +00:00
Erick Tryzelaar
c78b33bdc1
Add support for including '+' in APFloat strings, more asserts,
...
and many new unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 23:30:43 +00:00
Daniel Dunbar
cdd93d8c35
Fix two APFloat bugs in converting hexadecimal constants.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:12:33 +00:00
Misha Brukman
36891e6548
Fixed header comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:01:14 +00:00
Daniel Dunbar
9472a9d650
Add min and max tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 19:58:19 +00:00
Benjamin Kramer
d2a5661d32
Remove SmallString::append_*int* unit tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 19:41:05 +00:00
Daniel Dunbar
c2da6fb3e5
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 17:48:28 +00:00
Daniel Dunbar
651aa689cc
Improve Triple to recognize the OS in i386-mingw32.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 19:26:55 +00:00
Daniel Dunbar
323a3e6533
Fix pasto in StringRef::count(char)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 18:34:22 +00:00
Daniel Dunbar
5caba3bcb1
Add StringRef::count({char,StringRef})
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 18:26:35 +00:00
Erick Tryzelaar
2ad40a3663
Wrap unit test death tests in GTEST_HAS_DEATH_TEST
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 00:55:33 +00:00
Erick Tryzelaar
33d7dd6dc8
Change APFloatTest from using ASSERTs to EXPECTs
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 00:14:11 +00:00
Erick Tryzelaar
a15d890c34
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:19 +00:00
Erick Tryzelaar
1b9104ff80
Add failure tests to APInt unit test.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:01 +00:00
Owen Anderson
1d0be15f89
Push LLVMContexts through the IntegerType APIs.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Daniel Dunbar
689ad6ef3f
Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
...
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:33:34 +00:00
Benjamin Kramer
5232f418c6
Fix unit test on FreeBSD. We need to make sure there is enough space to save the pointer even if the memory returned from malloc was already aligned.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 12:31:02 +00:00
Daniel Dunbar
0ad7f9bb2f
StringRef: Add find(char) and find(StringRef).
...
Also, regroup functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:47:15 +00:00
Jeffrey Yasskin
0d5bd59553
To catch bugs like the one fixed in
...
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127 , I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.
This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 19:54:29 +00:00
Owen Anderson
5b1e79e201
Update unit test.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:28:57 +00:00
Jeffrey Yasskin
0a962314fb
Make ExecutionEngine::updateGlobalMapping(GV, NULL) properly remove GV's old
...
address from the reverse mapping, and add a test that this works now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 23:53:16 +00:00
Benjamin Kramer
d6f034b2d0
Remove now empty unit test directory.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 19:07:29 +00:00
Chris Lattner
fbad2cc949
daniel says it's fine to nuke this.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 18:38:21 +00:00
Chris Lattner
27a32604cc
update for new api
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 18:35:49 +00:00
Owen Anderson
5d0bf1bc6f
Fix unit tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 21:38:10 +00:00
Benjamin Kramer
feba7562ec
Update unittest for LLVM API change.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77730 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:56:31 +00:00
Owen Anderson
a7235ea724
Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
...
metadata related, which I'm waiting on to avoid conflicting with Devang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Benjamin Kramer
66e7a97999
Adjust unit test for the MCSection changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 19:12:33 +00:00
Owen Anderson
9e9a0d5fc2
Move more code back to 2.5 APIs.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 23:03:37 +00:00
Daniel Dunbar
0fffbafa96
Twine: Use raw_ostream::write_hex, remove unused itohexstr method.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 18:30:19 +00:00
Benjamin Kramer
20cc4b8cd9
fix a unitialized pointer in NamedMDNode (and reenable unittest)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 15:35:55 +00:00
Daniel Dunbar
0165a2ca89
Twine: Provide [u]int{32,64} conversions via implicit constructors instead of
...
explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 03:47:15 +00:00
Daniel Dunbar
bb916fbadd
Disable the NamedMDNodeTest, it is failing everywhere.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 02:08:27 +00:00
Devang Patel
fa7c4dcef2
Add NamedMDNode test.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 00:03:41 +00:00
Owen Anderson
debcb01b0f
Move types back to the 2.5 API.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 22:17:13 +00:00
Benjamin Kramer
9138b1909a
Update unittest for LLVM API change.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 19:18:13 +00:00
Benjamin Kramer
4baffeb6be
fix unittest on platforms with unsigned chars (e.g. linux-ppc)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 16:48:32 +00:00
Daniel Dunbar
763457e70b
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 07:08:44 +00:00
Benjamin Kramer
f83264b423
fix unittest
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 22:03:24 +00:00
Benjamin Kramer
b0d3f25b77
Remove trailing slashes from include paths. Some versions of mingw don't like them.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 09:39:18 +00:00
Daniel Dunbar
a14d225ef4
Update Triple to use StringRef/Twine based APIs.
...
- This is now shorter, simpler, safer, and more efficient, what a deal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 03:31:47 +00:00
Daniel Dunbar
d61918fc68
Add StringRef::{slice, split}, two convenient string operations which are simple
...
and efficient on a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 03:18:15 +00:00
Reid Kleckner
7d509134dc
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
...
values. Hopefully this fixes PR4622.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 21:26:02 +00:00
Daniel Dunbar
92ccf70ad4
Finish migrating VMCore to StringRef/Twine based APIs.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 06:02:13 +00:00
Jeffrey Yasskin
f595d6dd9a
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:33:57 +00:00
Owen Anderson
eed707b1e6
Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:12:02 +00:00
Daniel Dunbar
2538f7ab2e
Add Twine ADT.
...
- Not currently used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 07:04:27 +00:00
Reid Kleckner
535c9c3c9d
Fixing unittests on 32-bit Darwin, using 0x...ULL instead of 0x...U .
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 22:27:18 +00:00
Reid Kleckner
10b4fc552f
Re-committing r76828 with the JIT memory manager changes now that the build
...
bots like the BumpPtrAllocator changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 21:46:56 +00:00
Reid Kleckner
8f51a62b41
Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
...
an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:34:13 +00:00
Daniel Dunbar
6316fbcb04
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:17:34 +00:00
Devang Patel
2f9c3b002d
MDString
...
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 02:00:51 +00:00
Reid Kleckner
4bf370698a
Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 01:40:54 +00:00
Devang Patel
104cf9e02b
Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 01:07:34 +00:00
Reid Kleckner
81ce3ed08c
Make the JIT code emitter properly retry and ask for more memory when it runs
...
out of memory, and also make the default memory manager allocate more memory
when it runs out.
Also, switch function stubs and global data over to using the BumpPtrAllocator.
This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs. I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 00:49:59 +00:00
Reid Kleckner
95eb3ad353
Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
...
malloc, so there should be no functional changes to other code.
These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.
I also added some tests which helped me pinpoint some bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 00:30:41 +00:00
Daniel Dunbar
dbe77cfa0b
Support writing a StringRef to a raw_ostream directly.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 17:13:20 +00:00
Ryan Flynn
b714c08eb8
cast signed APInt constructor params to uint64_t to suppress signedness warning
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 16:17:36 +00:00
Daniel Dunbar
f5fdf73238
Add StringRef::{substr, startswith}.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 09:18:49 +00:00
Daniel Dunbar
4cf95d75c6
Add StringRef class, with fixes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 07:28:51 +00:00
Torok Edwin
05717f9a80
unbreak unit-tests on gcc-4.4.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 07:09:05 +00:00
Nick Lewycky
7e7dc45eb1
Fix ConstantRange::unionWith. Also make it work a little hard in some cases to
...
return the smallest union of two ranges instead of just any range that happens
to contain the union.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-19 03:44:35 +00:00
Nick Lewycky
3a4a884c16
Replace intersectWith with maximalIntersectWith. The latter guarantees that
...
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 06:34:42 +00:00
Daniel Dunbar
d370d776aa
Unbreak unittests build.
...
- Reid, please check, I'm not sure if this is what was intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 06:08:49 +00:00
Reid Kleckner
4b1511b027
Add EngineBuilder to ExecutionEngine in favor of the five optional argument EE::create().
...
Also a test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 00:42:18 +00:00
Daniel Dunbar
014db9ddf7
Add SmallString unit test.
...
- Patch by Ryan Flynn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 17:00:06 +00:00
Owen Anderson
9adc0abad3
Move EVER MORE stuff over to LLVMContext.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:09:55 +00:00
Dan Gohman
6084326c3c
Port this unittest to use LLVMContext.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 01:26:26 +00:00
Nick Lewycky
780905e9f9
Fix an error in ConstantRange::getSignedMax on wrapped ranges. Thanks once
...
again to Daniel Dunbar and KLEE!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:50:21 +00:00
Nick Lewycky
ff84de767a
'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127).
...
Found by Daniel Dunbar and KLEE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:17:23 +00:00
Owen Anderson
0a5372ed3e
Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
...
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:09:18 +00:00
Nick Lewycky
f1db120d04
Multiply was very wrong for wrapped ranges. This supplies a half-fix that will
...
generally return Full on all wrapped inputs. "Fixes" PR4545.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 03:27:41 +00:00
Nick Lewycky
cf9e07dea8
Fix a bug summing two full sets. The overflow checking doesn't handle sets as
...
large as the full set, only those one size smaller. Thanks to Daniel Dunbar
who found this bug using Klee!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 02:49:08 +00:00
Daniel Dunbar
614be08dd6
Clarify a FIXME.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 19:45:34 +00:00
Nick Lewycky
956daf0f7f
Implement udiv for ConstantRanges.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 05:18:18 +00:00
Nick Lewycky
b2dcff443c
This is not overly conservative.
...
Some = [10, 2730). A subset of that is [1024..2048) which covers every possible
10-bit pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 02:28:40 +00:00
Nick Lewycky
2ff893f486
Implement ConstantRange::multiply based on the code in LoopVR.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 02:19:05 +00:00
Nick Lewycky
646ca92bfc
Fix handling of max and full set.
...
A full set is a constant range that represents any number. If you take the
umax of that and [5, 10) you end up with [5, INT_MAX] because the values less
than 5 would be umax's against a value which is at least 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 19:22:21 +00:00
Nick Lewycky
44b3e8d796
Break the world's largest unit test down a few logical lines. No semantic
...
changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 18:43:20 +00:00
Dan Gohman
c6f40b6ffb
Don't use a void return type with a function that returns a value.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 13:56:14 +00:00
Owen Anderson
a439ee027b
Fix unit tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 18:58:29 +00:00
Dan Gohman
38b0644761
Revert the part of 75177 that split ConstantRange into two classes, and
...
merge the new functionality and unittests into ConstantRange. Thanks to
Nick Lewycky for pointing out that it isn't necessary to have two separate
classes here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 23:16:10 +00:00
Dan Gohman
a3755d8d36
Add a ConstantSignedRange class, which does for signed integers
...
what ConstantRange does for unsigned integers. Factor out a
common base class for common functionality.
Add some new functions for performing arithmetic on constant
ranges. Some of these are currently just stubbed out with
conservative implementations.
Add unittests for ConstantRange and ConstantSignedRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 22:07:27 +00:00
Jeffrey Yasskin
489393d7b9
Add an option to allocate JITed global data separately from code. By
...
default, this option is not enabled to support clients who rely on
this behavior.
Fixes http://llvm.org/PR4483
A patch to allocate additional memory for globals after we run out is
forthcoming.
Patch by Reid Kleckner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 21:59:57 +00:00
Devang Patel
2214c94bb7
Drop "constant" from
...
!0 = constant metadata !{...}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 21:57:07 +00:00
Devang Patel
320671d265
Update SLotTracker to handle MDNode slots.
...
Simplify MDNode printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 21:44:25 +00:00
Owen Anderson
31895e7359
Hold the LLVMContext by reference rather than by pointer.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 21:22:36 +00:00
Owen Anderson
0b19bb76db
Fix unit tests for LLVMContext+Module.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 18:14:20 +00:00
Dan Gohman
38a253ddf7
Reapply 74494, this time removing the conflicting definition of operator<<
...
in APIntTest.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 20:10:56 +00:00
Daniel Dunbar
697b3780ac
Revert my intentional breakage.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 16:26:57 +00:00
Daniel Dunbar
2a4aa97f0d
Intentionally break a unittest to test my buildbot gtest command.
...
- Apologies in advance for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 16:11:58 +00:00
Daniel Dunbar
44b8472add
Fix order of arguments to EXPECT_EQ
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 19:57:24 +00:00