summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Suppress SupportTests.LockFileManagerTest on win32 for investigating.NAKAMURA Takumi2014-03-221-0/+2
| | | | llvm-svn: 204533
* [Support] Make sure LockFileManager works correctly with relative paths.Argyrios Kyrtzidis2014-03-211-0/+37
| | | | llvm-svn: 204426
* [Support] Make sure sys::fs::remove can remove symbolic links and make sure ↵Argyrios Kyrtzidis2014-03-211-0/+32
| | | | | | LockFileManager can handle a symbolic link that points nowhere. llvm-svn: 204422
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-111-0/+37
| | | | | | | | 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. llvm-svn: 203611
* Cleanup the interface for creating soft or hard links.Rafael Espindola2014-03-111-2/+2
| | | | | | | | | | | | 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. llvm-svn: 203596
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-071-4/+8
| | | | | | No functionality change. llvm-svn: 203242
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-063-20/+19
| | | | | | | | | | 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. llvm-svn: 203083
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-051-0/+29
| | | | | | | | | 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. llvm-svn: 202999
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-051-1/+1
| | | | | | | | 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. llvm-svn: 202959
* Hey, we can stop depending on the IR library from the Support unittestsChandler Carruth2014-03-041-1/+0
| | | | | | | now. ;] Tested on both a static and shared CMake build. Hopefully the bots will agree. llvm-svn: 202844
* [Modules] Move the LeakDetector header into the IR library where theChandler Carruth2014-03-042-32/+0
| | | | | | | | | | | 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. llvm-svn: 202842
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-042-513/+0
| | | | | | | | | | 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. llvm-svn: 202838
* [Modules] Move ValueHandle into the IR library where Value itself lives.Chandler Carruth2014-03-042-409/+0
| | | | | | | | | | | 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. llvm-svn: 202821
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202621
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-021-1/+1
| | | | | | directly, and remove the macro. llvm-svn: 202612
* [C++11] Remove LLVM_HAS_CXX11_STDLIB now that it is just on.Chandler Carruth2014-03-011-6/+0
| | | | llvm-svn: 202587
* [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth2014-03-012-4/+0
| | | | llvm-svn: 202583
* Use the overloaded std::abs rather than C's abs(int) to address Clang's ↵David Blaikie2014-02-261-1/+1
| | | | | | -Wabsolute-value llvm-svn: 202286
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-3/+3
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Fix windows unittest I missed in the raw_fd_ostream constructor change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202050
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-231-17/+24
| | | | | | | | | | | | | | | Before this patch they would take an boolean argument to say if the path already existed. This was redundant with the returned error_code which is able to represent that. This allowed for callers to incorrectly check only the existed flag instead of first checking the error code. Instead, pass in a boolean flag to say if the previous (non-)existence should be an error or not. Callers of the of the old simple versions are not affected. They still ignore the previous (non-)existence as they did before. llvm-svn: 201979
* Move get[S|U]LEB128Size() to LEB128.h.Logan Chien2014-02-222-0/+312
| | | | | | | | | | This commit moves getSLEB128Size() and getULEB128Size() from MCAsmInfo to LEB128.h and removes some copy-and-paste code. Besides, this commit also adds some unit tests for the LEB128 functions. llvm-svn: 201937
* Remove TimeValue::toPosixTime() -- it is buggy, semantics are unclear, and itsDmitri Gribenko2014-02-111-1/+2
| | | | | | only current user should be using toEpochTime() instead. llvm-svn: 201136
* Fix layering StringRef copy using BumpPtrAllocator.Nick Kledzik2014-02-051-28/+0
| | | | | | | | | Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy: StringRef myCopy = myStr.copy(myAllocator); llvm-svn: 200885
* Silence a warning:Chandler Carruth2014-02-041-1/+1
| | | | | | | | | | | | | | | In file included from ../unittests/Support/ProcessTest.cpp:11: ../utils/unittest/googletest/include/gtest/gtest.h:1448:28: warning: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Wsign-compare] GTEST_IMPL_CMP_HELPER_(NE, !=); ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ ../utils/unittest/googletest/include/gtest/gtest.h:1433:12: note: expanded from macro 'GTEST_IMPL_CMP_HELPER_' if (val1 op val2) {\ ^ ../unittests/Support/ProcessTest.cpp:46:3: note: in instantiation of function template specialization 'testing::internal::CmpHelperNE<unsigned int, int>' requested here EXPECT_NE((r1 | r2), 0); ^ llvm-svn: 200801
* Implemented support for Process::GetRandomNumber on Windows.Aaron Ballman2014-02-041-0/+7
| | | | | | Patch thanks to Stephan Tolksdorf! llvm-svn: 200767
* Introduce llvm::sys::path::home_directory.Peter Collingbourne2014-01-311-0/+13
| | | | | | | | | This will be used by the line editor library to derive a default path to the history file. Differential Revision: http://llvm-reviews.chandlerc.com/D2199 llvm-svn: 200594
* Remove C++11ism from r200407.Jordan Rose2014-01-291-1/+1
| | | | | | Oops! llvm-svn: 200412
* [CommandLine] Aliases require an value if their target requires a value.Jordan Rose2014-01-291-2/+53
| | | | | | | | | This can still be overridden by explicitly setting a value requirement on the alias option, but by default it should be the same. PR18649 llvm-svn: 200407
* Add BumpPtrAllocator::allocateCopy() utilitiesNick Kledzik2014-01-281-0/+28
| | | | | | Makes it easy to use BumpPtrAllocator to make a copy of StringRef strings. llvm-svn: 200331
* Fix known typosAlp Toker2014-01-242-38/+38
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Use LLVM_EXPLICIT instead of a function pointer as bool.Rafael Espindola2014-01-161-1/+3
| | | | llvm-svn: 199437
* Remove remove_all. A compiler has no need for recursively deleting a directory.Rafael Espindola2014-01-103-5/+22
| | | | llvm-svn: 198955
* Add a unit test for the copy constructor.Rafael Espindola2014-01-091-0/+3
| | | | | | | | I would not normally add tests like these, but the copy constructor is not used at all in our codebase with c++11, so having this tests might prevent breaking the c++03 build again. llvm-svn: 198886
* Use getError and remove the error_code operator.Rafael Espindola2014-01-081-1/+1
| | | | llvm-svn: 198799
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-076-8/+3
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Make llvm::Regex non-copyable but movable.David Blaikie2014-01-021-0/+15
| | | | | | Based on a patch by Maciej Piechotka. llvm-svn: 198334
* Introduce a simple line-by-line iterator type into the Support library.Chandler Carruth2013-12-272-0/+116
| | | | | | | | | | | | | | | | | | | This is an iterator which you can build around a MemoryBuffer. It will iterate through the non-empty, non-comment lines of the buffer as a forward iterator. It should be small and reasonably fast (although it could be made much faster if anyone cares, I don't really...). This will be used to more simply support the text-based sample profile file format, and is largely based on the original patch by Diego. I've re-worked the style of it and separated it from the work of producing a MemoryBuffer from a file which both simplifies the interface and makes it easier to test. The style of the API follows the C++ standard naming conventions to fit in better with iterators in general, much like the Path and FileSystem interfaces follow standard-based naming conventions. llvm-svn: 198068
* unittests/Support/ProcessTest.cpp: Don't use "windows.h". Use <windows.h> ↵NAKAMURA Takumi2013-12-251-1/+1
| | | | | | instead. llvm-svn: 198011
* Make sys::ThreadLocal<> zero-initialized on non-thread builds (PR18205)Hans Wennborg2013-12-192-0/+39
| | | | | | | | | | | | | According to the docs, ThreadLocal<>::get() should return NULL if no object has been set. This patch makes that the case also for non-thread builds and adds a very basic unit test to check it. (This was causing PR18205 because PrettyStackTraceHead didn't get zero- initialized and we'd crash trying to read past the end of that list. We didn't notice this so much on Linux since we'd crash after printing all the entries, but on Mac we print into a SmallString, and would crash before printing that.) llvm-svn: 197718
* [block-freq] Add a right shift to BlockFrequency that saturates at 1.Michael Gottesman2013-12-141-0/+8
| | | | llvm-svn: 197302
* Swap around EXPECT_EQ() arguments orders for more natural gtest Failure messagesAlp Toker2013-12-121-8/+8
| | | | | | | | | Somewhat counterintuitively the first arg in gtest is treated as the expectation. No change to the tests themselves. llvm-svn: 197124
* Add missing escape characters to the new Regex::escape() functionAlp Toker2013-12-121-0/+5
| | | | | | | | | The old AddFixedStringToRegEx() it was based on got away with this for the longest time, but the problem became easy to spot after the cleanup in r197096. Also add a quick unit test to cover regex escaping. llvm-svn: 197121
* [block-freq] Update data in test case to be unsigned long long to fix mingw ↵Michael Gottesman2013-11-221-80/+80
| | | | | | build. llvm-svn: 195411
* YAML I/O add support for validate()Nick Kledzik2013-11-211-3/+43
| | | | | | | MappingTrait template specializations can now have a validate() method which performs semantic checking. For details, see <http://llvm.org/docs/YamlIO.html>. llvm-svn: 195286
* revert r194655Nick Kledzik2013-11-211-70/+0
| | | | llvm-svn: 195285
* YAML I/O - Added default trait support for std:string. Making another ↵John Thompson2013-11-191-0/+31
| | | | | | attempt at this, this time doing a clean build on Linux, and running the LLVM, clang, and extra tests, to try to make sure there's no problems. llvm-svn: 195134
* Recover gracefully when deserializing invalid YAML input.Alexander Kornienko2013-11-181-46/+116
| | | | | | | | | Fixes http://llvm.org/PR16221, http://llvm.org/PR15927 Phabricator: http://llvm-reviews.chandlerc.com/D1236 Patch by Andrew Tulloch! llvm-svn: 195016
* [block-freq] Add BlockFrequency::scale that returns a remainder from the ↵Michael Gottesman2013-11-171-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | division and make the private scale in BlockFrequency more performant. This change is the first in a series of changes improving LLVM's Block Frequency propogation implementation to not lose probability mass in branchy code when propogating block frequency information from a basic block to its successors. This patch is a simple infrastructure improvement that does not actually modify the block frequency algorithm. The specific changes are: 1. Changes the division algorithm used when scaling block frequencies by branch probabilities to a short division algorithm. This gives us the remainder for free as well as provides a nice speed boost. When I benched the old routine and the new routine on a Sandy Bridge iMac with disabled turbo mode performing 8192 iterations on an array of length 32768, I saw ~600% increase in speed in mean/median performance. 2. Exposes a scale method that returns a remainder. This is important so we can ensure that when we scale a block frequency by some branch probability BP = N/D, the remainder from the division by D can be retrieved and propagated to other children to ensure no probability mass is lost (more to come on this). llvm-svn: 194950
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-151-0/+2
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
OpenPOWER on IntegriCloud