summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
* Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.Alexey Samsonov2014-07-092-0/+127
| | | | | | | | | | | | | | | | Turn llvm::SpecialCaseList into a simple class that parses text files in a specified format and knows nothing about LLVM IR. Move this class into LLVMSupport library. Implement two users of this class: * DFSanABIList in DFSan instrumentation pass. * SanitizerBlacklist in Clang CodeGen library. The latter will be modified to use actual source-level information from frontend (source file names) instead of unstable LLVM IR things (LLVM Module identifier). Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils. No functionality change. llvm-svn: 212643
* These should be EXPECT_TRUE, not EXPECT_FALSE. Amends r212415.Aaron Ballman2014-07-061-2/+2
| | | | llvm-svn: 212419
* Fixing compile errors related to changes with MemoryBuffer::getFile.Aaron Ballman2014-07-061-6/+6
| | | | llvm-svn: 212415
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-7/+8
| | | | llvm-svn: 212405
* Remove unused typedef. GCC warns about this.Benjamin Kramer2014-07-011-3/+0
| | | | llvm-svn: 212105
* Re-apply r211287: Remove support for LLVM runtime multi-threading.Chandler Carruth2014-06-271-2/+0
| | | | | | | I'll fix the problems in libclang and other projects in ways that don't require <mutex> until we sort out the cygwin situation. llvm-svn: 211900
* Revert r211287, "Remove support for LLVM runtime multi-threading."NAKAMURA Takumi2014-06-241-0/+2
| | | | | | libclang still requires it on cygming, lack of incomplete <mutex>. llvm-svn: 211592
* Support: Return ScaledNumbers::MaxScale from getQuotient()Duncan P. N. Exon Smith2014-06-241-4/+4
| | | | | | Return MaxScale now that it's available. llvm-svn: 211559
* Support: Extract ScaledNumbers::getSum() and getDifference()Duncan P. N. Exon Smith2014-06-231-0/+150
| | | | llvm-svn: 211553
* Support: Return scale from ScaledNumbers::matchScales()Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | | | This will be convenient when extracting `ScaledNumbers::getSum()`. llvm-svn: 211552
* Support: Extract ScaledNumbers::matchScale()Duncan P. N. Exon Smith2014-06-231-0/+64
| | | | llvm-svn: 211531
* Cleanup r211507Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | llvm-svn: 211521
* Support: Extract ScaledNumbers::compare()Duncan P. N. Exon Smith2014-06-231-0/+37
| | | | llvm-svn: 211507
* Support: ScaledNumber: Fix inconsistent test namesDuncan P. N. Exon Smith2014-06-201-6/+6
| | | | llvm-svn: 211414
* Support: Write ScaledNumbers::getLg{,Floor,Ceiling}()Duncan P. N. Exon Smith2014-06-201-0/+94
| | | | llvm-svn: 211413
* Support: Write ScaledNumber::getQuotient() and getProduct()Duncan P. N. Exon Smith2014-06-201-0/+112
| | | | llvm-svn: 211409
* Support: Mark end of namespacesDuncan P. N. Exon Smith2014-06-201-1/+2
| | | | | | This convinces clang-format to leave a newline. llvm-svn: 211406
* Support: Clean up getRounded() testsDuncan P. N. Exon Smith2014-06-201-14/+12
| | | | llvm-svn: 211337
* Support: Write ScaledNumbers::getAdjusted()Duncan P. N. Exon Smith2014-06-201-0/+23
| | | | llvm-svn: 211336
* Support: Write ScaledNumbers::getRounded()Duncan P. N. Exon Smith2014-06-202-0/+61
| | | | | | | | | | | Start extracting helper functions out of -block-freq's `UnsignedFloat` into `Support/ScaledNumber.h` with the eventual goal of moving and renaming the class to `ScaledNumber`. The bike shed about names is still being painted, but I'm going with this for now. llvm-svn: 211333
* Remove support for LLVM runtime multi-threading.Zachary Turner2014-06-191-2/+0
| | | | | | | | | | | | | After a number of previous small iterations, the functions llvm_start_multithreaded() and llvm_stop_multithreaded() have been reduced essentially to no-ops. This change removes them entirely. Reviewed by: rnk, dblaikie Differential Revision: http://reviews.llvm.org/D4216 llvm-svn: 211287
* PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad ↵Nikola Smiljanic2014-06-192-0/+32
| | | | | | | | OR-result. Mark conversion operator explicit and const qualify comparison operators. llvm-svn: 211244
* ConvertUTF tests: remove uses of initializer lists to restore compatibilityDmitri Gribenko2014-06-171-695/+1108
| | | | | | with MSVC llvm-svn: 211093
* Revert r211066, 211067, 211068, 211069, 211070.Zachary Turner2014-06-161-0/+2
| | | | | | | These were committed accidentally from the wrong branch before having a review sign-off. llvm-svn: 211072
* Remove some more code out into a separate CL.Zachary Turner2014-06-161-2/+0
| | | | llvm-svn: 211067
* Support/ConvertUTF: implement U+FFFD insertion according to the recommendationDmitri Gribenko2014-06-161-0/+1186
| | | | | | | | | given in the Unicode spec That is, replace every maximal subpart of an ill-formed subsequence with one U+FFFD. llvm-svn: 211015
* Adding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a ↵Artyom Skrobov2014-06-141-0/+48
| | | | | | value in place llvm-svn: 210976
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-141-30/+30
| | | | | | The next commit will add swapByteOrder(), acting in-place llvm-svn: 210973
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-132-6/+8
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. llvm-svn: 210920
* Remove the last uses of 'using std::error_code'Rafael Espindola2014-06-135-70/+69
| | | | | | This finishes the transition to std::error_code. llvm-svn: 210877
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-125-0/+5
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove unused has_magic.Rafael Espindola2014-06-112-13/+2
| | | | | | | This will allow inlining get_magic, which should in turn fix one of the mingw build problems after the switch to std::error_code. llvm-svn: 210712
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-112-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* Remove windows_error.Rafael Espindola2014-06-111-1/+5
| | | | | | | | | | MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. llvm-svn: 210631
* [C++11] Use 'nullptr'.Craig Topper2014-06-0812-115/+122
| | | | llvm-svn: 210442
* 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
OpenPOWER on IntegriCloud