summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* DebugIRTests: Fixup for r204130.NAKAMURA Takumi2014-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204132 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Change DebugInfoFinder to use range-based loopsAlon Mishne2014-03-18
| | | | | | Also changes the iterators to return actual DI type over MDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204130 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] As was pointed out in review, I need to define a custom swap inChandler Carruth2014-03-13
| | | | | | | | | | | | | order to use the single assignment. That's probably worth doing for a lot of these types anyways as they may have non-trivial moves and so getting copy elision in more places seems worthwhile. I've tried to add some tests that actually catch this mistake, and one of the types is now well tested but the others' tests still fail to catch this. I'll keep working on tests, but this gets the core pattern right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203780 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests: Fix -Werror buildJustin Bogner2014-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203679 91177308-0d34-0410-b5e6-96231b3b80d8
* Add parens around && clauses in a || to appease the compiler.Eli Bendersky2014-03-12
| | | | | | | Otherwise gcc 4.8.2 generates a warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203671 91177308-0d34-0410-b5e6-96231b3b80d8
* Cloning a function now also clones its debug metadata if ↵Alon Mishne2014-03-12
| | | | | | 'ModuleLevelChanges' is true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203662 91177308-0d34-0410-b5e6-96231b3b80d8
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-11
| | | | | | | | Add a utility function to convert the Windows path separator to Unix style path separators. This is used by a subsequent change in clang to enable the use of Windows SDK headers on Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203611 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup the interface for creating soft or hard links.Rafael Espindola2014-03-11
| | | | | | | | | | | | Before this patch the unix code for creating hardlinks was unused. The code for creating symbolic links was implemented in lib/Support/LockFileManager.cpp and the code for creating hard links in lib/Support/*/Path.inc. The only use we have for these is in LockFileManager.cpp and it can use both soft and hard links. Just have a create_link function that creates one or the other depending on the platform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203596 91177308-0d34-0410-b5e6-96231b3b80d8
* MultiJITTest.cpp: Tweak getPointerToNamedFunction() to be aware of also ↵NAKAMURA Takumi2014-03-11
| | | | | | | | | | | | Windows x64. In import thunk, jmp is: - On x86, 0xFF 0x25 [disp32]. - On x64, 0xFF 0x25 [pcrel32]. See also my r144178. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203523 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT/PointerIntPairTest.cpp: Appease msc17.NAKAMURA Takumi2014-03-10
| | | | | | | - Use constructor instead of initializer list. - Disable ManyUnusedBits for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203436 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] While I'm here, fix a few other clang-format issues. Pulls someChandler Carruth2014-03-10
| | | | | | lines under 80-columns, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203434 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
* [PM] Switch new pass manager from polymorphic_ptr to unique_ptr now thatChandler Carruth2014-03-09
| | | | | | | it is available. Also make the move semantics sufficiently correct to tolerate move-only passes, as the PassManagers *are* move-only passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203391 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
* Fix 80 cols.Ahmed Charles2014-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203346 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix EXPECT_* to not produce a compile warning.Eli Bendersky2014-03-07
| | | | | | | EXPECT_TRUE/FALSE is also more idiomatic for booleans than EXPECT_EQ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203284 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] Now that the users are gone, rip out the duplicated traits from ↵Benjamin Kramer2014-03-07
| | | | | | | | type_traits.h Simplify the remaining ones a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203249 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
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Sink Linker.h into a Linker subdirectory to make itChandler Carruth2014-03-06
| | | | | | consistent with every other sub-library header in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203065 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203046 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DIBuilder.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203038 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-05
| | | | | | | | | When using a //net/ path, we were transforming the trailing / into a '.' when the path was just the root path and we were iterating backwards. Forwards iteration and other kinds of root path (C:\, /) were already correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202999 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-05
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202959 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 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
* Hey, we can stop depending on the IR library from the Support unittestsChandler Carruth2014-03-04
| | | | | | | now. ;] Tested on both a static and shared CMake build. Hopefully the bots will agree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202844 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the LeakDetector header into the IR library where theChandler Carruth2014-03-04
| | | | | | | | | | | source file had already been moved. Also move the unittest into the IR unittest library. This may seem an odd thing to put in the IR library but we only really use this with instructions and it needs the LLVM context to work, so it is intrinsically tied to the IR library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202842 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-04
| | | | | | | | | | a bit surprising, as the class is almost entirely abstracted away from any particular IR, however it encodes the comparsion predicates which mutate ranges as ICmp predicate codes. This is reasonable as they're used for both instructions and constants. Thus, it belongs in the IR library with instructions and constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202838 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the NoFolder into the IR library as it createsChandler Carruth2014-03-04
| | | | | | instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202834 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
* [Modules] Move the LLVM IR pattern match header into the IR library, itChandler Carruth2014-03-04
| | | | | | obviously is coupled to the IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202818 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move InstIterator out of the Support library, where it had noChandler Carruth2014-03-04
| | | | | | | | | | | | | business. This header includes Function and BasicBlock and directly uses the interfaces of both classes. It has to do with the IR, it even has that in the name. =] Put it in the library it belongs to. This is one step toward making LLVM's Support library survive a C++ modules bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202814 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
* Cleaning up a bunch of pre-Visual C++ 2012 build hacks.Yaron Keren2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202806 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_STATIC_ASSERT with static_assert, we now haveChandler Carruth2014-03-02
| | | | | | access to it on all host toolchains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202642 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
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202621 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
* [C++11] Add support for OwningPtr<T> to be converted to and fromChandler Carruth2014-03-02
| | | | | | | | std::unique_ptr<T>. Patch by Ahmed Charles! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202609 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add unit tests for OwningPtr<T> in preparation for changes to makeChandler Carruth2014-03-02
| | | | | | | | | | it interoperate (minimally) with std::unique_ptr<T>. This is part of my plan to migrate LLVM to use std::unique_ptr with a minimal impact on out-of-tree code. Patch by Ahmed Charles with some minor cleanups (and bool casts) by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202608 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove LLVM_HAS_CXX11_STDLIB now that it is just on.Chandler Carruth2014-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202587 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth2014-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202583 91177308-0d34-0410-b5e6-96231b3b80d8
* With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202510 91177308-0d34-0410-b5e6-96231b3b80d8