Rafael Espindola
a8a9f1baf0
We now always create files with the correct permissions. Simplify the interface.
...
llvm-svn: 185834
2013-07-08 16:42:01 +00:00
Rafael Espindola
2eb1ae4f91
Fix windows build.
...
llvm-svn: 185730
2013-07-05 22:32:33 +00:00
Rafael Espindola
155cf0f3a6
Use sys::fs::createTemporaryFile.
...
llvm-svn: 185719
2013-07-05 20:14:52 +00:00
Jakob Stoklund Olesen
3192b2fcea
Fix a bad overflow check pointed out by Ben.
...
llvm-svn: 185226
2013-06-28 21:51:18 +00:00
Jakob Stoklund Olesen
c506e5d98c
Add a division operator to BlockFrequency.
...
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
2013-06-28 18:23:42 +00:00
Rafael Espindola
7ffacc4992
Add a convenience createUniqueDirectory function.
...
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
2013-06-27 03:45:31 +00:00
Rafael Espindola
479a9bd0ba
Remove unused includes.
...
llvm itself is now PathV1 clean.
llvm-svn: 184947
2013-06-26 13:54:34 +00:00
Rafael Espindola
e03dfd9b0a
Port GetMainExecutable over to PathV2.
...
I will remove the V1 version as soon as I change clang in the next commit.
llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Benjamin Kramer
bfb84d0bd6
Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."
...
This reverts commit r184584. Breaks PPC selfhost.
llvm-svn: 184590
2013-06-21 20:20:27 +00:00
Benjamin Kramer
bd0f107929
BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with 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
2013-06-21 19:30:05 +00:00
Rafael Espindola
7cf7c51cc4
Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.
...
llvm-svn: 184431
2013-06-20 15:06:35 +00:00
Aaron Ballman
9fbe530d74
Modified the implementation of fs::GetUniqueID on Windows such that it actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID.
...
llvm-svn: 184351
2013-06-19 21:03:50 +00:00
Rafael Espindola
7c1023ad27
Avoid using PathV1.h in Program.h.
...
llvm-svn: 183940
2013-06-13 20:25:38 +00:00
Rafael Espindola
cb2eca0f91
Remove the program class.
...
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.
llvm-svn: 183864
2013-06-12 20:58:35 +00:00
Rafael Espindola
3bc8e71909
Move PathV2.h to Path.h
...
Most clients have already been moved from Path V1 to V2. The ones using V1
now include PathV1.h explicitly.
llvm-svn: 183801
2013-06-11 22:21:28 +00:00
Aaron Ballman
f0b5384ef9
sys::process::get_id() now returns the process ID instead of a process handle on Windows. Patch thanks to Kim Gräsman!
...
llvm-svn: 183621
2013-06-08 20:29:03 +00:00
Eric Christopher
1ec87e8bb0
Add support for adding the contents of a StringRef to the MD5 hash.
...
llvm-svn: 183054
2013-05-31 22:34:56 +00:00
Eric Christopher
85bd745e77
Convert more unsigned char -> uint8_t.
...
llvm-svn: 183053
2013-05-31 22:34:52 +00:00
Eric Christopher
8463b42781
Add a comment and some tests including the NULL byte.
...
llvm-svn: 182900
2013-05-30 00:43:26 +00:00
Eric Christopher
ba63e07f3a
Add to testsuite.
...
llvm-svn: 182693
2013-05-24 23:20:16 +00:00
Eric Christopher
fcee6f0abc
ArrayRef-ize MD5 and clean up a few variable names.
...
Add a stringize method to make dumping a bit easier, and add a testcase
exercising a few different paths.
llvm-svn: 182692
2013-05-24 23:08:17 +00:00
Michael J. Spencer
a8db3f6fa7
[Support] Remove Count{Leading,Trailing}Zeros_{32,64}.
...
llvm-svn: 182690
2013-05-24 22:58:37 +00:00
Michael J. Spencer
795ecd2c43
[Support][MathExtras] Fix literal type issues.
...
llvm-svn: 182679
2013-05-24 22:19:05 +00:00
Michael J. Spencer
eb91eac9fb
[Support] Add type generic bit utilities to MathExtras.h
...
llvm-svn: 182667
2013-05-24 20:29:47 +00:00
Duncan Sands
b33790d898
Get the unittests compiling when building with cmake and the setting
...
-DLLVM_ENABLE_THREADS=false.
llvm-svn: 181788
2013-05-14 13:29:16 +00:00
Andrew Trick
7cb710d58c
Implemented public interface for modifying registered (not positional or sink options) command line options at runtime.
...
Patch by Dan Liew!
llvm-svn: 181254
2013-05-06 21:56:35 +00:00
Andrew Trick
0537a98878
Support command line option categories.
...
Patch by Dan Liew!
llvm-svn: 181253
2013-05-06 21:56:23 +00:00
Reid Kleckner
95012aaa93
Try to fix ProgramTest on FreeBSD
...
This seemed like the cleanest way to find the test executable. Also fix
the file mode.
llvm-svn: 180770
2013-04-30 04:30:41 +00:00
Reid Kleckner
206ddd0734
Don't forward declare environ on Windows
...
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
2013-04-24 17:50:30 +00:00
Reid Kleckner
de0c26046d
Un-revert the environ copy in ProgramTest after fixing it on OS X
...
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
2013-04-23 13:15:51 +00:00
Alexey Samsonov
28acf056e1
Add more guards around zlib-dependent code
...
llvm-svn: 180084
2013-04-23 08:57:30 +00:00
Alexey Samsonov
2fb337e77a
Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools.
...
llvm-svn: 180083
2013-04-23 08:28:39 +00:00
Michael Gottesman
6718a3b67d
Revert "Add a missing reference on a std::vector<> out param"
...
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
2013-04-22 22:51:55 +00:00
Reid Kleckner
7ff21d934e
Add a missing reference on a std::vector<> out param
...
Pointed out by Eli. The test passes for me either way, so I missed
this.
llvm-svn: 180046
2013-04-22 20:58:09 +00:00
Reid Kleckner
21a8c2f361
[Support] Propagate the environment into the test child process
...
Should fix the dragonegg bootstrap builder, which reasonably needs
LD_LIBRARY_PATH to be set.
llvm-svn: 180041
2013-04-22 20:23:41 +00:00
Reid Kleckner
74679a93b2
[Support] Fix argv string escape bug on Windows
...
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
2013-04-22 19:03:55 +00:00
Michael J. Spencer
b8055cbc9d
[Support][FileSystem] Fix identify_magic for big endian ELF.
...
llvm-svn: 178905
2013-04-05 20:10:04 +00:00
Evgeniy Stepanov
11820f4bf0
Disable Initialize.MultipleThreads test under MemorySanitizer.
...
Fails due to insufficient thread stack.
llvm-svn: 178135
2013-03-27 12:50:49 +00:00
Aaron Ballman
fcdf9a8240
Test case for graceful handling of long file names on Windows. Patch thanks to Paul Robinson!
...
llvm-svn: 177223
2013-03-16 15:00:51 +00:00
Michael J. Spencer
01ac34e4c3
[Support][Test] Missed this in the API change.
...
llvm-svn: 176996
2013-03-14 00:33:37 +00:00
Michael J. Spencer
12e3dfc58e
[Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
...
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
Michael J. Spencer
18131ae08d
[Support][ErrorOr] Add support for convertable types.
...
Thanks to Andrew, David, and Aaron for helping fix this.
llvm-svn: 174552
2013-02-06 22:28:53 +00:00
Andrew Trick
780ebadc1a
Revert "[Support][ErrorOr] Add support for convertable types."
...
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.
This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.
llvm-svn: 174458
2013-02-05 22:50:20 +00:00
Michael J. Spencer
31876b4efd
[Support][ErrorOr] Add support for convertable types.
...
llvm-svn: 174357
2013-02-05 08:22:27 +00:00
NAKAMURA Takumi
cbc86bcbb5
unittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3) only on Linux.
...
I got blamed on darwin11;
unittests/Support/ManagedStatic.cpp:35: error: 'pthread_attr_setstack' was not declared in this scope
llvm-svn: 173355
2013-01-24 15:29:27 +00:00
NAKAMURA Takumi
2998dcbac5
unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.
...
llvm-svn: 173350
2013-01-24 14:44:02 +00:00
Michael J. Spencer
f71baa84ea
[Support][ErrorOr] Add optimized specialization of ErrorOr<void>.
...
ErrorOr<void> represents an operation that returns nothing, but can still fail.
It should be used in cases where you need the aditional user data that ErrorOr
provides over error_code.
llvm-svn: 173209
2013-01-23 00:18:31 +00:00
NAKAMURA Takumi
08e028e194
ErrorOrTest.cpp: Check existence of EXPECT_DEBUG_DEATH. It is not always available.
...
llvm-svn: 173123
2013-01-22 04:02:41 +00:00
Michael J. Spencer
b21371018c
[Support] Make test C++03.
...
llvm-svn: 173004
2013-01-21 05:39:07 +00:00
Benjamin Kramer
135658f4bc
Disable test that fails due to lack of std::true_type in C++03.
...
Michael, can this test be ported to C++03?
llvm-svn: 172996
2013-01-20 21:52:27 +00:00