1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

709 Commits

Author SHA1 Message Date
Owen Anderson
3234d9d040 Owen Anderson 2009-06-15: Use a SmallPtrSet here, for speed and to match df_iterator.
Owen Anderson 2009-06-15: Remember to clear out our maps to prevent crashing.

llvm-svn: 73438
2009-06-15 22:54:48 +00:00
Torok Edwin
a2f0fd169e fix build on VC++2k8.
llvm-svn: 72736
2009-06-02 20:32:59 +00:00
Mike Stump
f39ed4d4f9 Dcoument that the opauque value used to construct QNaNs is truncated
as necessary.

llvm-svn: 72702
2009-06-01 21:02:35 +00:00
Mike Stump
72e70811c8 Add some documentation.
llvm-svn: 72622
2009-05-30 15:19:29 +00:00
Mike Stump
5447116cbb Add support for letting the client choose different flavors of NaNs. Testcase to be
added in clang.

llvm-svn: 72606
2009-05-30 03:49:43 +00:00
Daniel Dunbar
aa01cbb890 Add llvm::triple constructor from arch, vendor, os strings, and recognize
DragonFly OS type.

llvm-svn: 72242
2009-05-22 02:24:11 +00:00
Jay Foad
c934b656f9 Tighten up the asserts in SmallVector::operator[]().
If this causes any new assertion failures that I didn't catch in
testing, the fix is usually to change "&v[0]" to "v.data()" for some
SmallVector v.

llvm-svn: 72221
2009-05-21 19:48:58 +00:00
Jay Foad
16d48d2595 Use v.data() instead of &v[0] when SmallVector v might be empty.
llvm-svn: 72210
2009-05-21 09:52:38 +00:00
Jay Foad
2ca356aa76 Implement new SmallVector::data() methods.
llvm-svn: 72209
2009-05-21 09:00:37 +00:00
Bill Wendling
4698f862f3 Use struct instead of class to make MCVS compile.
llvm-svn: 71600
2009-05-12 21:50:43 +00:00
Douglas Gregor
26745696ef Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.

llvm-svn: 71448
2009-05-11 18:05:52 +00:00
John Mosby
366006cfd3 Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
  and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
  limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
  multi-exit regions in the Machine CFG without
  splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.

llvm-svn: 71438
2009-05-11 17:04:19 +00:00
Chris Lattner
5c8113fab4 add a range insertion method to SmallSet.
llvm-svn: 70817
2009-05-04 02:19:15 +00:00
Stuart Hastings
b3c08d427a Prevent looping when DenseSet is abused.
llvm-svn: 70572
2009-05-01 20:47:53 +00:00
Jay Foad
9768cabf4a Move helper functions for optimizing division by constant into the APInt
class.

llvm-svn: 70488
2009-04-30 10:15:35 +00:00
Bill Wendling
07f3cdb8ba I cast, therefore I think I know what I'm doing.
llvm-svn: 70151
2009-04-26 20:12:38 +00:00
Bill Wendling
d0a7587da5 Use uint64_t instead of unsigned.
llvm-svn: 70148
2009-04-26 19:46:41 +00:00
Chris Lattner
4685a9682f revert an incorrect patch. This causes crashes all over the place on a
64-bit build.

llvm-svn: 70147
2009-04-26 19:44:20 +00:00
Bill Wendling
2233793a0f Suppress warnings about conversion shortening 64-bit to 32-bit.
llvm-svn: 70138
2009-04-26 18:10:20 +00:00
Chris Lattner
aad8bd245f DenseMap.h needs <new> because it explicitly calls operator new/delete.
Patch by John McCall!

llvm-svn: 70068
2009-04-25 19:50:14 +00:00
Owen Anderson
dd6babaa30 Fix for PR3946, in which SmallVector could behave strangely in corner cases.
Patch by Peter Johnson.

llvm-svn: 69785
2009-04-22 07:16:54 +00:00
Douglas Gregor
d2b9d57e20 Add a static APInt::getNumWords
llvm-svn: 68977
2009-04-13 19:43:10 +00:00
Chris Lattner
8d5d3eaf95 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!

llvm-svn: 68785
2009-04-10 15:47:17 +00:00
Chris Lattner
09cab2de98 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!

llvm-svn: 68277
2009-04-02 03:06:26 +00:00
Daniel Dunbar
588d3d1fd6 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
5f34850ba4 Fixed spelling.
llvm-svn: 68248
2009-04-01 21:33:08 +00:00
Chris Lattner
d052c5bb9b Add range insert method for DenseSet and define DenseMapInfo for chars.
Patch by Kevin Fan!

llvm-svn: 68239
2009-04-01 19:50:49 +00:00
Dan Gohman
770f4158e5 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.

llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Douglas Gregor
aaa9263fc6 Allow the use of pointers to const within PointerUnion.
llvm-svn: 68159
2009-03-31 23:19:54 +00:00
Chris Lattner
dd41c286e5 add some accessors so I can play games with DenseMaps.
llvm-svn: 68145
2009-03-31 20:57:23 +00:00
Douglas Gregor
50b29cfe51 Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
llvm-svn: 68126
2009-03-31 18:31:03 +00:00
Douglas Gregor
41ab75e9ef Really, really fix PointerUnion3::is
llvm-svn: 68079
2009-03-31 00:34:31 +00:00
Douglas Gregor
0beaefea25 Make PointerUnion3::get work properly
llvm-svn: 68067
2009-03-30 21:44:13 +00:00
Chris Lattner
ccc73c9327 update comment.
llvm-svn: 68060
2009-03-30 20:44:04 +00:00
Chris Lattner
a172ae1d4f add a PointerUnion3 class and generalize PointerUnion to work with
anything pointer-like, which may or may not actually be a pointer.

llvm-svn: 68056
2009-03-30 20:29:27 +00:00
Chris Lattner
2d00a451cb fix the PointerLikeTypeTraits specialization for PointerIntPair to
allow the traits to be specified as well.

llvm-svn: 68055
2009-03-30 20:28:50 +00:00
Chris Lattner
8e83bd3891 add missing space.
llvm-svn: 67995
2009-03-29 13:26:05 +00:00
Chris Lattner
be9cd842ae add some comments, add a dyn_cast method.
llvm-svn: 67992
2009-03-29 07:03:30 +00:00
Chris Lattner
f3d562df05 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.

llvm-svn: 67990
2009-03-29 06:33:22 +00:00
Chris Lattner
696742399a add helper method.
llvm-svn: 67989
2009-03-29 06:32:46 +00:00
Chris Lattner
2c6632d760 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.

llvm-svn: 67987
2009-03-29 06:06:02 +00:00
Chris Lattner
b71e26c380 Allow a specific PointerIntPair instance to use a specific Pointer trait:
some pointer instances have properties that not all of a type have.

llvm-svn: 67986
2009-03-29 06:02:20 +00:00
Chris Lattner
9dc97aa7bf 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.

llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Chris Lattner
a78775615b rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for
# low bits free, and move to its own header.

llvm-svn: 67973
2009-03-29 00:39:30 +00:00
Chris Lattner
c512533ea0 teach SmallPtrSet that PointerIntPair is "basically a pointer".
llvm-svn: 67970
2009-03-29 00:18:42 +00:00
Chris Lattner
3fb9928af4 declare everything as class to avoid angering the VC++ gods.
llvm-svn: 67931
2009-03-28 07:48:03 +00:00
Chris Lattner
294e633d95 add a traits class for SmallPtrSet that allows us to stick things that are
"basically pointers" into it.

llvm-svn: 67930
2009-03-28 07:44:53 +00:00
Dan Gohman
88094aaaf9 Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin.
llvm-svn: 67856
2009-03-27 18:37:13 +00:00
Duncan Sands
71bb115e1c 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.

llvm-svn: 67844
2009-03-27 15:29:38 +00:00
Chris Lattner
9c7b21d369 Fix PR3860 by correcting a predicate.
llvm-svn: 67473
2009-03-22 19:22:53 +00:00