summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove the program class.Rafael Espindola2013-06-121-3/+3
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. llvm-svn: 183864
* Move PathV2.h to Path.hRafael Espindola2013-06-112-2/+2
| | | | | | | Most clients have already been moved from Path V1 to V2. The ones using V1 now include PathV1.h explicitly. llvm-svn: 183801
* sys::process::get_id() now returns the process ID instead of a process ↵Aaron Ballman2013-06-081-1/+1
| | | | | | handle on Windows. Patch thanks to Kim Gräsman! llvm-svn: 183621
* Add support for adding the contents of a StringRef to the MD5 hash.Eric Christopher2013-05-311-6/+15
| | | | llvm-svn: 183054
* Convert more unsigned char -> uint8_t.Eric Christopher2013-05-311-9/+9
| | | | llvm-svn: 183053
* Add a comment and some tests including the NULL byte.Eric Christopher2013-05-301-0/+9
| | | | llvm-svn: 182900
* Add to testsuite.Eric Christopher2013-05-241-0/+1
| | | | llvm-svn: 182693
* ArrayRef-ize MD5 and clean up a few variable names.Eric Christopher2013-05-241-0/+42
| | | | | | | Add a stringize method to make dumping a bit easier, and add a testcase exercising a few different paths. llvm-svn: 182692
* [Support] Remove Count{Leading,Trailing}Zeros_{32,64}.Michael J. Spencer2013-05-241-16/+12
| | | | llvm-svn: 182690
* [Support][MathExtras] Fix literal type issues.Michael J. Spencer2013-05-241-36/+36
| | | | llvm-svn: 182679
* [Support] Add type generic bit utilities to MathExtras.hMichael J. Spencer2013-05-241-0/+91
| | | | llvm-svn: 182667
* Get the unittests compiling when building with cmake and the settingDuncan Sands2013-05-141-1/+2
| | | | | | -DLLVM_ENABLE_THREADS=false. llvm-svn: 181788
* Implemented public interface for modifying registered (not positional or ↵Andrew Trick2013-05-061-3/+47
| | | | | | | | sink options) command line options at runtime. Patch by Dan Liew! llvm-svn: 181254
* Support command line option categories.Andrew Trick2013-05-061-0/+8
| | | | | | Patch by Dan Liew! llvm-svn: 181253
* Try to fix ProgramTest on FreeBSDReid Kleckner2013-04-301-3/+4
| | | | | | | This seemed like the cleanest way to find the test executable. Also fix the file mode. llvm-svn: 180770
* Don't forward declare environ on WindowsReid Kleckner2013-04-241-4/+2
| | | | | | | | | That seems to interact poorly with the environ and _environ macros defined in MSVC's <stdlib.h>. Also remove the incorrect comment about _NSGetEnviron(). llvm-svn: 180200
* Un-revert the environ copy in ProgramTest after fixing it on OS XReid Kleckner2013-04-231-2/+29
| | | | | | | | | | This was r180041 and r180046, which was reverted in r180066. Re-committing this should fix the dragonegg bootstrap, which I presume needs LD_LIBRARY_PATH to be propagated to the child. Tested on Linux, Windows, and Mac OS 10.6. llvm-svn: 180099
* Add more guards around zlib-dependent codeAlexey Samsonov2013-04-231-1/+1
| | | | llvm-svn: 180084
* Add basic zlib support to LLVM. This would allow to use ↵Alexey Samsonov2013-04-232-0/+69
| | | | | | compression/uncompression in selected LLVM tools. llvm-svn: 180083
* Revert "Add a missing reference on a std::vector<> out param"Michael Gottesman2013-04-221-17/+2
| | | | | | | | | | | | | Revert "[Support] Propagate the environment into the test child process" This reverts commit r180046. This reverts commit r180041. These have broken buildbots for ~3 hours: http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/763 llvm-svn: 180066
* Add a missing reference on a std::vector<> out paramReid Kleckner2013-04-221-1/+1
| | | | | | | Pointed out by Eli. The test passes for me either way, so I missed this. llvm-svn: 180046
* [Support] Propagate the environment into the test child processReid Kleckner2013-04-221-2/+17
| | | | | | | Should fix the dragonegg bootstrap builder, which reasonably needs LD_LIBRARY_PATH to be set. llvm-svn: 180041
* [Support] Fix argv string escape bug on WindowsReid Kleckner2013-04-222-0/+64
| | | | | | | | | | | | | | | | Summary: This is http://llvm.org/PR15802. Backslashes preceding double quotes in arguments must be escaped. The interesting bit is that all other backslashes should *not* be escaped, because the un-escaping logic is only triggered by the presence of a double quote character. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D705 llvm-svn: 180035
* [Support][FileSystem] Fix identify_magic for big endian ELF.Michael J. Spencer2013-04-051-2/+10
| | | | llvm-svn: 178905
* Disable Initialize.MultipleThreads test under MemorySanitizer.Evgeniy Stepanov2013-03-271-1/+1
| | | | | | Fails due to insufficient thread stack. llvm-svn: 178135
* Test case for graceful handling of long file names on Windows. Patch thanks ↵Aaron Ballman2013-03-161-0/+12
| | | | | | to Paul Robinson! llvm-svn: 177223
* [Support][Test] Missed this in the API change.Michael J. Spencer2013-03-141-0/+1
| | | | llvm-svn: 176996
OpenPOWER on IntegriCloud