summaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/STLExtras.h
Commit message (Collapse)AuthorAgeFilesLines
* Provide basic type safety for array_pod_sort comparators.Benjamin Kramer2013-09-221-4/+8
| | | | | | | | This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191175 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a function object to compare the first or second component of a std::pair.Benjamin Kramer2013-08-241-0/+16
| | | | | | Replace instances of this scattered around the code base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189169 91177308-0d34-0410-b5e6-96231b3b80d8
* typoAndrew Trick2012-11-161-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168202 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'static' from inline functions defined in header files.Chandler Carruth2012-06-201-5/+5
| | | | | | | | | | | | | | | | | There is a pretty staggering amount of this in LLVM's header files, this is not all of the instances I'm afraid. These include all of the functions that (in my build) are used by a non-static inline (or external) function. Specifically, these issues were caught by the new '-Winternal-linkage-in-inline' warning. I'll try to just clean up the remainder of the clearly redundant "static inline" cases on functions (not methods!) defined within headers if I can do so in a reliable way. There were even several cases of a missing 'inline' altogether, or my personal favorite "static bool inline". Go figure. ;] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158800 91177308-0d34-0410-b5e6-96231b3b80d8
* SparseSet: Add support for key-derived indexes and arbitrary key types.Andrew Trick2012-04-201-1/+11
| | | | | | | | | | | | | | | | | | | This nicely handles the most common case of virtual register sets, but also handles anticipated cases where we will map pointers to IDs. The goal is not to develop a completely generic SparseSet template. Instead we want to handle the expected uses within llvm without any template antics in the client code. I'm adding a bit of template nastiness here, and some assumption about expected usage in order to make the client code very clean. The expected common uses cases I'm designing for: - integer keys that need to be reindexed, and may map to additional data - densely numbered objects where we want pointer keys because no number->object map exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155227 91177308-0d34-0410-b5e6-96231b3b80d8
* move tier out of an anonymous namespace, it doesn't make senseChris Lattner2011-07-211-19/+15
| | | | | | | | | to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135669 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill a couple of unused variables.Eric Christopher2010-08-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112498 91177308-0d34-0410-b5e6-96231b3b80d8
* Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness ofJeffrey Yasskin2010-03-121-0/+22
| | | | | | | several fields to make it easier to figure out where bugs might be creeping in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98358 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r97917, which was causing Clang Debug self-host failures.Douglas Gregor2010-03-081-22/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97932 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.Jeffrey Yasskin2010-03-071-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97917 91177308-0d34-0410-b5e6-96231b3b80d8
* _2_ gcc crashes, ah, ah, ah...Jeffrey Yasskin2010-03-071-22/+0
| | | | | | | (Rolling back r97906.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97909 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by ↵Jeffrey Yasskin2010-03-071-0/+22
| | | | | | Valgrind! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97906 91177308-0d34-0410-b5e6-96231b3b80d8
* cstdlib is not automatically included with StringRef anymore.Benjamin Kramer2009-11-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89359 91177308-0d34-0410-b5e6-96231b3b80d8
* add a version of array_pod_sort that takes a custom comparator function.Chris Lattner2009-11-151-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88861 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the minor mess I caused with removing iterator.h. I shall take care ↵Gabor Greif2009-08-271-1/+1
| | | | | | of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80224 91177308-0d34-0410-b5e6-96231b3b80d8
* STLExtras: Add less_ptr.Daniel Dunbar2009-08-091-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78521 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed lint errors:Misha Brukman2009-02-201-1/+1
| | | | | | | | | * 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
* Removed trailing whitespace.Misha Brukman2009-01-091-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62000 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo.Nick Lewycky2009-01-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61554 91177308-0d34-0410-b5e6-96231b3b80d8
* reenable array_pod_sort, this time hopefully happy on 64-bit Chris Lattner2008-12-011-9/+12
| | | | | | | and big endian systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60371 91177308-0d34-0410-b5e6-96231b3b80d8
* don't #include <algorithm> into the llvm namespace.Chris Lattner2008-12-011-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60365 91177308-0d34-0410-b5e6-96231b3b80d8
* switch to std::sort until I have time to sort this out.Chris Lattner2008-12-011-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60354 91177308-0d34-0410-b5e6-96231b3b80d8
* define array_pod_sort in terms of operator< instead of my brainChris Lattner2008-12-011-13/+9
| | | | | | | | 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
* don't assume iterators implicitly convert to pointers.Chris Lattner2008-12-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60336 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new array_pod_sort function and switch LSR to use itChris Lattner2008-12-011-1/+38
| | | | | | | | | | 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
* Fix several places that called mapped_iterator's constructor withoutDan Gohman2008-10-161-3/+8
| | | | | | | passing in a function object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57615 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use std::advance just to increment or decrement by one.Dan Gohman2008-07-071-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53189 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"Anton Korobeynikov2008-05-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Add lengthof and endof templates that hide a lot of sizeof computations.Owen Anderson2007-09-071-0/+19
| | | | | | | Patch by Sterling Stein! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41758 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a patch to fix a compile error in STLExtras.h, andChris Lattner2007-05-031-1/+1
| | | | | | | | | a bug in GraphWriter.cpp. Patch by Florian Brandner git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36684 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some more dead templates and a dead macro.Chris Lattner2005-02-221-33/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20279 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch of dead templates.Chris Lattner2005-02-221-73/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20275 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-011-4/+4
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Add greater_ptr functor.Alkis Evlogimenos2004-07-211-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15070 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comparator useful for natural comparisons on collections withAlkis Evlogimenos2004-05-301-0/+6
| | | | | | | pointers to objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13909 91177308-0d34-0410-b5e6-96231b3b80d8
* Noone cares about similarity to boostChris Lattner2004-02-241-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11783 91177308-0d34-0410-b5e6-96231b3b80d8
* Add next() and prior() iterator utility functions. Unlike std::advanceAlkis Evlogimenos2004-02-141-23/+37
| | | | | | | | | | | | | | they do not modify the passed iterator but return a copy. next(myIt) returns copy of myIt incremented once next(myIt, n) returns copy of myIt incremented n times prior(myIt) returns copy of myIt decremented once prior(myIt, n) returns copy of myIt decremented n times While at it remove obsolete implementation of mapped_iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11429 91177308-0d34-0410-b5e6-96231b3b80d8
* A better way to get std::pair into the compiler's little, walnut-sized brain.Brian Gaeke2003-11-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10174 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a hack to make this file compile under g++-3.0.x;Brian Gaeke2003-11-231-0/+1
| | | | | | | | otherwise it can't decide what std::pair is. It seemed relatively harmless. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10173 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove needless dependence on boostChris Lattner2003-11-131-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9961 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Add std::pair tier. This is a much simplified version of boost::tieAlkis Evlogimenos2003-11-051-0/+48
| | | | | | | that works only for std::pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9723 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM notice.John Criswell2003-10-201-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9300 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardize header file commentsChris Lattner2003-09-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
* Regularize the names of #include-guards.Brian Gaeke2003-06-171-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6732 91177308-0d34-0410-b5e6-96231b3b80d8
* Add neccesary #includeChris Lattner2002-10-271-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4294 91177308-0d34-0410-b5e6-96231b3b80d8
* disable the unused "pointer" memberChris Lattner2002-10-131-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4144 91177308-0d34-0410-b5e6-96231b3b80d8