summaryrefslogtreecommitdiff
path: root/include/llvm/ADT
Commit message (Collapse)AuthorAge
* 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
* Add ARM big endian Target (armeb, thumbeb)Christian Pirker2014-03-28
| | | | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3095 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205007 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalise Windows target triple spellingsSaleem Abdulrasool2014-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | Construct a uniform Windows target triple nomenclature which is congruent to the Linux counterpart. The old triples are normalised to the new canonical form. This cleans up the long-standing issue of odd naming for various Windows environments. There are four different environments on Windows: MSVC: The MS ABI, MSVCRT environment as defined by Microsoft GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries Itanium: The MSVCRT environment + libc++ built with Itanium ABI Cygnus: The Cygwin environment which uses custom libraries for everything The following spellings are now written as: i686-pc-win32 => i686-pc-windows-msvc i686-pc-mingw32 => i686-pc-windows-gnu i686-pc-cygwin => i686-pc-windows-cygnus This should be sufficiently flexible to allow us to target other windows environments in the future as necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204977 91177308-0d34-0410-b5e6-96231b3b80d8
* When destroying a StringMap, just iterate over the map and destroy the ↵Pete Cooper2014-03-19
| | | | | | contained elements. Don't reset them back to 0 as their values aren't needed any more. This results in ~StringMap() being mostly empty for POD types in BumpPtrAllocators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204204 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some assertions on constant expressions static.Benjamin Kramer2014-03-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204011 91177308-0d34-0410-b5e6-96231b3b80d8
* PointerIntPair: Avoid an (academic) case of undefined behavior in the ↵Benjamin Kramer2014-03-15
| | | | | | | | | | | DenseMapInfo specialization. If we use a pair with an enum type this could create values outside of the enum range. Avoid it by creating the bit pattern directly. While there turn a dynamic assert into a static one. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204010 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove copy ctors that did the same thing as the default one.Benjamin Kramer2014-03-11
| | | | | | | The code added nothing but potentially disabled move semantics and made types non-trivially copyable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203563 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing llvm::distance and llvm::copy for iterator_range based on ↵Aaron Ballman2014-03-10
| | | | | | post-commit review feedback. Adding an explicit range-based constructor to SmallVector, which supersedes the llvm::copy functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203460 91177308-0d34-0410-b5e6-96231b3b80d8
* Change documentation based on feedback from Chandler.Ahmed Charles2014-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203393 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Now that we have C++11 and I've replaced the use of thisChandler Carruth2014-03-09
| | | | | | | horrible smart pointer by std::unique_ptr and strict move semantics, rip this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203392 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add llvm::make_unique, according to N3656.Ahmed Charles2014-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203387 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Clean up SmallString a bit"David Blaikie2014-03-09
| | | | | | | | | This reverts commit r203374. Ambiguities in assign... oh well. I'm just going to revert this and probably not try to recommit it as it's not terribly important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203375 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up SmallString a bitDavid Blaikie2014-03-09
| | | | | | | | | | | Move a common utility (assign(iter, iter)) into SmallVector (some of the others could be moved there too, but this one seemed particularly generic) and replace repetitions overrides with using directives. And simplify SmallVector::assign(num, element) while I'm here rather than thrashing these files (that cause everyone to rebuild) again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203374 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding some includes to appease build bots. Amends r203354Aaron Ballman2014-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203356 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding range-based STL-like helper APIs. llvm::distance() is the range ↵Aaron Ballman2014-03-08
| | | | | | version of std::distance. llvm::copy is the range version of std::copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203354 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.Jordan Rose2014-03-07
| | | | | | | | | | Previously, the assertions in PointerIntPair would try to calculate the value (1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were more than 31 bits available we'd get a shift overflow. Also, add a rudimentary unit test file for PointerIntPair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203273 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-07
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203242 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: split object format out of environmentSaleem Abdulrasool2014-03-06
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203160 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort the standard library include lines.Chandler Carruth2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203066 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around MSVC bug in IntrusiveRefCntPtr.hHans Wennborg2014-03-05
| | | | | | | | | | | The build was failing with: error C2664: 'std::atomic_int::atomic_int(const std::atomic_int &)' : cannot convert argument 1 from 'int' to 'const std::atomic_int &' Apparently "std::atomic_int x(0)" doesn't work, but "std::atomic<int> x(0)" does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202988 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ThreadSafeRefCountedBaseBen Langmuir2014-03-05
| | | | | | | A version of RefCountedBase that uses std::atomic_int to store its reference count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202984 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add release() to OwningPtr.Ahmed Charles2014-03-05
| | | | | | | This will make the transition to unique_ptr easier by allowing more incremental changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202949 91177308-0d34-0410-b5e6-96231b3b80d8
* APFloat: Add a move ctor and operator=Benjamin Kramer2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202883 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move ValueMap to the IR library. While this class does notChandler Carruth2014-03-04
| | | | | | | | | | | | directly care about the Value class (it is templated so that the key can be any arbitrary Value subclass), it is in fact concretely tied to the Value class through the ValueHandle's CallbackVH interface which relies on the key type being some Value subclass to establish the value handle chain. Ironically, the unittest is already in the right library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202824 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move ValueHandle into the IR library where Value itself lives.Chandler Carruth2014-03-04
| | | | | | | | | | | Move the test for this class into the IR unittests as well. This uncovers that ValueMap too is in the IR library. Ironically, the unittest for ValueMap is useless in the Support library (honestly, so was the ValueHandle test) and so it already lives in the IR unittests. Mmmm, tasty layering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202821 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202811 91177308-0d34-0410-b5e6-96231b3b80d8
* [C+11] Add 'override' keyword to methods in the support library.Craig Topper2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202791 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove the completely unnecessary requirement on SetVector'sChandler Carruth2014-03-03
| | | | | | | | | | | | remove_if that its predicate is adaptable. We don't actually need this, we can write a generic adapter for any predicate. This lets us remove some very wrong std::function usages. We should never be using std::function for predicates to algorithms. This incurs an *indirect* call overhead for every evaluation of the predicate, and makes it very hard to inline through. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202742 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[C++11] Replace LLVM atomics with std::atomic."Benjamin Kramer2014-03-03
| | | | | | | Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202731 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM atomics with std::atomic.Benjamin Kramer2014-03-03
| | | | | | | | | | | With C++11 we finally have a standardized way to specify atomic operations. Use them to replace the existing custom implemention. Sadly the translation is not entirely trivial as std::atomic allows more fine-grained control over the atomicity. I tried to preserve the old semantics as well as possible. Differential Revision: http://llvm-reviews.chandlerc.com/D2915 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202730 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add an iterator_range class template. This is modeled on theChandler Carruth2014-03-03
| | | | | | | | | | | | | | | | | | | | proposed std::iterator_pair which was in committee suggested to move toward std::iterator_range. There isn't a formal paper yet, but there seems little disagreement within the committee at this point so it seems fine to provide our own version in the llvm namespace so we can easily build range adaptors for the numerous iterators in LLVM's interfaces. Note that I'm not really comfortable advocating a crazed range-based migration just yet. The range stuff is still in a great deal of flux in C++ and the committee hasn't entirely made up its mind (afaict) about how it will work. So I'm mostly trying to provide the minimal functionality needed to make writing easy and convenient range adaptors for range based for loops easy and convenient. ;] Subsequent patches will use this across the fundamental IR types, where there are iterator views. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202686 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Pass unique_ptr by value instead of &&.Ahmed Charles2014-03-03
| | | | | | Suggestion by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202678 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary copy ctors.Benjamin Kramer2014-03-02
| | | | | | They didn't provide any value over the default ones but blocked move semantics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202664 91177308-0d34-0410-b5e6-96231b3b80d8
* Give APInt move semantics.Benjamin Kramer2014-03-02
| | | | | | | The interaction between defaulted operators and move elision isn't totally obvious, add a unit test so it doesn't break unintentionally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202662 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-02
| | | | | | The old implementation is no longer needed in C++11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202644 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-02
| | | | | | Remove the old functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202636 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-02
| | | | | | directly, and remove the macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202612 91177308-0d34-0410-b5e6-96231b3b80d8