summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Make this operator bool() explicit to match the standard library.Rafael Espindola2014-06-031-24/+24
| | | | llvm-svn: 210072
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-28/+28
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209952
* Fix the behavior of ExecuteAndWait with a non-zero timeout.Peter Collingbourne2014-05-311-0/+30
| | | | llvm-svn: 209951
* Use std::unique_ptr instead of OwningPtr in the MemoryBuffer unittests.Craig Topper2014-05-182-7/+5
| | | | llvm-svn: 209102
* SupportTest: Fix test names harderDuncan P. N. Exon Smith2014-04-291-2/+2
| | | | | | r207552, r207553 and r207554 all had bad test names. llvm-svn: 207560
* Support: More BlockFrequencyTest => BranchProbabilityTestDuncan P. N. Exon Smith2014-04-292-29/+29
| | | | llvm-svn: 207554
* Support: Fix test nameDuncan P. N. Exon Smith2014-04-291-1/+1
| | | | llvm-svn: 207553
* Support: BlockFrequencyTest => BranchProbabilityTestDuncan P. N. Exon Smith2014-04-292-97/+95
| | | | | | | Move a detailed test of `BranchProbability::scale()` from `BlockFrequencyTest` over to `BranchProbabilityTest`. llvm-svn: 207552
* blockfreq: Defer to BranchProbability::scale() (again)Duncan P. N. Exon Smith2014-04-291-96/+87
| | | | | | | | | | | | Change `BlockFrequency` to defer to `BranchProbability::scale()` and `BranchProbability::scaleByInverse()`. This removes `BlockFrequency::scale()` from its API (and drops the ability to see the remainder), but the only user was the unit tests. If some code in the future needs an API that exposes the remainder, we can add something to `BranchProbability`, but I find that unlikely. llvm-svn: 207550
* Support: Add BranchProbability::scale() and ::scaleByInverse()Duncan P. N. Exon Smith2014-04-291-0/+68
| | | | | | | Add API to `BranchProbability` for scaling big integers. Next job is to rip the logic out of `BlockMass` and `BlockFrequency`. llvm-svn: 207544
* Support: Add unit tests for BranchProbabilityDuncan P. N. Exon Smith2014-04-292-0/+91
| | | | llvm-svn: 207540
* [ADT] Generalize pointee_iterator to smart pointers by using decltype.Chandler Carruth2014-04-241-0/+42
| | | | | | Based on review feedback from Dave on the original patch. llvm-svn: 207146
* [ADT] Add a generic iterator utility for adapting iterators much likeChandler Carruth2014-04-242-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 207069
* [Allocator] Make BumpPtrAllocator movable and move assignable.Chandler Carruth2014-04-161-0/+15
| | | | llvm-svn: 206372
* [Allocator] Finally, finish nuking the redundant code that led me hereChandler Carruth2014-04-151-1/+1
| | | | | | | | | | | | | | | | by removing the MallocSlabAllocator entirely and just using MallocAllocator directly. This makes all off these allocators expose and utilize the same core interface. The only ugly part of this is that it exposes the fact that the JIT allocator has no real handling of alignment, any more than the malloc allocator does. =/ It would be nice to fix both of these to support alignments, and then to leverage that in the BumpPtrAllocator to do less over allocation in order to manually align pointers. But, that's another patch for another day. This patch has no functional impact, it just removes the somewhat meaningless wrapper around MallocAllocator. llvm-svn: 206267
* [Allocator] Make the underlying allocator a template instead of anChandler Carruth2014-04-141-9/+10
| | | | | | | | | | | | abstract interface. The only user of this functionality is the JIT memory manager and it is quite happy to have a custom type here. This removes a virtual function call and a lot of unnecessary abstraction from the common case where this is just a *very* thin vaneer around a call to malloc. Hopefully still no functionality changed here. =] llvm-svn: 206149
* [Allocator] Switch the BumpPtrAllocator to use a vector of pointers toChandler Carruth2014-04-141-16/+18
| | | | | | | | | | | | | | | | | | | | | | | slabs rather than embedding a singly linked list in the slabs themselves. This has a few advantages: - Better utilization of the slab's memory by not wasting 16-bytes at the front. - Simpler allocation strategy by not having a struct packed at the front. - Avoids paging every allocated slab in just to traverse them for deallocating or dumping stats. The latter is the really nice part. Folks have complained from time to time bitterly that tearing down a BumpPtrAllocator, even if it doesn't run any destructors, pages in all of the memory allocated. Now it won't. =] Also resolves a FIXME with the scaling of the slab sizes. The scaling now disregards specially sized slabs for allocations larger than the threshold. llvm-svn: 206147
* YAMLIO: Allow scalars to dictate quotation rulesDavid Majnemer2014-04-101-0/+38
| | | | | | | Introduce ScalarTraits::mustQuote which determines whether or not a StringRef needs quoting before it is acceptable to output. llvm-svn: 205955
* Revert "Revert "YAMLIO: Encode ambiguous hex strings explicitly""David Majnemer2014-04-091-0/+10
| | | | | | | | | Don't quote octal compatible strings if they are only two wide, they aren't ambiguous. This reverts commit r205857 which reverted r205857. llvm-svn: 205914
* Revert "YAMLIO: Encode ambiguous hex strings explicitly"Filipe Cabecinhas2014-04-091-10/+0
| | | | | | | | This reverts commit r205839. It broke several tests in lld. llvm-svn: 205857
* YAMLIO: Encode ambiguous hex strings explicitlyDavid Majnemer2014-04-091-0/+10
| | | | | | | | | | YAMLIO would turn a BinaryRef into the string 0000000004000000. However, the leading zero causes parsers to interpret it as being an octal number instead of a hexadecimal one. Instead, escape such strings as needed. llvm-svn: 205839
* Simplify compression API by compressing into a SmallVector rather than a ↵David Blaikie2014-04-051-8/+6
| | | | | | | | MemoryBuffer This is the other half of r205676. llvm-svn: 205677
* Simplify compression API by decompressing into a SmallVector rather than a ↵David Blaikie2014-04-051-4/+3
| | | | | | | | | | | | MemoryBuffer This avoids an extra copy during decompression and avoids the use of MemoryBuffer which is a weirdly esoteric device that includes unrelated concepts like "file name" (its rather generic name is a bit misleading). Similar refactoring of zlib::compress coming up. llvm-svn: 205676
* [Allocator] Lift the slab size and size threshold into templateChandler Carruth2014-03-301-1/+1
| | | | | | | | | | parameters rather than runtime parameters. There is only one user of these parameters and they are compile time for that user. Making these compile time seems to better reflect their intended usage as well. llvm-svn: 205143
* [Allocator] Simplify unittests by using the default size parameters inChandler Carruth2014-03-301-5/+5
| | | | | | more places. llvm-svn: 205141
* Fix these tests on windows.Rafael Espindola2014-03-251-15/+10
| | | | | | | | | It is impossible to create a hard link to a non existing file, so create a dummy file, create the link an delete the dummy file. On windows one cannot remove the current directory, so chdir first. llvm-svn: 204719
* SupportTests.LockFileManagerTest: Add assertions for Win32.NAKAMURA Takumi2014-03-231-2/+16
| | | | | | | - create_link doesn't work for nonexistent file. - remove cannot remove working directory. llvm-svn: 204579
* 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
OpenPOWER on IntegriCloud