aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System
Commit message (Collapse)AuthorAgeFilesLines
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66330 91177308-0d34-0410-b5e6-96231b3b80d8
* move some code to gracefully handle the case when a handler crashes.Chris Lattner2009-03-051-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66171 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new 'AddSignalHandler' function to Signals.h that allowsChris Lattner2009-03-042-135/+83
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66072 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix main executable path name resolution on FreeBSD, patch by Chris Lattner2009-03-021-1/+60
| | | | | | | Ed Schouten! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65882 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65017 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warning on gcc 4.3.Mikhail Glushenkov2009-02-151-1/+4
| | | | | | "system() declared with attribute warn_unused_result." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64574 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace fixes.Mikhail Glushenkov2009-02-151-58/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64573 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak the build on win32.Cedric Venet2009-02-141-1/+1
| | | | | | | | | | | Cleanup some warning. Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync. Only tested with VS2008. hope it does not break anything. feel free to revert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64554 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MingW build, patch by Kenneth Boyd!Julien Lerouge2009-02-121-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64366 91177308-0d34-0410-b5e6-96231b3b80d8
* Use const, to support platforms where strrchr returns a const char *.Dan Gohman2009-02-101-2/+2
| | | | | | | This fixes PR3535. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64224 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Sleep() function.Mikhail Glushenkov2009-02-082-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64101 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Emacs hints to Alarm.inc.Mikhail Glushenkov2009-02-083-8/+8
| | | | | | Also removes some trailing whitespace and fixes one 80-column violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64094 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix windows build, patch by Marius Wachtler!Chris Lattner2009-01-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63325 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3424, a static constructor ordering issue. Patch by Robert Schuster!Chris Lattner2009-01-291-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63269 91177308-0d34-0410-b5e6-96231b3b80d8
* rename methods in System/Host to be more consistent.Chris Lattner2009-01-222-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62776 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60616 91177308-0d34-0410-b5e6-96231b3b80d8
* Demangle and pretty-print symbols in internal backtraces. Patch byDan Gohman2008-12-051-0/+44
| | | | | | | Wesley Peck, with a few fixes by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60605 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM / Mac OS X also wants to invalidate icache after jitting.Evan Cheng2008-11-141-20/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59291 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: when bulding shared libraries on non-WIN32 systems, link dl toOscar Fuentes2008-11-121-0/+4
| | | | | | | LLVMSystem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59159 91177308-0d34-0410-b5e6-96231b3b80d8
* plug leakage of mutex data. pthread_mutex_destroy() doesnt free our ↵Nuno Lopes2008-11-061-1/+1
| | | | | | malloc'ed memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58805 91177308-0d34-0410-b5e6-96231b3b80d8
* hasDisassembler should return false if disassembler isn't available.Evan Cheng2008-11-041-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58682 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a warningAnton Korobeynikov2008-11-021-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58563 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the stub and callback code to handle lazy compilation. The stubJim Grosbach2008-10-202-2/+30
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57846 91177308-0d34-0410-b5e6-96231b3b80d8
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-081-0/+1
| | | | | | | Patch by Samuel Tardieu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
* Add implementations for sys::Memory::setWritable and ↵Argyrios Kyrtzidis2008-10-041-0/+8
| | | | | | sys::Memory::setExecutable on Win32 platform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57047 91177308-0d34-0410-b5e6-96231b3b80d8
* On Darwin ARM, memory needs special handling to do JIT. This patch expandsJim Grosbach2008-10-032-12/+25
| | | | | | | | this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57013 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Added Host.cpp to lib/System/CMakeLists.txt.Oscar Fuentes2008-10-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56957 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::sys::{osName,osVersion} for retrieving operating system nameDaniel Dunbar2008-10-023-0/+101
| | | | | | | | & version as strings. - Win32 code is untested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56942 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the CMake build system.Oscar Fuentes2008-09-221-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-182-0/+40
| | | | | | privilege from read / write to read / executable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56303 91177308-0d34-0410-b5e6-96231b3b80d8
* AllocateRWXMemory -> AllocateRWX.Evan Cheng2008-09-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56244 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method to sys::Path for clang, patch byChris Lattner2008-08-112-0/+13
| | | | | | | Kovarththanan Rajaratnam! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54655 91177308-0d34-0410-b5e6-96231b3b80d8
* Create temp. file in current path.Devang Patel2008-07-241-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53973 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53929 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle bitcode wrappers.Devang Patel2008-07-221-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53924 91177308-0d34-0410-b5e6-96231b3b80d8
* open plugins with RTLD_GLOBAL, pointed out by Bram Adams.Chris Lattner2008-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53385 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a little wrapper header that is put around bc files when emittingChris Lattner2008-07-091-1/+6
| | | | | | | | | | | | | | | | | bc files for modules with a target triple that indicates they are for darwin. The reader unconditionally handles this, and the writer could turn this on for more targets if we care. This change has two benefits for darwin: 1) it allows us to encode the cpu type of the file in an easy to read place that doesn't require decoding the bc file. 2) it works around a bug (IMO) in darwin's AR where it is incapable of handling files that are not a multiple of 8 bytes long. BC files are only guaranteed to be multiples of 4 bytes long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53275 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix GetMainExecutable. Patch by Sam Bishop.Seo Sanghyeon2008-06-271-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52847 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM compile on DragonFly BSD (PR2499).Matthijs Kooijman2008-06-261-1/+1
| | | | | | | Patch by Hasso Tepper! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52781 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup for unitialized types. Patch by Jean-Daniel Dupas!Bill Wendling2008-06-261-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52775 91177308-0d34-0410-b5e6-96231b3b80d8
* "An improved Mach-O file type detection for sys::IdentifyFileType()Chris Lattner2008-06-261-18/+32
| | | | | | | | | | | This patch add supports for single architecture mach-o files (the current implementation only support Universal Binary), and solve the signature conflict between java class and Universal Binary magics. Note that this function will always returned dynamic library for Universal Binaries (like the current implementation) because the binary type is not include in the file header." Patch by Jean-Daniel Dupas! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52766 91177308-0d34-0410-b5e6-96231b3b80d8
* fix compilation errors in my previous patchChris Lattner2008-06-251-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52733 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new InvalidateInstructionCache method to sys::Memory.Chris Lattner2008-06-251-6/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52731 91177308-0d34-0410-b5e6-96231b3b80d8
* Use static_cast instead of reinterpret_cast for casting void*.Dan Gohman2008-06-211-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52592 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor comment fix.Argyrios Kyrtzidis2008-06-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52312 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing semicolon.Wojciech Matyjewicz2008-06-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52290 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the sys::Path::getSuffix() implementation.Argyrios Kyrtzidis2008-06-153-5/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52288 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the environment block that is passed to the CreateProcess function.Argyrios Kyrtzidis2008-06-151-1/+28
| | | | | | This bug made llvm-ld unable to function with "-native" option, since the process that was used to call 'gcc' was crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52284 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix redirection of stderr in sys::Program::ExecuteAndWait. There was logicMatthijs Kooijman2008-06-122-9/+19
| | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52233 91177308-0d34-0410-b5e6-96231b3b80d8