summaryrefslogtreecommitdiff
path: root/lib/System
Commit message (Collapse)AuthorAge
* Factor out the handler work from SignalHandler into a helper function,Dan Gohman2010-05-27
| | | | | | | | | | and change llvm::sys::RunInterruptHandlers to call that function directly instead of calling SignalHandler, because the rest of SignalHandler invokes side effects which aren't appropriate, including raising the signal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104896 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't bother clearing the Magic string when the magic numberDan Gohman2010-05-27
| | | | | | | can't be read, since it isn't cleared on other error paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104852 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't bother checking canRead() before calling getMagicNumber();Dan Gohman2010-05-27
| | | | | | | getMagicNumber() does its own error checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104851 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanupDaniel Dunbar2010-05-08
| | | | | | stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103333 91177308-0d34-0410-b5e6-96231b3b80d8
* This doesn't need SmallVector.h anymore.Dan Gohman2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101790 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this for std::vectors which don't have .data().Dan Gohman2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101785 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wcast-qual warnings.Dan Gohman2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101782 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 91528 and use a std::vector instead, fixing an abuse of std::string.Dan Gohman2010-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101781 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid temporary std::string in non posix_spawn path.Chris Lattner2010-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101723 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate temporary string.Benjamin Kramer2010-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101711 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly inherit the environment on darwin where environ is not available ↵Benjamin Kramer2010-04-18
| | | | | | for shared libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101710 91177308-0d34-0410-b5e6-96231b3b80d8
* This is horrible. Split the difference, and declare 'environ' on all non-DarwinNick Lewycky2010-04-18
| | | | | | | | platforms to unbreak the darwin and linux builds. The BSD folks should feel free to change the #if, if this breaks them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101703 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r101701, Darwin doesn't have 'environ'. Go figure.Nick Lewycky2010-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101702 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix linux build. posix_spawn doesn't inherit the environment by default.Nick Lewycky2010-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101701 91177308-0d34-0410-b5e6-96231b3b80d8
* make Program::Execute use posix_spawn on systems that support it,Chris Lattner2010-04-18
| | | | | | | | | | | as it is more efficient than fork/exec. Thanks to Eric for adding the autoconf check. It would be nice if a cmake guru could add a cmake check for posix_spawn as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101693 91177308-0d34-0410-b5e6-96231b3b80d8
* unnest from namespace.Chris Lattner2010-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101691 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace polution.Dan Gohman2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
* improve haiku portability, patch by Paul Davey.Chris Lattner2010-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100933 91177308-0d34-0410-b5e6-96231b3b80d8
* add minix support, patch by Kees van Reeuwijk! PR6797Chris Lattner2010-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8
* AddSignalHandler was not releasing the critical section on win32.Torok Edwin2010-03-31
| | | | | | | Patch from Gianluigi Tiesi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100003 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a grammaro.Dan Gohman2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99917 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly quote the quotes :) during cmdline construction on Windows.Anton Korobeynikov2010-03-28
| | | | | | | | | Otherwise, e.g. in the invocation like clang -DFOO=\"bar\" FOO macro got the bar value, not "bar". Patch by Alexander Esilevich! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99763 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a constructor implementation that isn't declaredChris Lattner2010-03-26
| | | | | | | | | in the header. How can both clang and gcc accept this? PR6703 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99658 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a false-positive memory leak in code using RemoveFileOnSignal(). BecauseJeffrey Yasskin2010-03-17
| | | | | | | | | libstdc++'s std::string class points to the interior of an allocation, valgrind reports strings still alive at program termination as possible leaks. I didn't use a ManagedStatic for this because System can't depend on Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98716 91177308-0d34-0410-b5e6-96231b3b80d8
* Tell Valgrind when we modify already-executed machine code so it knowsJeffrey Yasskin2010-03-15
| | | | | | | | | to re-instrument the code. We depend on the system valgrind.h to avoid adding a new license. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8
* don't forget to close a FD on an error condition, found byChris Lattner2010-03-14
| | | | | | | cppcheck, PR6617. Patch by Ettl Martin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98525 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove superfluous NULL assignmentKovarththanan Rajaratnam2010-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98350 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake build.Ted Kremenek2010-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98250 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang bootstrap happier on OSX 10.5 by reducing the number of headersJeffrey Yasskin2010-03-11
| | | | | | | | | | included when using global symbols to ask the linker for the addresses of various functions. One of the symbols was actually getting declared by a header included in DynamicLibrary.cpp, which conflicted with the "extern void*" declaration in SearchForAddressOfSpecialSymbol(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98243 91177308-0d34-0410-b5e6-96231b3b80d8
* follow-on to PR6280Chris Lattner2010-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96172 91177308-0d34-0410-b5e6-96231b3b80d8
* improve support for minix, PR6280, patch byChris Lattner2010-02-12
| | | | | | | Kees van Reeuwijk! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95946 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::Program::ChangeStderrToBinary().Douglas Gregor2010-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94743 91177308-0d34-0410-b5e6-96231b3b80d8
* mark some libraries that currently require RTTI.Chris Lattner2010-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94377 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TimeValue::now() on Unix.Torok Edwin2010-01-22
| | | | | | | | | | TimeValue()::now().toEpochTime() is supposed to be the same as time(), but it wasn't, because toEpoch subtracted PosixZeroTime, but now() didn't add PosixZeroTime! Add a unittest to check this works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94178 91177308-0d34-0410-b5e6-96231b3b80d8
* Stubs for getHostCPUFeatures API. This implements part of PR5389.Xerxes Ranby2010-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93913 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove spurious semicolon.Anton Korobeynikov2010-01-14
| | | | | | Patch by Diego Iastrubni! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93450 91177308-0d34-0410-b5e6-96231b3b80d8
* Alternative fix to make sure that the extern declarations used byDouglas Gregor2009-12-23
| | | | | | | | | DynamicLibrary::SearchForAddressOfSymbol refer to declarations in the global namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92023 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 92020 until I figure out a more portable fixDouglas Gregor2009-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92021 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the extern symbol declarations outside ofDouglas Gregor2009-12-23
| | | | | | | | | | | | | | DynamicLibrary::SearchForAddressOfSymbol and force them to have "C" linkage. Interestingly, GCC treats the block-scoped "extern" declarations we previously had as if they were extern "C" declarations (or, at least, were in the global namespace), so that GCC bug papered over this LLVM bug. Clang and EDG get the linkage correct; this new variant seems to work for both GCC and Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92020 91177308-0d34-0410-b5e6-96231b3b80d8
* move a few more symbols to .rodataNuno Lopes2009-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92011 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Win32 Path.inc for API update.Daniel Dunbar2009-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91706 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Path use StringRef instead of std::string where possible.Jeffrey Yasskin2009-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91620 91177308-0d34-0410-b5e6-96231b3b80d8
* remove use of SmallVector from Path::makeUnique. Path::makeUniqueChris Lattner2009-12-16
| | | | | | | is not used by anything performance sensitive, so just use std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91528 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate an extraneous use of SmallVector in a case whereChris Lattner2009-12-16
| | | | | | | a fixed size buffer is perfectly fine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91527 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "generic" fallback.Torok Edwin2009-12-14
| | | | | | | | gcc warned that the function may not have a return value, indeed for non-intel and non-amd X86 CPUs it is right (VIA, etc.). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91276 91177308-0d34-0410-b5e6-96231b3b80d8
* Using _MSC_VER there was wrong, better just use the already existing ifdefs forTorok Edwin2009-12-13
| | | | | | | | x86 CPU detection for the X86 getHostCPUName too, and create a simple getHostCPUName that returns "generic" for all else. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91240 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable CPU detection when using MS VS 2k8 too.Torok Edwin2009-12-12
| | | | | | | | MSVS2k8 doesn't define __i386__, hence all the CPU detection code was disabled. Enable it by looking for _MSC_VER. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91217 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove spurious extern.Daniel Dunbar2009-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90937 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes the Atomic implementation if compiled by MSVC compiler.Oscar Fuentes2009-12-07
| | | | | | | | | | sys::cas_flag should be long on this platform, InterlockedAdd() is defined only for the Itanium architecture (according to MSDN). Patch by Michael Beck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90748 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead returns.Benjamin Kramer2009-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90083 91177308-0d34-0410-b5e6-96231b3b80d8