summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
Commit message (Collapse)AuthorAgeFilesLines
* Give RWMutex the SmartRWMutex treatment too.Owen Anderson2009-06-181-6/+6
| | | | llvm-svn: 73710
* Insert a SmartMutex templated class into the class hierarchy, which takes a ↵Owen Anderson2009-06-181-5/+5
| | | | | | | | template parameter specifying whether this mutex should become a no-op when not running in multithreaded mode. Make sys::Mutex a typedef of SmartMutex<false>, to preserve source compatibility. llvm-svn: 73709
* Add a portable wrapper for reader-writer locks.Owen Anderson2009-06-161-0/+43
| | | | llvm-svn: 73545
* glibc has two versions of strerror_r, a standards compliant one and a GNUDan Gohman2009-06-151-1/+8
| | | | | | | | | | | | | | specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always defines _GNU_SOURCE on linux platforms because glibc's headers won't compile in C++ mode without it. The GNU strerror_r doesn't always modify the buffer which causes empty error messages on linux. This patch changes MakeErrMsg to use the return value of strerror_r to get the string instead of assuming the buffer will be modified, on GLIBC. Patch by Benjamin Kramer! llvm-svn: 73396
* add a new static method to portably determine whether a patch isChris Lattner2009-06-151-0/+8
| | | | | | absolute or not, based on a patch by Gregory Curfman! llvm-svn: 73368
* Add support for outputting ANSI colors to raw_fd_ostream.Torok Edwin2009-06-041-0/+59
| | | | llvm-svn: 72854
* Untabification.Bill Wendling2009-05-301-42/+41
| | | | llvm-svn: 72604
* Work around a page size issue on Cygwin.Jay Foad2009-05-231-1/+6
| | | | llvm-svn: 72332
* termios.h contains the winsize structure we need to determine theDouglas Gregor2009-05-181-1/+4
| | | | | | | width of a terminal. Don't try to get the width of a terminal if we don't have this header. llvm-svn: 72018
* Add terminal width detection to llvm::sys::Process. This is needed toDouglas Gregor2009-05-111-0/+37
| | | | | | fix Clang PRs 4148 and 4183. llvm-svn: 71448
* Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:Daniel Dunbar2009-04-204-7/+10
| | | | | | | | | | | | | | | | | clang: error: unable to make temporary file: /etc/cc: can't make unique filename: Permission denied instead of clang: error: unable to make temporary file: /etc/cc: can't make unique filenamePermission denied for example. Also, audited the uses of MakeErrMsg to make the prefix strings consistent (not end with newline/punctuation/space/": "). llvm-svn: 69626
* fix PR3965:SIGINT handler not restored after calling ParseAST(),Chris Lattner2009-04-121-1/+2
| | | | | | patch by Alexei Svitkine! llvm-svn: 68929
* Add llvm::sys::getHostTriple and removeDaniel Dunbar2009-03-311-9/+25
| | | | | | | | | | | llvm::sys::getOS{Name,Version}. Right now the implementation just derives from LLVM_HOSTTRIPLE (which is wrong, but it doesn't look like we have a define for the target triple). Ideally this routine would actually be able to compute the triple for targets we care about. llvm-svn: 68118
* fix a bug Alexei Svitkine pointed out.Chris Lattner2009-03-231-2/+2
| | | | llvm-svn: 67510
* When we restore signal handlers, restore them back to what theyChris Lattner2009-03-231-8/+30
| | | | | | | were when we came around, not to their default handler. This should fix PR3848 llvm-svn: 67509
* factorize signal registration, part of PR3848.Chris Lattner2009-03-231-10/+23
| | | | llvm-svn: 67508
* add some explicit llvm:: qualifiers to the unix side, fix problems on the ↵Chris Lattner2009-03-081-4/+5
| | | | | | windows side. llvm-svn: 66386
* When a crash signal is delivered do two things: remove all of ourChris Lattner2009-03-071-5/+14
| | | | | | | | | signal handlers to prevent reentrance on unrelated things (a sigabort where the handle bus errors) also, clear the signal mask so that the signal doesn't infinitely reissue. This fixes rdar://6654827 - Crash causes clang to loop llvm-svn: 66330
* move some code to gracefully handle the case when a handler crashes.Chris Lattner2009-03-051-4/+6
| | | | llvm-svn: 66171
* Add a new 'AddSignalHandler' function to Signals.h that allowsChris Lattner2009-03-041-94/+68
| | | | | | | | | | | | | arbitrary functions to be run when a crash happens. Delete RemoveDirectoryOnSignal as it is dead and has never had clients. Change PrintStackTraceOnErrorSignal to be implemented in terms of AddSignalHandler. I updated the Win32 versions of these APIs, but can't test them. If there are any problems, I'd be happy to fix them as well. llvm-svn: 66072
* Fix main executable path name resolution on FreeBSD, patch by Chris Lattner2009-03-021-1/+60
| | | | | | Ed Schouten! llvm-svn: 65882
* If an executable is run through a symlink, dladdr will return theChris Lattner2009-02-191-3/+8
| | | | | | | | symlink. We really want the ultimate executable being run, not the symlink. This lets clang find its headers when invoked through a symlink. rdar://6602012 llvm-svn: 65017
* Fix warning on gcc 4.3.Mikhail Glushenkov2009-02-151-1/+4
| | | | | | "system() declared with attribute warn_unused_result." llvm-svn: 64574
* Whitespace fixes.Mikhail Glushenkov2009-02-151-58/+58
| | | | llvm-svn: 64573
* Use const, to support platforms where strrchr returns a const char *.Dan Gohman2009-02-101-2/+2
| | | | | | This fixes PR3535. llvm-svn: 64224
* Add a Sleep() function.Mikhail Glushenkov2009-02-081-0/+4
| | | | llvm-svn: 64101
* Add Emacs hints to Alarm.inc.Mikhail Glushenkov2009-02-082-6/+6
| | | | | | Also removes some trailing whitespace and fixes one 80-column violation. llvm-svn: 64094
* rename methods in System/Host to be more consistent.Chris Lattner2009-01-221-2/+2
| | | | llvm-svn: 62776
* Don't use plain %x to print pointer values. I had changed it from %pDan Gohman2008-12-051-1/+2
| | | | | | | | | since %p isn't formatted consistently, but obviously plain %x is wrong. PRIxPTR with a cast to uintptr_t would work here, but that requires inconvenient build-system changes. %lu works on all current and foreseable future hosts. llvm-svn: 60616
* Demangle and pretty-print symbols in internal backtraces. Patch byDan Gohman2008-12-051-0/+44
| | | | | | Wesley Peck, with a few fixes by me. llvm-svn: 60605
* Update the stub and callback code to handle lazy compilation. The stubJim Grosbach2008-10-201-0/+21
| | | | | | | | | | is re-written by the callback to branch directly to the compiled code in future invocations. Added back in range-based memory permission functions for the updating of the stub on Darwin. llvm-svn: 57846
* On Darwin ARM, memory needs special handling to do JIT. This patch expandsJim Grosbach2008-10-031-1/+25
| | | | | | | this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. llvm-svn: 57013
* Add llvm::sys::{osName,osVersion} for retrieving operating system nameDaniel Dunbar2008-10-021-0/+42
| | | | | | | & version as strings. - Win32 code is untested. llvm-svn: 56942
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-181-0/+29
| | | | | | privilege from read / write to read / executable. llvm-svn: 56303
* AllocateRWXMemory -> AllocateRWX.Evan Cheng2008-09-161-1/+1
| | | | llvm-svn: 56244
* add a helper method to sys::Path for clang, patch byChris Lattner2008-08-111-0/+6
| | | | | | Kovarththanan Rajaratnam! llvm-svn: 54655
* Create temp. file in current path.Devang Patel2008-07-241-6/+3
| | | | llvm-svn: 53973
* While creating temp. file on disk, if the current filename points to a ↵Devang Patel2008-07-221-2/+8
| | | | | | existing directory then create new temp. file inside the directory. llvm-svn: 53929
* Fix GetMainExecutable. Patch by Sam Bishop.Seo Sanghyeon2008-06-271-4/+2
| | | | llvm-svn: 52847
* Add a missing semicolon.Wojciech Matyjewicz2008-06-151-1/+1
| | | | llvm-svn: 52290
* Fix the sys::Path::getSuffix() implementation.Argyrios Kyrtzidis2008-06-151-0/+16
| | | | llvm-svn: 52288
* Fix redirection of stderr in sys::Program::ExecuteAndWait. There was logicMatthijs Kooijman2008-06-121-4/+11
| | | | | | | | | | | | | error that caused it to redirect stderr to stdout too often. This fix is applied identically to the win32 code as well, but that is untested. --Thi line, and those below, will be ignored-- M System/Unix/Program.inc M System/Win32/Program.inc llvm-svn: 52233
* Make I/O redirection handling in sys::Program a bit more consistent. NoMatthijs Kooijman2008-06-121-21/+13
| | | | | | | | | | | | | functional changes. Win32 code is untested, but should work fine. In the unix variant, rename RedirectFD to RedirectIO and let that function handle empty and null paths instead of doing that in the caller 3 times. This is the same as win32 already does it. In the win32 variant, use Path::isEmpty() instead of checking the resulting c_str() manually. This is the same as unix already does it. llvm-svn: 52230
* Unbreak build.Bill Wendling2008-05-291-3/+3
| | | | llvm-svn: 51709
* Remove more iostream header includes. Needed to implement a "FlushStream"Bill Wendling2008-05-291-3/+3
| | | | | | function to flush a specified std::ostream. llvm-svn: 51705
* Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.Dan Gohman2008-05-141-2/+4
| | | | llvm-svn: 51088
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-1/+1
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Make constructors target-specific. This fixes problems where the path wouldNick Lewycky2008-05-111-0/+6
| | | | | | include backslashes on Windows. This should fix llvm-ld problems on win32. llvm-svn: 50960
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-054-5/+6
| | | | llvm-svn: 50659
* Restore code to disable crash catcher on older OS X systemsNate Begeman2008-04-121-1/+25
| | | | llvm-svn: 49568
OpenPOWER on IntegriCloud