Commit Graph

858 Commits

Author SHA1 Message Date
Bill Wendling
3485d25a0e I cast, therefore I think I know what I'm doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 20:12:38 +00:00
Bill Wendling
b14a495c36 Use uint64_t instead of unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 19:46:41 +00:00
Chris Lattner
1e8db00e3b revert an incorrect patch. This causes crashes all over the place on a
64-bit build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 19:44:20 +00:00
Bill Wendling
610cb31ac9 Suppress warnings about conversion shortening 64-bit to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 18:10:20 +00:00
Chris Lattner
11d8fb9609 DenseMap.h needs <new> because it explicitly calls operator new/delete.
Patch by John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 19:50:14 +00:00
Owen Anderson
747972914a Fix for PR3946, in which SmallVector could behave strangely in corner cases.
Patch by Peter Johnson.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 07:16:54 +00:00
Douglas Gregor
17893a5fb6 Add a static APInt::getNumWords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 19:43:10 +00:00
Chris Lattner
5c5f5a2ec2 fix a broken assertion in ilist_iterator, which caused it to crash in the
bad case instead of actually assert.  Bug pointed out by Jakob Stoklund 
Olesen!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 15:47:17 +00:00
Chris Lattner
d0dfbe096d fix overflow checks in SmallVector:
"The code was doing "if (End+NumInputs > Capacity) ...". If End is
close to 0xFFFFFFFF and NumInputs is large, it'll overflow, the
condition will come out false, and the vector won't grow to
accommodate the new elements, and the program will crash in memmove."

Patch by Jeffrey Yasskin!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 03:06:26 +00:00
Daniel Dunbar
23e97b05da 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 21:53:23 +00:00
Misha Brukman
b035842c34 Fixed spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 21:33:08 +00:00
Chris Lattner
dd255a6247 Add range insert method for DenseSet and define DenseMapInfo for chars.
Patch by Kevin Fan!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 19:50:49 +00:00
Dan Gohman
de551f91d8 Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 18:45:54 +00:00
Douglas Gregor
41222823db Allow the use of pointers to const within PointerUnion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 23:19:54 +00:00
Chris Lattner
bdd376ccb2 add some accessors so I can play games with DenseMaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 20:57:23 +00:00
Douglas Gregor
da84b25b13 Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 18:31:03 +00:00
Douglas Gregor
a7425d7fde Really, really fix PointerUnion3::is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 00:34:31 +00:00
Douglas Gregor
2048cdb08e Make PointerUnion3::get work properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 21:44:13 +00:00
Chris Lattner
f54229192c update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 20:44:04 +00:00
Chris Lattner
e8bc475668 add a PointerUnion3 class and generalize PointerUnion to work with
anything pointer-like, which may or may not actually be a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 20:29:27 +00:00
Chris Lattner
c6a4b6b78b fix the PointerLikeTypeTraits specialization for PointerIntPair to
allow the traits to be specified as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 20:28:50 +00:00
Chris Lattner
54e01d06db add missing space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 13:26:05 +00:00
Chris Lattner
3a9fe06bfe add some comments, add a dyn_cast method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 07:03:30 +00:00
Chris Lattner
f341a47d10 When forming sentinels for empty/tombstone, make sure to respect the
pointer's expected number of zero low-bits.

This should fix the breakage I introduced recently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 06:33:22 +00:00
Chris Lattner
ba315c1ee7 add helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 06:32:46 +00:00
Chris Lattner
2491e4657d Add a simple type-safe bit-mangling pointer union class. This allows
you to do things like:

  ///    PointerUnion<int*, float*> P;
  ///    P = (int*)0;
  ///    printf("%d %d", P.is<int*>(), P.is<float*>()); // prints "1 0"
  ///    X = P.get<int*>();     // ok.
  ///    Y = P.get<float*>();   // runtime assertion failure.
  ///    Z = P.get<double*>();  // does not compile.
  ///    P = (float*)0;
  ///    Y = P.get<float*>();   // ok.
  ///    X = P.get<int*>();     // runtime assertion failure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 06:06:02 +00:00
Chris Lattner
540db8bcb8 Allow a specific PointerIntPair instance to use a specific Pointer trait:
some pointer instances have properties that not all of a type have.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 06:02:20 +00:00
Chris Lattner
e30173ac33 Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.

Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.

Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits.  This should allow things 
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> 
because the inner one knows that 2 low bits are free.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 04:32:37 +00:00
Chris Lattner
8ee1b5e916 rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for
# low bits free, and move to its own header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 00:39:30 +00:00
Chris Lattner
4d4177b9b3 teach SmallPtrSet that PointerIntPair is "basically a pointer".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 00:18:42 +00:00
Chris Lattner
1717f3af08 declare everything as class to avoid angering the VC++ gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 07:48:03 +00:00
Chris Lattner
6de6030718 add a traits class for SmallPtrSet that allows us to stick things that are
"basically pointers" into it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 07:44:53 +00:00
Dan Gohman
9c01f2dd0b Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 18:37:13 +00:00
Duncan Sands
76d3838454 Reapply r66415, which was reverted in r66426 for
causing a bootstrap failure.  Bootstraps here on
x86-32-linux and x86-64-linux.  Requested by the
author Gabor Greif who says that a bug that might
have been causing the failure has since been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 15:29:38 +00:00
Chris Lattner
dae2206390 Fix PR3860 by correcting a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22 19:22:53 +00:00
Chris Lattner
3ee87b6f9d add some inline methods for infix operators on sparse vectors,
tidy some df iteration stuff, patch by John Mosby!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21 05:40:09 +00:00
Daniel Dunbar
e889d837a4 Add StringMap::lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66750 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 01:16:06 +00:00
Bill Wendling
9aaa0796ad Revert r66415. It's causing failures during bootstrap builds:
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__muldi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:567: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__lshrdi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:421: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[5]: *** [libgcc/./_lshrdi3.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [libgcc/./_muldi3.o] Error 1
make[5]: *** [libgcc/./_negdi2.o] Error 1


--- Reverse-merging (from foreign repository) r66415 into '.':
U    include/llvm/BasicBlock.h
U    include/llvm/ADT/ilist_node.h
U    include/llvm/CodeGen/SelectionDAG.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/MachineBasicBlock.h
U    include/llvm/Function.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 18:01:33 +00:00
Gabor Greif
5c3e7b1718 in builds without asserts we do not need to allocate the Next pointer in "ghostly" sentinels
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 07:09:01 +00:00
Nick Lewycky
59fad7d933 Remove configurey-fu to autodetect hash_map and hash_set now that they are
no longer used in LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 06:16:26 +00:00
Gabor Greif
c23b8719ef Give sentinel traits the right to determine the policy where the sentinel is kept.
This should result in less indirect memory accesses, less dead writes and tighter code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 20:36:44 +00:00
Gabor Greif
83b5752747 drop support for GCC 2.x as it is hopelessly broken anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65864 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 19:49:29 +00:00
Gabor Greif
b141e397d5 make traits more flexible by splitting out node-related fragment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 10:17:32 +00:00
Gabor Greif
a05764c4fb group friendship
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 15:46:23 +00:00
Gabor Greif
0a0e68a7ea Introduce a new technique for merging BasicBlock with Instruction sentinel by superposition.
This looks dangerous, but isn't because the sentinel is accessed in special way only,
namely the Next and Prev fields of it, and these are guaranteed to exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 08:41:37 +00:00
Ted Kremenek
638b8b446e Correctly implement ImmutableMap::getMaxElement() by getting the actual <key, value> pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 17:28:16 +00:00
Ted Kremenek
1c7a666fce Add ImmutableMap::getMaxElement(), a method that returns the <key,value> pair in a ImmutableMap that has the highest ranked key.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 17:27:18 +00:00
Ted Kremenek
07bf7efa0a Add version of StringsEqualNoCase that takes two null-terminated C-strings and compares up to 'len' characters. I tend to screw up string comparison functions, so anyone who is interested please review this\!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 18:25:30 +00:00
Misha Brukman
085a9ebbc7 Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:54:36 +00:00
Misha Brukman
a2769a33c9 Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:20:18 +00:00
Dan Gohman
38deef9ce5 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 16:37:45 +00:00
Ted Kremenek
3c172a2959 Fix bug where APSInt::operator-- incremented instead of decremented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 22:39:08 +00:00
Chris Lattner
5b22efa614 Add operator->, patch by Ben Laurie!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 17:14:49 +00:00
Ted Kremenek
da5eb71550 Add method 'isSingleton()' to ImmutableSet. This returns true if the set contains exactly one element.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 05:17:02 +00:00
Ted Kremenek
8bb332d45d Add FoldingSet profile method for bools. Patch by Ben Laurie!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64324 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:53:17 +00:00
Bill Wendling
af9b6b264f These function return 'void'. Don't have 'return' return anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 12:31:26 +00:00
Dan Gohman
5471a00977 Change several SmallPtrSetImpl members from public to protected,
to make the encapsulation more clear.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 16:12:23 +00:00
Nick Lewycky
f996831427 Add an API for strings with possible NULLs in the middle. Refactor the other
two AddString methods to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 04:57:08 +00:00
Chris Lattner
4715f6395e fix a pretty serious bug in StringMap where GetOrCreate(strstart,strend, z)
would not set new values to Z.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 01:54:10 +00:00
Chris Lattner
072e99ef9b Fix a bug in getMaxValue/getMinValue to pass the right signedness the
the constructed APSInt, patch suggested by Ben Laurie!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 01:58:19 +00:00
Roman Levenstein
8d8a0c36b7 Fix a bug in BitVector.h. All assignment operations (except the usual
assignment operator) were returning a copy of the bit vector, instead of a
reference! This old semantics probably did not meet the expectations.
With this patch, chained assignments happen to the right object.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 11:07:20 +00:00
Bill Wendling
d10aacea5e Get rid of warning about implicit 64-to-32 bit conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 02:10:33 +00:00
Steve Naroff
2b5326e724 Add explicit this-> (to make the VS compiler happy).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 23:49:23 +00:00
Douglas Gregor
c03c46a6af Fix ilist two-phase name lookup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 22:38:44 +00:00
Dale Johannesen
541ed9fd02 Do not use host floating point types when emitting
ASCII IR; loading and storing these can change the
bits of NaNs on some hosts.  Remove or add warnings
at a few other places using host floating point;
this is a bad thing to do in general.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 20:32:55 +00:00
Dale Johannesen
ed6af24e14 Make special cases (0 inf nan) work for frem.
Besides APFloat, this involved removing code
from two places that thought they knew the
result of frem(0., x) but were wrong.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 00:35:19 +00:00
Dale Johannesen
24b66a83ca Add an IEEE remainder function, which is not
fully implemented yet and not used.  This is
mainly to clarify that APFloat::mod implements
C fmod, not remainder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 18:35:05 +00:00
Chris Lattner
9981b1f156 eliminate use of uint32_t to improve compatibility with cygwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 18:23:14 +00:00
Chris Lattner
2f39b29170 improve compatibility with cygwin, patch by Jay Foad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 22:00:18 +00:00
Duncan Sands
6ea5776f51 Get this building with gcc-4.4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 15:54:57 +00:00
Chris Lattner
3ff704fa2b add a new insertAfter method, patch by Tom Jablin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 07:43:51 +00:00
Misha Brukman
3a54b3dc87 Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 19:25:42 +00:00
Bill Wendling
38593664b0 * Don't explicitly cast "0" to "void*". This doesn't work well with specialized
StringMapEntryInitializer classes. Leave it for the compiler to figure out what
 the type is and what "0" should be transformed into.

* Un-disable the unit tests which test the StringMapEntryInitializer class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 08:26:46 +00:00
Misha Brukman
538fbb5086 Remove extra blank line and space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 06:11:51 +00:00
Misha Brukman
8bb5e99013 * Added unittests for StringMap
* Fixed but in StringMap::clear()
* Removed trailing whitespace

Original patch by Talin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 04:48:20 +00:00
Misha Brukman
e21a6bae80 * Fixed spelling of "sentinel"
* Removed trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 02:21:23 +00:00
Dan Gohman
d68a07650c Tidy up #includes, deleting a bunch of unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:59:02 +00:00
Dan Gohman
2c8a1522db Add several more unimplemented operator overloads to ilist_iterator
to help catch errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 03:22:42 +00:00
Nick Lewycky
ccc776fd83 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 05:01:22 +00:00
Cedric Venet
c1edbfc2ba Add explicit this-> for some member function in templated base class.
These call are probably dependent but VS with /Za don't seems to think so. We need to help him.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 10:55:13 +00:00
Dan Gohman
b79a01111d Move the conversion to intptr_t to a separate statement. This
avoids GCC's warning even on 64-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 17:41:24 +00:00
Ted Kremenek
4cd3145223 Use 'delete []' instead of 'delete' in OwningArray::reset().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 17:28:11 +00:00
Dan Gohman
994fd5354b Use intptr_t instead of unsigned here, which is more appropriate
in a really obscure way, but more importantly has the side effect
of avoiding a GCC warning in the case that IntType is bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 21:28:00 +00:00
Chris Lattner
7f50863e52 add a new pop_back_val method which returns the value popped. This is
heretical from a STL standpoint, but is oh-so-useful for things that 
can't throw exceptions when copied, like, well, everything in LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 07:11:05 +00:00
Chris Lattner
1d93b2e1b6 Fix isIntN to work with APInts > 64 bits. This method is only
used by clang apparently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 23:33:29 +00:00
Chris Lattner
b6bbe6320b add densemap range insertion method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:08:04 +00:00
Chris Lattner
c65fc3bd27 reenable array_pod_sort, this time hopefully happy on 64-bit
and big endian systems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 21:11:25 +00:00
Chris Lattner
7b6113c6e2 don't #include <algorithm> into the llvm namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 19:45:45 +00:00
Chris Lattner
de5debfb58 switch to std::sort until I have time to sort this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 17:00:08 +00:00
Chris Lattner
545fc87454 define array_pod_sort in terms of operator< instead of my brain
damaged approximation.  This should fix it on big endian platforms
and on 64-bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 16:50:01 +00:00
Chris Lattner
4329c42840 don't assume iterators implicitly convert to pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60336 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:50:46 +00:00
Chris Lattner
99d0015735 Introduce a new array_pod_sort function and switch LSR to use it
instead of std::sort.  This shrinks the release-asserts LSR.o file
by 1100 bytes of code on my system.

We should start using array_pod_sort where possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:49:59 +00:00
Eli Friedman
3864cd4cab Fix bogus assertion using getSExtValue for legitimate values, like -1 in
an 128-bit-wide integer.  No testcase; the issue I ran into depends on 
local changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 00:43:48 +00:00
Chris Lattner
012618f0fc add the rest of the comparison routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 19:10:41 +00:00
Chris Lattner
b911824620 fix indentation. std::pair is "isPod" if the first/second are both isPod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 00:50:20 +00:00
Torok Edwin
10ca770020 protect against negative values that would exceed allowed bit width
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:52:45 +00:00
Chris Lattner
b9cf75a15f apparently GCC doesn't believe that I understand C
precedence rules.  Pacify it.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:36:39 +00:00
Duncan Sands
3f7dba7b17 Typo fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 08:03:35 +00:00
Chris Lattner
d63e618212 Fix sentinels to use correctly 'aligned' pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:36:16 +00:00
Chris Lattner
9ac30537aa Fix spello, add DenseMapInfo specialization for PointerIntPair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 01:18:05 +00:00