summaryrefslogtreecommitdiff
path: root/include/llvm/ADT
Commit message (Collapse)AuthorAge
* Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with ↵David Blaikie2014-06-23
| | | | | | | | | | | | private, but non-deleted, move members. Certain versions of GCC (~4.7) couldn't handle the SFINAE on access control, but with "= delete" (hidden behind a macro for portability) this issue is worked around/addressed. Patch by Agustín Bergé git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211525 91177308-0d34-0410-b5e6-96231b3b80d8
* Code in LoopStrengthReduce.cpp depends on SmallBitVector::size() being size_tYaron Keren2014-06-20
| | | | | | | | and not unsigned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211356 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting size_type for the containers from size_type to unsigned. Yaron Keren2014-06-20
| | | | | | | | | | | | | | Various places in LLVM assume that container size and count are unsigned and do not use the container size_type. Therefore they break compilation (or possibly executation) for LP64 systems where size_t is 64 bit while unsigned is still 32 bit. If we'll ever that many items in the container size_type could be made size_t for a specific containers after reviweing its other uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211353 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempting to fix the 64 bit bots.Yaron Keren2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211351 91177308-0d34-0410-b5e6-96231b3b80d8
* The count() function for STL datatypes returns unsigned, even where it'sYaron Keren2014-06-20
| | | | | | | | | | | | | | | | | | | only 1/0 result like std::set. Some of the LLVM ADT already return unsigned count(), while others still return bool count(). In continuation to r197879, this patch modifies DenseMap, DenseSet, ScopedHashTable, ValueMap:: count() to return size_type instead of bool, 1 instead of true and 0 instead of false. size_type is typedef-ed locally within each class to size_t. http://reviews.llvm.org/D4018 Reviewed by dblaikie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211350 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add StringMap::insert(pair) consistent with the standard associative ↵Rafael Espindola2014-06-20
| | | | | | | | | | | | container concept." This reverts commit r211309. It looks like it broke some bots: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211328 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringMap::insert(pair) consistent with the standard associative ↵David Blaikie2014-06-19
| | | | | | | | container concept. Patch by Agustín Bergé. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211309 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit DWARF info for all code section in an assembly fileOliver Stannard2014-06-19
| | | | | | | | | | Currently, when using llvm as an assembler, DWARF debug information is only generated for the .text section. This patch modifies this so that DWARF info is emitted for all executable sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211273 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove OwningPtr.h and associated testsAlp Toker2014-06-19
| | | | | | llvm::OwningPtr is superseded by std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211259 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT: correct typo in commentEd Maste2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add specialization of FoldingSetTrait for std::pair.Manuel Klimek2014-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210990 91177308-0d34-0410-b5e6-96231b3b80d8
* Using llvm::sys::swapByteOrder() for the common case of byte-swapping a ↵Artyom Skrobov2014-06-14
| | | | | | value in place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210978 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-14
| | | | | | | | The next commit will add swapByteOrder(), acting in-place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210973 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert StringMapEntry::Create to use StringRef instead of start/end ↵Craig Topper2014-06-11
| | | | | | pointers. Simpliies all in tree call sites. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210638 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: support resize(N) with move-only typesDavid Blaikie2014-06-09
| | | | | | | | | | | | | | | Unfortunately there's no way to elegantly do this with pre-canned algorithms. Using a generating iterator doesn't work because you default construct for each element, then move construct into the actual slot (bad for copy but non-movable types, and a little unneeded overhead even in the move-only case), so just write it out manually. This solution isn't exception safe (if one of the element's ctors calls we don't fall back, destroy the constructed elements, and throw on - which std::uninitialized_fill does do) but SmallVector (and LLVM) isn't exception safe anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210495 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: More movable improvements - don't copy elements to make space ↵David Blaikie2014-06-08
| | | | | | | | when inserting repeated elements. Also split and improve tests a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210433 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: Move, don't copy, elements to make space for an insertion.David Blaikie2014-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210432 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some more moving-from-moved-from objects issues in SmallVectorDavid Blaikie2014-06-08
| | | | | | | | (& because it makes it easier to test, this also improves correctness/performance slightly by moving the last element in an insert operation, rather than copying it) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210429 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure SmallVector::insert doesn't overwrite the last element in the range ↵David Blaikie2014-06-08
| | | | | | | | | | | | | | with the already-moved-from value This would cause the last element in a range to be in a moved-from state after an insert at a non-end position, losing that value entirely in the process. Side note: move_backward is subtle. It copies [A, B) to C-1 and down. (the fact that it decrements both the second and third iterators before the first movement is the subtle part... kind of surprising, anyway) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210426 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT: introduce isWindowsItaniumEnvironmentSaleem Abdulrasool2014-06-06
| | | | | | | | Add an isWindowsItaniumEnvironment function to Triple to mirror the other Windows environments. This is simply a utility function to check if we are targeting windows-itanium rather than windows-msvc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210383 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement one operator== with another.Rafael Espindola2014-06-03
| | | | | | Thanks for David Blaikie for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210107 91177308-0d34-0410-b5e6-96231b3b80d8
* Add operator== and operator!= to compare with nullptr.Rafael Espindola2014-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210100 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last unspecified_bool_type from llvm.Rafael Espindola2014-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210076 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Delete the Twine assignment operatorReid Kleckner2014-05-29
| | | | | | | | | This makes it slightly harder to misuse Twines. It is still possible to refer to destroyed temporaries with the regular constructors, though. Patch by Marco Alesiani! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209832 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to placate compilers that warn on casts between pointer-to-object andRichard Smith2014-05-23
| | | | | | | pointer-to-function types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209490 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r208506: DebugInfo: Include lexical scopes in inlined subroutines.David Blaikie2014-05-14
| | | | | | | | | | | | | | | | | | | | This was reverted in r208642 due to regressions surrounding file changes within lexical scopes causing inlining information to be lost. The issue was in LexicalScopes::getOrCreateInlinedScope, where I was previously testing "isLexicalBlock" which is false for "DILexicalBlockFile" (a scope used to represent changes in the current file name) and assuming it was then a function (breaking out of the inlined scope path and reaching for the parent non-inlined scopes). By inverting the condition and testing for "isSubprogram" the correct behavior is attained. (also found some weirdness in Clang, see r208742 when reducing this test case - the resulting test case doesn't apply with the Clang fix, but I've added a more realistic test case to inline-scopes.ll which does reproduce the issue and demonstrate the fix) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208748 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "DebugInfo: Include lexical scopes in inlined subroutines."David Blaikie2014-05-12
| | | | | | | | | This reverts commit r208506. Some inlined subroutine scopes appear to be missing with this change. Reverting while I investigate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208642 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Include lexical scopes in inlined subroutines.David Blaikie2014-05-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208506 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed formattingDavid Blaikie2014-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208362 91177308-0d34-0410-b5e6-96231b3b80d8
* StringMap: Move assignment and move construction.David Blaikie2014-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208361 91177308-0d34-0410-b5e6-96231b3b80d8
* StringMap: Replace faux-copyability with faux-movability, which is sufficient.David Blaikie2014-05-08
| | | | | | | | | | This behavior was added to support StringMaps of StringMaps, default + move construction are sufficient for this. Real move construction support coming soon (& probably copy construction too). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208360 91177308-0d34-0410-b5e6-96231b3b80d8
* StringMap support for move-only values.David Blaikie2014-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208359 91177308-0d34-0410-b5e6-96231b3b80d8
* Add isOSFreeBSD triple testEd Maste2014-05-08
| | | | | | | For http://reviews.llvm.org/D3448 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208309 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r208025, reverted in r208030, with a fix for a conformance issueRichard Smith2014-05-06
| | | | | | | which GCC detects and Clang does not! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208033 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r208025, which made buildbots unhappy for unknown reasons.Richard Smith2014-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208030 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::function_ref (and a couple of uses of it), representing a ↵Richard Smith2014-05-06
| | | | | | type-erased reference to a callable object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208025 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field hash_state::seed.Jay Foad2014-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207703 91177308-0d34-0410-b5e6-96231b3b80d8
* 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