summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-091-326/+0
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 llvm-svn: 190328
* MemoryBufer: add a test: check that a file with size that is a multiple of theDmitri Gribenko2013-09-041-0/+22
| | | | | | page size can be null terminated correctly by MemoryBuffer. llvm-svn: 189965
* Move generic isPrint and columnWidth implementations to a separate ↵Alexander Kornienko2013-09-043-105/+94
| | | | | | | | | | | | | | | | | | | | | header/source to allow using both generic and system-dependent versions on win32. Summary: This is needed so we can use generic columnWidthUTF8 in clang-format on win32 simultaneously with a separate system-dependent implementations of isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode characters using narrow-character interfaces (which is not supported on Windows, and we'll have to figure out how to handle this). Reviewers: jordan_rose Reviewed By: jordan_rose CC: llvm-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1559 llvm-svn: 189952
* [Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must ↵NAKAMURA Takumi2013-08-221-5/+0
| | | | | | contain Offset when Offset >= 65536. llvm-svn: 189021
* Whitespace.NAKAMURA Takumi2013-08-221-1/+1
| | | | llvm-svn: 189020
* Suppress MemoryBufferTest.cpp on win32 for now. Investigating.NAKAMURA Takumi2013-08-221-0/+5
| | | | llvm-svn: 189001
* MemoryBufferTest.cpp: Tweak offset corresponding to the case that PageSize ↵NAKAMURA Takumi2013-08-221-1/+1
| | | | | | | | is greater than 8000. PageSize, aka AllocationGranularity, is 65536 on Win32 (and Cygwin). llvm-svn: 188999
* Removing a spurious semi-colon; this macro expands into a namespace.Aaron Ballman2013-08-161-1/+1
| | | | llvm-svn: 188525
* Tighten up the yamilizer so it stops eliding empty sequences if the embedded ↵Aaron Ballman2013-08-151-0/+63
| | | | | | | | empty sequence is the first key/value in a map which is itself in a sequence. Patch with help from Nick Kledzik. llvm-svn: 188508
* Expose CRC-32 implementation from zlibAlexey Samsonov2013-08-141-0/+6
| | | | llvm-svn: 188380
* Fixes a bug when iterating on pathsTareq A. Siraj2013-08-121-0/+69
| | | | | | | | | This fixes the incorrect implementation of iterating on file/directory paths. Differential Review: http://llvm-reviews.chandlerc.com/D1277 llvm-svn: 188183
* Fix off-by-one error in Regex::isValidAlexey Samsonov2013-08-081-0/+8
| | | | llvm-svn: 187992
* Use EXPECT_TRUE/EXPECT_FALSE to avoid bogus warnings from the guts of gtest.Benjamin Kramer2013-08-081-20/+20
| | | | llvm-svn: 187976
* Changed isPrint for U+00AD SOFT HYPHEN to return true.Alexander Kornienko2013-08-081-4/+8
| | | | | | | | | | | | | | | | | Summary: This is consistent with MacOSX implementation, and most terminals actually display this character (checked on gnome-terminal, lxterminal, lxterm, Terminal.app, iterm2). Actually, this is in line with the ISO Latin 1 standard (ISO 8859-1), which defines it differently from the Unicode Standard. More information here: http://www.cs.tut.fi/~jkorpela/shy.html Reviewers: gribozavr, jordan_rose CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1310 llvm-svn: 187949
* Disabled columnWidth test for OSX, need someone with Mac to deal with this ↵Alexander Kornienko2013-08-071-3/+2
| | | | | | effectively. llvm-svn: 187848
* Use correct platform detection macro: __MACOSX__ -> __APPLE__Alexander Kornienko2013-08-071-6/+6
| | | | llvm-svn: 187847
* Fix boolean logic in LockFileManager and test itReid Kleckner2013-08-072-0/+49
| | | | | | | | | | This fixes a bug from r187826. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1304 llvm-svn: 187846
* Disable tests on WIN32 (which has incorrect implementation of isPrint andAlexander Kornienko2013-08-071-0/+15
| | | | | | | columnWidth), and partially disable tests on MACOSX (which handles some characters differently). llvm-svn: 187842
* Implemented llvm::sys::locale::columnWidth and isPrint for the case of ↵Alexander Kornienko2013-08-072-0/+87
| | | | | | | | | | | | | | | | | | | | | generic UTF8-capable terminal. Summary: This is a second attempt to get this right. After reading the Unicode Standard I came up with the code that uses definitions of "printable" and "column width" more suitable for terminal output (i.e. fixed-width fonts and special treatment of many control characters). The implementation here can probably be used for Windows and MacOS if someone can test it properly. The patch addresses PR14910. Reviewers: jordan_rose, gribozavr CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1253 llvm-svn: 187837
* Introduce Regex::isLiteralERE function.Peter Collingbourne2013-08-051-0/+15
| | | | | | | | | This will be used to implement an optimisation for literal entries in special case lists. Differential Revision: http://llvm-reviews.chandlerc.com/D1278 llvm-svn: 187731
* Update incorrect file headers.Sean Silva2013-08-011-1/+1
| | | | | | One of these was spotted in review by Rafael. llvm-svn: 187598
* Fix windows' implementation of status when a file doesn't exist.Rafael Espindola2013-07-311-0/+4
| | | | | | | | | The unix one was returning no_such_file_or_directory, but the windows one was return success. Update the one one caller that was depending on the old behavior. llvm-svn: 187463
* Implement getUniqueID for directories on windows.Rafael Espindola2013-07-301-0/+13
| | | | llvm-svn: 187441
* Implement TokenizeWindowsCommandLine.Rui Ueyama2013-07-301-9/+28
| | | | | | | | | | This is a follow up patch for r187390 to implement the parser for the Windows-style command line. This should follow the rule as described at http://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx Differential Revision: http://llvm-reviews.chandlerc.com/D1235 llvm-svn: 187430
* Include st_dev to make the result of getUniqueID actually unique.Rafael Espindola2013-07-291-3/+3
| | | | | | This will let us use getUniqueID instead of st_dev directly on clang. llvm-svn: 187378
* Don't end a file name with a dot. It looks odd.Rafael Espindola2013-07-251-0/+5
| | | | llvm-svn: 187124
* Refactor the unit test for MemoryBuffer::getOpenFileSliceEli Bendersky2013-07-231-6/+27
| | | | | | | Run in two different modes: with and without reopening the temporary file between creating it and mapping it with MemoryBuffer. llvm-svn: 186986
* Split getOpenFile into getOpenFile and getOpenFileSlice.Rafael Espindola2013-07-231-7/+4
| | | | | | | | | | | | | | | | The main observation is that we never need both the filesize and the map size. When mapping a slice of a file, it doesn't make sense to request a null terminator and that would be the only case where the filesize would be used. There are other cleanups that should be done in this area: * A client should not have to pass the size (even an explicit -1) to say if it wants a null terminator or not, so we should probably swap the argument order. * The default should be to not require a null terminator. Very few clients require this, but many end up asking for it just because it is the default. llvm-svn: 186984
* Add a simple unit test for MemoryBuffer::getOpenFileEli Bendersky2013-07-221-0/+33
| | | | llvm-svn: 186887
* Add a unit test for checking that we respect the F_Binary flag.Rafael Espindola2013-07-191-0/+31
| | | | llvm-svn: 186676
* [Support] Beef up and expose the response file parsing in llvm::clReid Kleckner2013-07-181-0/+24
| | | | | | | | | | | | | | | | | | | The plan is to use it for clang and lld. Major behavior changes: - We can now parse UTF-16 files that have a byte order mark. - PR16209: Don't drop backslashes on the floor if they don't escape anything. The actual parsing loop was based on code from Clang's driver.cpp, although it's been rewritten to track its state with control flow rather than state variables. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1170 llvm-svn: 186587
* Remove dead code.Rafael Espindola2013-07-181-7/+1
| | | | llvm-svn: 186561
* Fix a regression I introduced back in r178147.Rafael Espindola2013-07-181-0/+25
| | | | | | | | | | | We don't want cast and dyn_cast to work on temporaries. They don't extend lifetime like a direct bind to a reference would, so they can introduce hard to find bugs. I added tests to make sure we don't regress this. Thanks to Eli Friedman for noticing this and for his suggestions on how to test it. llvm-svn: 186559
* Add a wrapper for open.Rafael Espindola2013-07-161-2/+1
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). llvm-svn: 186447
* [Support] Add a Unicode conversion wrapper from UTF16 to UTF8Reid Kleckner2013-07-162-0/+66
| | | | | | | | | | | This is to support parsing UTF16 response files in LLVM/lib/Option for lld and clang. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1138 llvm-svn: 186426
* unittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.NAKAMURA Takumi2013-07-161-0/+16
| | | | llvm-svn: 186375
* Rename Support.TimeValue to TimeValue.time_t in unittests/Support.NAKAMURA Takumi2013-07-162-3/+3
| | | | llvm-svn: 186372
* We now always create files with the correct permissions. Simplify the interface.Rafael Espindola2013-07-081-28/+0
| | | | llvm-svn: 185834
* Fix windows build.Rafael Espindola2013-07-051-1/+1
| | | | llvm-svn: 185730
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-7/+7
| | | | llvm-svn: 185719
* Fix a bad overflow check pointed out by Ben.Jakob Stoklund Olesen2013-06-281-0/+5
| | | | llvm-svn: 185226
* Add a division operator to BlockFrequency.Jakob Stoklund Olesen2013-06-281-0/+18
| | | | | | | | | | | Allow a BlockFrequency to be divided by a non-zero BranchProbability with saturating arithmetic. This will be used to compute the frequency of a loop header given the probability of leaving the loop. Our long division algorithm already saturates on overflow, so that was a freebie. llvm-svn: 185184
* Add a convenience createUniqueDirectory function.Rafael Espindola2013-06-272-10/+2
| | | | | | | | | | | There are a few valid situation where we care about the structure inside a directory, but not about the directory itself. A simple example is for unit testing directory traversal. PathV1 had a function like this, add one to V2 and port existing users of the created temp file and delete it hack to using it. llvm-svn: 185059
* Remove unused includes.Rafael Espindola2013-06-261-1/+0
| | | | | | llvm itself is now PathV1 clean. llvm-svn: 184947
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-261-2/+4
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
* Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a ↵Benjamin Kramer2013-06-211-12/+1
| | | | | | | | frequency with a branch probability." This reverts commit r184584. Breaks PPC selfhost. llvm-svn: 184590
* BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with ↵Benjamin Kramer2013-06-211-1/+12
| | | | | | | | | | | | | | | a branch probability. Zero is used by BlockFrequencyInfo as a special "don't know" value. It also causes a sink for frequencies as you can't ever get off a zero frequency with more multiplies. This recovers a 10% regression on MultiSource/Benchmarks/7zip. A zero frequency was propagated into an inner loop causing excessive spilling. PR16402. llvm-svn: 184584
* Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.Rafael Espindola2013-06-201-4/+4
| | | | llvm-svn: 184431
* Modified the implementation of fs::GetUniqueID on Windows such that it ↵Aaron Ballman2013-06-191-0/+36
| | | | | | actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID. llvm-svn: 184351
* Avoid using PathV1.h in Program.h.Rafael Espindola2013-06-131-6/+7
| | | | llvm-svn: 183940
OpenPOWER on IntegriCloud