summaryrefslogtreecommitdiff
path: root/include/llvm/ADT
Commit message (Collapse)AuthorAge
* Fix a use of uninitialized memory in SmallVector's move-assignment operator.Douglas Gregor2014-04-30
| | | | | | | | | When we were moving from a larger vector to a smaller one but didn't need to re-allocate, we would move-assign over uninitialized memory in the target, then move-construct that same data again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207663 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Provide some helpful static_asserts for using operations of theChandler Carruth2014-04-30
| | | | | | | wrong iterator category. These aren't comprehensive, but they have caught the common cases for me and produce much nicer errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207601 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Make the iterator adaptor utility a touch more general byChandler Carruth2014-04-29
| | | | | | | | | requiring full control over the various parameters to the std::iterator concept / trait thing. This is a precursor for adjusting these things to where you can write a bidirectional iterator wrapping a random access iterator with custom increment and decrement logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207487 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Teach PointerUnion to support assignment directly from nullptr toChandler Carruth2014-04-29
| | | | | | clear it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207471 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'.Craig Topper2014-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207394 91177308-0d34-0410-b5e6-96231b3b80d8
* [LCG] Add some pedantry to the use of ptrdiff_t to appease build bots.Chandler Carruth2014-04-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207337 91177308-0d34-0410-b5e6-96231b3b80d8
* [LCG] Eliminate more boiler plate by using the iterator facade baseChandler Carruth2014-04-26
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207336 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark the growing path in SmallVector::push_back as cold.Benjamin Kramer2014-04-26
| | | | | | It's vital for performance that the cold path of push_back isn't inlined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207331 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Use the reference typedefDuncan P. N. Exon Smith2014-04-25
| | | | | | | | | | Actually use the `reference` typedef, and remove the private redefinition of `pointer` since it has no users. Using `reference` exposes a problem with r207257, which specified the wrong `value_type` to `iterator_facade_base` (fixed that too). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207270 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Provide operator->() through iterator_facade_baseDuncan P. N. Exon Smith2014-04-25
| | | | | | | | | | Use the fancy new `iterator_facade_base` to add `scc_iterator::operator->()`. Remove other definitions where `iterator_facade_base` does the right thing. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207257 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Remove non-const operator*()Duncan P. N. Exon Smith2014-04-25
| | | | | | <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207254 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Doxygen-ize comments, NFCDuncan P. N. Exon Smith2014-04-25
| | | | | | <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207251 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Un-inline long functionsDuncan P. N. Exon Smith2014-04-25
| | | | | | | | | These are long functions that really shouldn't be inlined. Otherwise, no functionality change. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207249 91177308-0d34-0410-b5e6-96231b3b80d8
* SCC: Remove redundant inline keywords, NFCDuncan P. N. Exon Smith2014-04-25
| | | | | | | | | Functions declared in line in a class are inlined by default. There's no reason for the `inline` keyword. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207248 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Generalize pointee_iterator to smart pointers by using decltype.Chandler Carruth2014-04-24
| | | | | | Based on review feedback from Dave on the original patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207146 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Attempt to appease another MSVC oddity by moving the injectedChandler Carruth2014-04-24
| | | | | | class name usage into a context we can put typename on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207084 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'.Craig Topper2014-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207083 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Try to appease MSVC by sinking the enable_if from a defaultChandler Carruth2014-04-24
| | | | | | template argument to a default argument to the constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207082 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Factor out the facade aspect of the iterator_adaptor_base into itsChandler Carruth2014-04-24
| | | | | | | | | own CRTP base class for more general purpose use. Add some clarifying comments for the exact way in which the adaptor uses it. Hopefully this will help us write increasingly full featured iterators. This is becoming important as they start to be used heavily inside of ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207072 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Add a generic iterator utility for adapting iterators much likeChandler Carruth2014-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | Boost's iterator_adaptor, and a specific adaptor which iterates over pointees when wrapped around an iterator over pointers. This is the result of a long discussion on IRC with Duncan Smith, Dave Blaikie, Richard Smith, and myself. Essentially, I could use some subset of the iterator facade facilities often used from Boost, and everyone seemed interested in having the functionality in a reasonably generic form. I've tried to strike a balance between the pragmatism and the established Boost design. The primary differences are: 1) Delegating to the standard iterator interface names rather than special names that then make up a second iterator-like API. 2) Using the name 'pointee_iterator' which seems more clear than 'indirect_iterator'. The whole business of calling the '*p' operation 'pointer indirection' in the standard is ... quite confusing. And 'dereference' is no better of a term for moving from a pointer to a reference. Hoping Duncan, and others continue to provide comments on this until we've got a nice, minimal abstraction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207069 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::less instead of < in array_pod_sort's default comparator.Jordan Rose2014-04-23
| | | | | | This makes array_pod_sort portably safe to use with pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207043 91177308-0d34-0410-b5e6-96231b3b80d8
* WhitespaceRui Ueyama2014-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206919 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to check condition after grow()Rui Ueyama2014-04-22
| | | | | | | | | | r206916 was not logically the same as the previous code because the goto statements did not create loop. This should be the same as the previous code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206918 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace loops using goto with plain while loopsRui Ueyama2014-04-22
| | | | | | | | | | Goto statements jumping into previous inner blocks are pretty confusing to read even though in this case they are valid. No reason to not use while loops there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206916 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr with std::unique_ptr in places where it doesn't ↵Benjamin Kramer2014-04-21
| | | | | | | | break the API. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206740 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a couple of redundant copies of SmallVector::operator==.Benjamin Kramer2014-04-18
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206635 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uint -> size_t conversion warning.Matt Arsenault2014-04-18
| | | | | | | | | | This warning is disabled for the LLVM build, but external users of the header can still run into this. Patch by Ke Bai git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206629 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the copy member of StringRef/ArrayRef generic wrt allocators.Benjamin Kramer2014-04-18
| | | | | | | | Doesn't make sense to restrict this to BumpPtrAllocator. While there replace an explicit loop with std::equal. Some standard libraries know how to compile this down to a ::memcmp call if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206615 91177308-0d34-0410-b5e6-96231b3b80d8
* Allocator: Remove ReferenceAdder hack.Benjamin Kramer2014-04-18
| | | | | | | This was a workaround for compilers that had issues with reference collapsing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206612 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Pass the size to the deallocation function. This, on someChandler Carruth2014-04-15
| | | | | | | | | | | | allocation libraries, may allow more efficient allocation and deallocation. It at least makes the interface implementable by the JIT memory manager. However, this highlights problematic overloading between the void* and the T* deallocation functions. I'm looking into a better way to do this, but as it happens, it comes up rarely in the codebase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206265 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DenseMapInfo specialization for PointerUnion. In tree user to land ↵Nick Lewycky2014-04-15
| | | | | | shortly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206253 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM64] Add big endian target arm64_be.James Molloy2014-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206197 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back some typecasts I accidentally lost in r206142.Craig Topper2014-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206143 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-14
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206142 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-13
| | | | | | check instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206129 91177308-0d34-0410-b5e6-96231b3b80d8
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-12
| | | | | | While there make array_lengthof constexpr if we have support for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206112 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement depth_first and inverse_depth_first range factory functions.David Blaikie2014-04-11
| | | | | | | | | | | | | | Also updated as many loops as I could find using df_begin/idf_begin - strangely I found no uses of idf_begin. Is that just used out of tree? Also a few places couldn't use df_begin because either they used the member functions of the depth first iterators or had specific ordering constraints (I added a comment in the latter case). Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T> where you needed iterator_range<idf_iterator<T>>) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206016 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify make_range by using move semanticsDavid Blaikie2014-04-10
| | | | | | | | | Move the iterators into the range the same way the range's ctor moves them into the members. Also remove some redundant top level parens in the return statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205993 91177308-0d34-0410-b5e6-96231b3b80d8
* iterator_range: Add an llvm::make_range() helper method.Jim Grosbach2014-04-10
| | | | | | | | Convenience wrapper to make dealing with sub-ranges easier. Like the iterator_range<> itself, if/when this sort of thing gets standards blessing, it will be replaced by the official version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205987 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-09
| | | | | | check instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-09
| | | | | | to reduce verbosity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205829 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused file.Richard Smith2014-04-07
| | | | | | | | Using this file would result in an odr violation: it defines an llvm::Interval class that conflicts with the one in Analysis/Interval.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205726 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'false' for a bool instead of '0'Craig Topper2014-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205699 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205697 91177308-0d34-0410-b5e6-96231b3b80d8
* Quick fix: Triple::isOSMSVCRT() should be false for targeting cygwin.NAKAMURA Takumi2014-04-06
| | | | | | | | It affected callee's stack pop in x86. It is one of devergences between cygwin and mingw since mingw-gcc-4.6. Added testcases to llvm/test/CodeGen/X86/win32_sret.ll for cygwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205688 91177308-0d34-0410-b5e6-96231b3b80d8
* ArrayRef: use std::vector::data() now that we are building in C++11 modeDmitri Gribenko2014-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205542 91177308-0d34-0410-b5e6-96231b3b80d8
* Shifting into the sign bit is UB as discussed on IRC. Explicitly use theJoerg Sonnenberger2014-03-31
| | | | | | | BitWord type for the constants to avoid this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205257 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused private typedefDmitri Gribenko2014-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205190 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Stop forward-declaring BumpPtrAllocator in a few places.Chandler Carruth2014-03-30
| | | | | | | This is a necessary step to lifting some of its configuration into template parameters rather than runtime parameters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205140 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: initial backend importTim Northover2014-03-29
| | | | | | | | | | | | This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8