Commit Graph

417 Commits

Author SHA1 Message Date
Jeffrey Yasskin
8e68c38735 Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 00:58:24 +00:00
Jakob Stoklund Olesen
2a6899c539 Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:04:46 +00:00
Jakob Stoklund Olesen
d715e07efe Add more checks to IntervalMapOverlaps::advance() to ensure that advanceTo sees
monotonic keys.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 22:07:54 +00:00
Jakob Stoklund Olesen
5049ee5b11 It is allowed to call IntervalMap::const_iterator::advanceTo() with a key that
moves the iterator to end(), and it is valid to call it on end().

That means it is valid to call advanceTo() with any monotonic key sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 22:07:51 +00:00
Jakob Stoklund Olesen
4aec85ae01 Fix crash when IntervalMapOverlaps::advanceTo moves past the last overlap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 19:18:38 +00:00
Jakob Stoklund Olesen
90675c882d Complete tests for IntervalMapOverlaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:31:49 +00:00
Jakob Stoklund Olesen
460ee0fd19 Add basic test exposing many bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 19:46:09 +00:00
Michael J. Spencer
5029159fbe Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 17:04:04 +00:00
Frits van Bommel
729b2949d7 CMake: Fix warning in gtest header used by unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 10:22:07 +00:00
Jay Foad
40f8f6264d PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 08:25:19 +00:00
NAKAMURA Takumi
b3d37e3097 unittests/CMakeLists.txt: Tweak unittests' layout to be identical to GNU build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 07:41:23 +00:00
Michael J. Spencer
936671b2ea Support/PathV2: Remove the error_code return type from all functions in the path
namespace. None of them return anything except for success anyway. These will be
converted to returning their result soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:37 +00:00
Michael J. Spencer
ee271d8758 Support/PathV2: Move make_absolute from path to fs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:17 +00:00
Michael J. Spencer
753cbbbd3c Support/FileSystem: Add directory_iterator implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:42 +00:00
Michael J. Spencer
9ad8221bcb Unittests/Support/PathV2: Add FileSystem tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 03:18:42 +00:00
Jakob Stoklund Olesen
7a26aca73f Add IntervalMap::iterator::set{Start,Stop,Value} methods that allow limited
editing of the current interval.

These methods may cause coalescing, there are corresponding set*Unchecked
methods for editing without coalescing. The non-coalescing methods are useful
for applying monotonic transforms to all keys or values in a map without
accidentally coalescing transformed and untransformed intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:02:00 +00:00
Michael J. Spencer
106aa731bf Support/FileSystem: Add remove implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:43 +00:00
Benjamin Kramer
6d6d16a5fc unittests/Support/PathV2: remove(3) requires a terminated string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 12:33:32 +00:00
Michael J. Spencer
371716cdee Unittests/Support/PathV2: Cleanup and remove output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:22:34 +00:00
Michael J. Spencer
12a4cf2c23 unittests/Support/PathV2: Comment out test because some systems are saying that
a file exists when it shouldn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:10:30 +00:00
Michael J. Spencer
3cb84ef65d Support/FileSystem: Add unique_file and exists implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:28 +00:00
Michael J. Spencer
506e579aa0 Make valgrind happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:28:42 +00:00
Michael J. Spencer
7dc7ac3cb2 Support/ADT/Twine: Add toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:37:30 +00:00
Michael J. Spencer
eb21e3c225 unittests/Support/PathV2: Fix -pedantic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:23:49 +00:00
Jay Foad
7a874ddda0 PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 08:53:58 +00:00
Michael J. Spencer
ce2b68fb54 Support/PathV2: Add is_{absolute,relative} implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 06:21:53 +00:00
Michael J. Spencer
ae18008584 Support/PathV2: Add has_{root_path,root_name,root_directory,parent_path,filename,stem,extension} implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 06:03:50 +00:00
Michael J. Spencer
1d3896232a unittests/Support/PathV2: Make tests much shorter; although harder to understand.
I'm going to replace this all anyway with a proper table and separated tests
when done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 06:03:33 +00:00
Michael J. Spencer
5265f22f45 Support/PathV2: Add extension implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:37:41 +00:00
Michael J. Spencer
34ab1f6087 Support/PathV2: Add stem implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:18:33 +00:00
Michael J. Spencer
a979355994 Support/PathV2: Add filename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 03:18:17 +00:00
Michael J. Spencer
722d5adac1 Support/PathV2: Add native implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 02:48:27 +00:00
Michael J. Spencer
52ed867801 Support/PathV2: Add replace_extension implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 00:52:55 +00:00
Michael J. Spencer
dbfb56bebd Support/PathV2: Add remove_filename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 00:52:28 +00:00
Michael J. Spencer
a42cf73c77 Support/PathV2: Implement reverse iteration and parent_path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 23:28:07 +00:00
Michael J. Spencer
1f9864063f Support/PathV2: Fix 80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 23:35:49 +00:00
Michael J. Spencer
013d15a677 unittests: Merge SystemTests back into SupportTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 22:29:04 +00:00
Michael J. Spencer
dffde99644 Support: Add PathV2 implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 22:28:51 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Jakob Stoklund Olesen
5f456cda98 Disallow overlapping inserts, even when inserting the same value.
We always disallowed overlapping inserts with different values, and this makes
the insertion code smaller and faster.

If an overwriting insert is needed, it can be added as a separate method that
trims any existing intervals before inserting. The immediate use cases for
IntervalMap don't need this - they only use disjoint insertions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 22:17:11 +00:00
Jakob Stoklund Olesen
9a08ca318e Add default constructors for iterators.
These iterators don't point anywhere, and they can't be compared to anything.
They are only good for assigning to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 07:21:48 +00:00
Jakob Stoklund Olesen
180e1247ca Implement const_iterator::advanceTo().
This is a version of find() that always searches forwards and is faster for
local searches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 07:00:46 +00:00
Jakob Stoklund Olesen
055942529b Add more tests for erase(). Fix a few exposed bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 22:56:53 +00:00
Jakob Stoklund Olesen
b0b7214fc9 Add test case with randomly ordered insertions, massive coalescing.
Implement iterator::erase() in a simple version that erases nodes when they
become empty, but doesn't try to redistribute elements among siblings for better
packing.

Handle coalescing across leaf nodes which may require erasing entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-27 21:12:36 +00:00
NAKAMURA Takumi
b9dec1f928 unittests/JITTests: Don't use --export-dynamic but --export-all-symbols on cygming.
GNU ld/PECOFF accepts but ignores them below;
  --version-script
  --export-dynamic
  --rpath

FIXME: autoconf should be aware of them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 09:32:02 +00:00
Jakob Stoklund Olesen
53bb5c009b Add B+-tree test case that creates a height 3 tree with a smaller root node.
Change temporary debugging code to write a dot file directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 06:54:20 +00:00
Michael J. Spencer
0f020f788d google test depends on Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:35:15 +00:00
Michael J. Spencer
861ef4b1cf unittests: Add initial Path-V2 test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:20:28 +00:00
Michael J. Spencer
f2ca4cb86d unittests: Add SystemTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:20:05 +00:00
Ted Kremenek
9c336fabd5 Tweak ImmutableMap/ImmutableSet/ImmutableList APIs
to use lowercase letters for the start of most
method names and to replace some method names
with more descriptive names (e.g., "getLeft()"
instead of "Left()").  No real functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 00:54:28 +00:00