Commit Graph

331 Commits

Author SHA1 Message Date
Benjamin Kramer
837bccd052 StringRef::compare_numeric also differed from StringRef::compare for characters > 127.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:25:35 +00:00
Benjamin Kramer
0043e35b82 Do unsigned char comparisons in StringRef::compare_lower to be more consistent with compare in corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 14:21:08 +00:00
Bill Wendling
d400850101 Silence 'unused' warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 18:52:02 +00:00
Anton Korobeynikov
462aaeb178 This patch enables "make unittests" on enable-shared/mingw.
Patch by Takumi Nakamura!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 19:34:40 +00:00
Duncan Sands
335db22392 Add a 'normalize' method to the Triple class, which takes a mucked up
target triple and straightens it out.  This does less than gcc's script
config.sub, for example it turns i386-mingw32 into i386--mingw32 not
i386-pc-mingw32, but it does a decent job of turning funky triples into
something that the rest of the Triple class can understand.  The plan
is to use this to canonicalize triple's when they are first provided
by users, and have the rest of LLVM only deal with canonical triples.
Once this is done the special case workarounds in the Triple constructor
can be removed, making the class more regular and easier to use.  The
comments and unittests for the Triple class are already adjusted in this
patch appropriately for this brave new world of increased uniformity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 11:31:39 +00:00
Nick Lewycky
7f9ef4bb51 Clean up ConstantRange a bit:
- remove ashr which never worked.
 - fix lshr and shl and add tests.
 - remove dead function "intersect1Wrapped".
 - add a new sub method to subtract ranges, with test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 22:04:36 +00:00
Duncan Sands
3850f5ceda Remove the ValueMap copy constructor. It's not used anywhere,
and removing it catches the mistake of passing a ValueMap by
copy rather than by reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 12:57:48 +00:00
Owen Anderson
9773e45a1e Add an inverse() method to ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 05:47:46 +00:00
Owen Anderson
90c579de5a Reapply r110396, with fixes to appease the Linux buildbot gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:33:48 +00:00
Owen Anderson
1f74590e9d Revert r110396 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:23:35 +00:00
Owen Anderson
9ccaf53ada Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:42:04 +00:00
Dan Gohman
ab37f50838 Make SCEVUnknown a CallbackVH, so that it can be notified directly
of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.

This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:49:30 +00:00
Oscar Fuentes
ee56c42168 Prefix next' iterator operation with llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 06:00:15 +00:00
Duncan Sands
bcc2393369 Fix the ValueMap copy constructor. The issue is that the map keys are value
handles with a pointer to the containing map.  When a map is copied, these
pointers need to be corrected to point to the new map.  If not, then consider
the case of a map M1 which maps a value V to something.  Create a copy M2 of
M1.  At this point there are two value handles on V, one representing V as a
key in M1, the other representing V as a key in M2.  But both value handles
point to M1 as the containing map.  Now delete V.  The value handles remove
themselves from their containing map (which destroys them), but only the first
value handle is successful: the second one cannot remove itself from M1 as
(once the first one has removed itself) there is nothing there to remove; it
is therefore not destroyed.  This causes an assertion failure "All references
to V were not removed?".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 05:49:32 +00:00
Bob Wilson
a8ebd2e64f Remove the temporary hack, now that the llvm-i686-linux buildbot has
completed a successful build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 22:55:29 +00:00
Bob Wilson
575be08e8a Fix the temporary hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 22:33:35 +00:00
Daniel Dunbar
0e2b7de10f Temporary hack to ensure stale Analysis dir is cleaned up on llvm-i686-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 22:18:50 +00:00
Eric Christopher
e6cbfa6b09 Speculatively revert r109705 since it seems to be causing some build bot
angst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:25:38 +00:00
Dan Gohman
c6743207e2 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:17:55 +00:00
Chris Lattner
ae7b8b212a missed a use of SizeRequired.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:34:55 +00:00
Chris Lattner
456fdaf0ce instead of migrating it to the MC instruction encoder, just
rip out the implementation of X86InstrInfo::GetInstSizeInBytes.
The code being ripped out just implemented a copy and hacked up
version of the (old) instruction encoder, and is buggy and 
terrible in other ways.  Since "GetInstSizeInBytes" is really 
only there to support the JIT's "NeedsExactSize" hook (which
noone is using), just rip out the code.  I will rip out the
NeedsExactSize hook next.

This resolves rdar://7617809 - switch X86InstrInfo::GetInstSizeInBytes to use X86MCCodeEmitter



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:05:13 +00:00
Gabor Greif
f06eb3719a add dyn_cast_or_null tests, exclude invalid dyn_cast test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 15:37:20 +00:00
Gabor Greif
46a35015f5 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 15:28:30 +00:00
Gabor Greif
d159467ad6 add dyn_cast tests and beef up others a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 15:24:48 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Gabor Greif
b3c90d96bd tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 19:35:55 +00:00
Gabor Greif
e8950977a5 migrate essentially everything from under #ifdef DEBUG_CAST_OPERATORS into this file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 17:06:28 +00:00
Gabor Greif
08993c03ab extend to cast<> and cast_or_null<> tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:51:18 +00:00
Gabor Greif
af8e2ef649 isa<> tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:38:12 +00:00
Gabor Greif
ee57dae3d8 initial checkin for unittest to exercise Support/Casting.h
this is still minimal on purpose, but I plan to migrate the ugly
hack under #ifdef DEBUG_CAST_OPERATORS into this file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:32:20 +00:00
Chris Lattner
e332553eae unit test to go along with r108610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:14:03 +00:00
Chandler Carruth
48b17fa5be Switch from EXPECT_EQ({true,false, ...) to the more canonical
EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about
bool-to-pointer conversion that occurs withit EXPECT_EQ.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 17:28:05 +00:00
Bill Wendling
3732396fe1 Use non-bool values for .count.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 18:56:35 +00:00
Daniel Dunbar
73c6031a25 ADT: Add DAGDeltaAlgorithm, which is a DAG minimization algorithm built on top of the standard 'delta debugging' algorithm.
- This can give substantial speedups in the delta process for inputs we can construct dependency information for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 16:21:22 +00:00
Benjamin Kramer
2e3f44eab2 Disable pthread support in googletest if llvm was configured without threads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 15:17:04 +00:00
Benjamin Kramer
8ef297e945 Turns out gtest still prefers the system <tr1/tuple> over it's own
implementation. Force the internal one to unbreak clang selfhost on linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 07:51:58 +00:00
Benjamin Kramer
4839d872fc Update Readme and Makefiles for the new gtest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 22:02:57 +00:00
Jakob Stoklund Olesen
160a3bf74d Add StringRef::compare_numeric and use it to sort TableGen register records.
This means that our Registers are now ordered R7, R8, R9, R10, R12, ...
Not R1, R10, R11, R12, R2, R3, ...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 21:47:28 +00:00
Daniel Dunbar
f1fd2288f3 Fix const ilist_node::get{Prev,Next}Node() to actually compile. Picky, picky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-13 18:35:02 +00:00
Daniel Dunbar
aa81380353 ADT: Add ilist_node::get{Prev,Next}Node, which return the adjacent node or null.
- This provides a convenient alternative to using something llvm::prior or
   manual iterator access, for example::

    if (T *Prev = foo->getPrevNode())
      ...

   instead of::

     iterator it(foo);
     if (it != begin()) {
       --it;
       ... 
     }

 - Chris, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-12 21:35:19 +00:00
Dan Gohman
3f5e915652 Update BitVectorTest.cpp to stay in sync with SmallBitVectorTest.cpp,
and fix a bug in BitVector's reference proxy class which this exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 20:50:28 +00:00
Benjamin Kramer
6340722d17 SmallBitVector: Rework find_first/find_next and tweak test to test them (at least on 64 bit platforms).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 13:40:27 +00:00
Benjamin Kramer
b252fbd179 Implement a read/write operator[] for SmallBitVector with a proxy class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 12:29:39 +00:00
Chris Lattner
a07cd90a2a silence some unused-value warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101689 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 03:28:20 +00:00
Chris Lattner
2decb22222 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:42:17 +00:00
Benjamin Kramer
f3a3b0fc0e Update unittest for allocator laziness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 15:01:26 +00:00
Chris Lattner
796e64b546 update unit test for api change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:49:48 +00:00
Dan Gohman
a7a33fd95f Fix SmallVector's insert to handle non-random-access iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 18:53:37 +00:00
Gabor Greif
fe7bb05ad1 another one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:59:08 +00:00
Dan Gohman
5ffc72e7ce Make this test more lenient; with SmallVector now using actually
aligned storage, the capacity may be more than what is explicitly
requested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:47:50 +00:00