- Apr 05, 2013
-
-
rdar://problem/13551789Douglas Gregor authored
If the directory that will contain the unique file doesn't exist when we tried to create the file, but another process creates it before we get a chance to try creating it, we would bail out rather than try to create the unique file. llvm-svn: 178908
-
- Mar 26, 2013
-
-
Nick Lewycky authored
it's only really useful if you're going to crash anyways. Use it in the pretty stack trace printer to kill the compiler if we hang while printing the stack trace. llvm-svn: 177962
-
- Mar 14, 2013
-
-
Akira Hatanaka authored
Patch by Stephen Hines. llvm-svn: 177101
-
Michael J. Spencer authored
Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file descriptor passed in. So don't. llvm-svn: 176995
-
- Feb 28, 2013
-
-
Argyrios Kyrtzidis authored
[PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite loop by constantly trying to create the parent path. This can happen if the path is a relative filename and the current directory was removed. Thanks to Daniel D. for the hint in fixing it. llvm-svn: 176226
-
- Feb 20, 2013
-
-
Dan Gohman authored
llvm-svn: 175651
-
Krzysztof Parzyszek authored
llvm-svn: 175650
-
Dan Gohman authored
llvm-svn: 175648
-
Krzysztof Parzyszek authored
loads. On FreeBSD, add PROT_READ page protection flag before flushing cache. llvm-svn: 175646
-
- Feb 19, 2013
-
-
Alexey Samsonov authored
Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option. llvm-svn: 175509
-
- Feb 14, 2013
-
-
Evgeniy Stepanov authored
llvm-svn: 175156
-
- Feb 04, 2013
-
-
Evgeniy Stepanov authored
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains fixes for 2 issues: - X86JIT reads return address from stack, which MSan does not know is initialized. - bugpoint tests run binaries with RLIMIT_AS. This does not work with certain Sanitizers. We are no longer including config.h in Compiler.h with this change. llvm-svn: 174306
-
- Jan 28, 2013
-
-
Edwin Vane authored
Remove the use of the 't' length modifier to avoid a gcc warning. Based on usage, 32 bits of precision is good enough for printing a stack offset for a stack trace. 't' length modifier isn't in C++03 but it *is* in C++11. Added a FIXME to reintroduce once LLVM makes the switch to C++11. Reviewer: gribozavr llvm-svn: 173711
-
- Jan 10, 2013
-
-
Douglas Gregor authored
failing to create the unique file because the path doesn't exist, don't fail if someone else manages to create the path before we do. llvm-svn: 172032
-
- Jan 09, 2013
-
-
Argyrios Kyrtzidis authored
Move the internal PrintStackTrace function that is used for llvm::sys::PrintStackTraceOnErrorSignal(), into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes. llvm-svn: 171989
-
- Jan 05, 2013
-
-
Chandler Carruth authored
leaving this undefined, and despite the sentence in the standard that seems to require it, I'll cede the point and assume its a bug in the wording. Other parts of POSIX regularly allow for things to be -1 instead of undefined, this should too. Makes things more consistent too. This should have to real impact for folks though. llvm-svn: 171574
-
Chandler Carruth authored
defines _POSIX_CPUTIME but doesn't support the clock_* functions. I don't test the value of _POSIX_CPUTIME because the spec merely says that if it is defined, the CPU-specific timers are available, whereas it says that _POSIX_TIMERS must be defined and defined to a value greater than zero. However, this may not work, as the POSIX spec clearly states: "If the symbolic constant _POSIX_CPUTIME is defined, then the symbolic constant _POSIX_TIMERS shall also be defined by the implementation to have the value 200112L." If this doesn't work, I'll add more hacks for Darwin. llvm-svn: 171565
-
Chandler Carruth authored
wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. llvm-svn: 171551
-
- Jan 01, 2013
-
-
Chandler Carruth authored
I'm simplifying this interface as much as I can before merging it with the new process interface. llvm-svn: 171334
-
Chandler Carruth authored
llvm-svn: 171332
-
Chandler Carruth authored
users over to the new one. No sense maintaining this "compatibility" layer it seems. llvm-svn: 171331
-
Chandler Carruth authored
Implement the old API in terms of the new one. This simplifies the implementation on Windows which can now re-use the self_process's once initialization. llvm-svn: 171330
-
- Dec 31, 2012
-
-
Chandler Carruth authored
llvm-svn: 171327
-
Chandler Carruth authored
Fix a truly odd namespace qualifier that was flat out wrong in the process. The fully qualified namespace would have been llvm::sys::TimeValue, llvm::TimeValue makes no sense. llvm-svn: 171292
-
Chandler Carruth authored
The coding style used here is not LLVM's style because this is modeled after a Boost interface and thus done in the style of a candidate C++ standard library interface. I'll probably end up proposing it as a standard C++ library if it proves to be reasonably portable and useful. This is just the most basic parts of the interface -- getting the process ID out of it. However, it helps sketch out some of the boiler plate such as the base class, derived class, shared code, and static factory function. It also introduces a unittest so that I can incrementally ensure this stuff works. However, I've not even compiled this code for Windows yet. I'll try to fix any Windows fallout from the bots, and if I can't fix it I'll revert and get someone on Windows to help out. There isn't a lot more that is mandatory, so soon I'll switch to just stubbing out the Windows side and get Michael Spencer to help with implementation as he can test it directly. llvm-svn: 171289
-
- Dec 04, 2012
-
-
Chandler Carruth authored
missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] llvm-svn: 169224
-
- Dec 03, 2012
-
-
Chandler Carruth authored
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
-
- Nov 30, 2012
-
-
Chandler Carruth authored
Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. llvm-svn: 168996
-
- Nov 15, 2012
-
-
Daniel Dunbar authored
- The code could infinite loop trying to create unique files, if the directory containing the unique file exists, but open() calls on non-existent files in the path return ENOENT. This is true on the /dev/fd filesystem, for example. - Will add a clang side test case for this. llvm-svn: 168081
-
- Oct 17, 2012
-
-
Daniel Dunbar authored
- Similar to Path::eraseFromDisk(), we don't want LLVM to remove things like /dev/null, even if it has the permission. llvm-svn: 166105
-
- Sep 28, 2012
-
-
Benjamin Kramer authored
llvm-svn: 164817
-
- Sep 26, 2012
-
-
Sylvestre Ledru authored
For example, under a Linux chroot, /proc/ might not be mounted. Therefor, we test if this file exist. If it is the case, use it (the current behavior). Otherwise, we fall back to the detection used by *BSD. The issue has been reported initially on the Debian bug tracker: http://bugs.debian.org/674588 llvm-svn: 164676
-
- Sep 22, 2012
-
-
Eric Christopher authored
whether or not we want to print out backtrace information. Useful for libraries that don't need backtrace information on a crash. rdar://11844710 llvm-svn: 164426
-
- Sep 19, 2012
-
-
Andrew Kaylor authored
This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT. llvm-svn: 164249
-
- Sep 11, 2012
-
-
Chandler Carruth authored
Patch by Brad Smith! llvm-svn: 163584
-
- Sep 06, 2012
-
-
NAKAMURA Takumi authored
llvm-svn: 163289
-
NAKAMURA Takumi authored
llvm-svn: 163288
-
- Aug 15, 2012
-
-
Michael J. Spencer authored
llvm-svn: 161978
-
Michael J. Spencer authored
llvm-svn: 161976
-
- Aug 10, 2012
-
-
Joerg Sonnenberger authored
includes both. Deal with feof and ferror potentially being macros. llvm-svn: 161658
-