aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
Commit message (Collapse)AuthorAgeFilesLines
* I cast, therefore I think I know what I'm doing.Bill Wendling2009-04-261-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70151 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uint64_t instead of unsigned.Bill Wendling2009-04-261-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70148 91177308-0d34-0410-b5e6-96231b3b80d8
* revert an incorrect patch. This causes crashes all over the place on aChris Lattner2009-04-261-6/+4
| | | | | | | 64-bit build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70147 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress warnings about conversion shortening 64-bit to 32-bit.Bill Wendling2009-04-261-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70138 91177308-0d34-0410-b5e6-96231b3b80d8
* DenseMap.h needs <new> because it explicitly calls operator new/delete.Chris Lattner2009-04-251-0/+1
| | | | | | | Patch by John McCall! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70068 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR3946, in which SmallVector could behave strangely in corner cases.Owen Anderson2009-04-221-2/+2
| | | | | | | Patch by Peter Johnson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69785 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a static APInt::getNumWordsDouglas Gregor2009-04-131-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68977 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a broken assertion in ilist_iterator, which caused it to crash in theChris Lattner2009-04-101-1/+1
| | | | | | | | | 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
* fix overflow checks in SmallVector:Chris Lattner2009-04-021-4/+4
| | | | | | | | | | | | | "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
* Add llvm::Triple class for abstracting access to target triples.Daniel Dunbar2009-04-011-0/+196
| | | | | | | | | | | - 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
* Fixed spelling.Misha Brukman2009-04-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68248 91177308-0d34-0410-b5e6-96231b3b80d8
* Add range insert method for DenseSet and define DenseMapInfo for chars.Chris Lattner2009-04-012-0/+18
| | | | | | | | Patch by Kevin Fan! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68239 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-013-3/+7
| | | | | | | | 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
* Allow the use of pointers to const within PointerUnion.Douglas Gregor2009-03-311-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68159 91177308-0d34-0410-b5e6-96231b3b80d8
* add some accessors so I can play games with DenseMaps.Chris Lattner2009-03-311-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68145 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop guessing, start thinking, and make PointerUnion3::is actually be correct.Douglas Gregor2009-03-311-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68126 91177308-0d34-0410-b5e6-96231b3b80d8
* Really, really fix PointerUnion3::isDouglas Gregor2009-03-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68079 91177308-0d34-0410-b5e6-96231b3b80d8
* Make PointerUnion3::get work properlyDouglas Gregor2009-03-301-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68067 91177308-0d34-0410-b5e6-96231b3b80d8
* update comment.Chris Lattner2009-03-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68060 91177308-0d34-0410-b5e6-96231b3b80d8
* add a PointerUnion3 class and generalize PointerUnion to work withChris Lattner2009-03-301-15/+120
| | | | | | | 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
* fix the PointerLikeTypeTraits specialization for PointerIntPair toChris Lattner2009-03-301-2/+4
| | | | | | | 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
* add missing space.Chris Lattner2009-03-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67995 91177308-0d34-0410-b5e6-96231b3b80d8
* add some comments, add a dyn_cast method.Chris Lattner2009-03-291-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67992 91177308-0d34-0410-b5e6-96231b3b80d8
* When forming sentinels for empty/tombstone, make sure to respect theChris Lattner2009-03-292-6/+17
| | | | | | | | | 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
* add helper method.Chris Lattner2009-03-291-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67989 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a simple type-safe bit-mangling pointer union class. This allows Chris Lattner2009-03-291-0/+132
| | | | | | | | | | | | | | | | | | 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
* Allow a specific PointerIntPair instance to use a specific Pointer trait:Chris Lattner2009-03-291-3/+2
| | | | | | | 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
* Replace the PointerLikeTypeTraits::getNumLowBitsAvailableChris Lattner2009-03-291-9/+39
| | | | | | | | | | | | | | | | | 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
* rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for Chris Lattner2009-03-292-29/+6
| | | | | | | # 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
* teach SmallPtrSet that PointerIntPair is "basically a pointer".Chris Lattner2009-03-291-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67970 91177308-0d34-0410-b5e6-96231b3b80d8
* declare everything as class to avoid angering the VC++ gods.Chris Lattner2009-03-281-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67931 91177308-0d34-0410-b5e6-96231b3b80d8
* add a traits class for SmallPtrSet that allows us to stick things that areChris Lattner2009-03-281-5/+36
| | | | | | | "basically pointers" into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67930 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin.Dan Gohman2009-03-271-28/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67856 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r66415, which was reverted in r66426 forDuncan Sands2009-03-271-9/+28
| | | | | | | | | | 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
* Fix PR3860 by correcting a predicate.Chris Lattner2009-03-221-8/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67473 91177308-0d34-0410-b5e6-96231b3b80d8
* add some inline methods for infix operators on sparse vectors,Chris Lattner2009-03-212-13/+41
| | | | | | | 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
* Add StringMap::lookup.Daniel Dunbar2009-03-121-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66750 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r66415. It's causing failures during bootstrap builds:Bill Wendling2009-03-091-28/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* in builds without asserts we do not need to allocate the Next pointer in ↵Gabor Greif2009-03-091-9/+28
| | | | | | "ghostly" sentinels git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66415 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove configurey-fu to autodetect hash_map and hash_set now that they areNick Lewycky2009-03-095-523/+0
| | | | | | | no longer used in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66406 91177308-0d34-0410-b5e6-96231b3b80d8
* Give sentinel traits the right to determine the policy where the sentinel is ↵Gabor Greif2009-03-041-8/+37
| | | | | | | | 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
* drop support for GCC 2.x as it is hopelessly broken anywayGabor Greif2009-03-021-15/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65864 91177308-0d34-0410-b5e6-96231b3b80d8
* make traits more flexible by splitting out node-related fragmentGabor Greif2009-02-281-6/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65690 91177308-0d34-0410-b5e6-96231b3b80d8
* group friendshipGabor Greif2009-02-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65633 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new technique for merging BasicBlock with Instruction sentinel ↵Gabor Greif2009-02-271-0/+4
| | | | | | | | | 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
* Correctly implement ImmutableMap::getMaxElement() by getting the actual ↵Ted Kremenek2009-02-231-1/+1
| | | | | | <key, value> pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65327 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ImmutableMap::getMaxElement(), a method that returns the <key,value> ↵Ted Kremenek2009-02-232-0/+16
| | | | | | 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
* Add version of StringsEqualNoCase that takes two null-terminated C-strings ↵Ted Kremenek2009-02-211-0/+19
| | | | | | 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
* Removed trailing whitespace.Misha Brukman2009-02-202-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65197 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed lint errors:Misha Brukman2009-02-2015-23/+30
| | | | | | | | | * 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