Commit Graph

666 Commits

Author SHA1 Message Date
Duncan Sands a349d522f7 Avoid "variable 'bits' set but not used [-Wunused-but-set-variable]"
warnings with gcc-4.6, by not setting bits when the result is not
used.

llvm-svn: 105790
2010-06-10 16:23:15 +00:00
Dan Gohman 288999b829 Factor out the handler work from SignalHandler into a helper function,
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.

llvm-svn: 104896
2010-05-27 23:11:55 +00:00
Dan Gohman 78d1e84521 Don't bother clearing the Magic string when the magic number
can't be read, since it isn't cleared on other error paths.

llvm-svn: 104852
2010-05-27 17:14:10 +00:00
Dan Gohman 16f4bd8140 Don't bother checking canRead() before calling getMagicNumber();
getMagicNumber() does its own error checking.

llvm-svn: 104851
2010-05-27 17:12:23 +00:00
Daniel Dunbar 68272566c6 Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup
stuff.

llvm-svn: 103333
2010-05-08 02:10:34 +00:00
Dan Gohman b0071d041f This doesn't need SmallVector.h anymore.
llvm-svn: 101790
2010-04-19 17:51:31 +00:00
Dan Gohman 3457061a66 Fix this for std::vectors which don't have .data().
llvm-svn: 101785
2010-04-19 16:33:28 +00:00
Dan Gohman f656397cc0 Fix -Wcast-qual warnings.
llvm-svn: 101782
2010-04-19 15:55:10 +00:00
Dan Gohman a84dc0cc6e Revert 91528 and use a std::vector instead, fixing an abuse of std::string.
llvm-svn: 101781
2010-04-19 15:54:44 +00:00
Chris Lattner d3db453d15 avoid temporary std::string in non posix_spawn path.
llvm-svn: 101723
2010-04-18 17:34:10 +00:00
Benjamin Kramer 5b4be748cb Eliminate temporary string.
llvm-svn: 101711
2010-04-18 09:19:41 +00:00
Benjamin Kramer 1360e9e270 Properly inherit the environment on darwin where environ is not available for shared libraries.
llvm-svn: 101710
2010-04-18 09:16:04 +00:00
Nick Lewycky 554a39889b This is horrible. Split the difference, and declare 'environ' on all non-Darwin
platforms to unbreak the darwin and linux builds. The BSD folks should feel
free to change the #if, if this breaks them.

llvm-svn: 101703
2010-04-18 07:07:48 +00:00
Nick Lewycky 320aa4a493 Revert r101701, Darwin doesn't have 'environ'. Go figure.
llvm-svn: 101702
2010-04-18 06:44:21 +00:00
Nick Lewycky 3fdf58800a Fix linux build. posix_spawn doesn't inherit the environment by default.
llvm-svn: 101701
2010-04-18 06:22:26 +00:00
Chris Lattner a50738abba make Program::Execute use posix_spawn on systems that support it,
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.

llvm-svn: 101693
2010-04-18 04:14:37 +00:00
Chris Lattner d9e22a8a61 unnest from namespace.
llvm-svn: 101691
2010-04-18 03:33:55 +00:00
Dan Gohman b29cda9b3c Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Chris Lattner 3a747aef96 improve haiku portability, patch by Paul Davey.
llvm-svn: 100933
2010-04-10 17:54:51 +00:00
Chris Lattner c86cdc7d47 add minix support, patch by Kees van Reeuwijk! PR6797
llvm-svn: 100895
2010-04-09 20:45:04 +00:00
Torok Edwin 6fb0956291 AddSignalHandler was not releasing the critical section on win32.
Patch from Gianluigi Tiesi!

llvm-svn: 100003
2010-03-31 12:07:16 +00:00
Dan Gohman 39027c403c Fix a grammaro.
llvm-svn: 99917
2010-03-30 20:04:57 +00:00
Anton Korobeynikov c2747d068e Properly quote the quotes :) during cmdline construction on Windows.
Otherwise, e.g. in the invocation like clang -DFOO=\"bar\" FOO macro
got the bar value, not "bar".

Patch by Alexander Esilevich!

llvm-svn: 99763
2010-03-28 15:07:02 +00:00
Chris Lattner 574907ed88 remove a constructor implementation that isn't declared
in the header.  How can both clang and gcc accept this?

PR6703

llvm-svn: 99658
2010-03-26 22:17:24 +00:00
Jeffrey Yasskin c4e3f05380 Fix a false-positive memory leak in code using RemoveFileOnSignal(). Because
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.

llvm-svn: 98716
2010-03-17 07:08:12 +00:00
Jeffrey Yasskin 3ddd88f523 Tell Valgrind when we modify already-executed machine code so it knows
to re-instrument the code.  We depend on the system valgrind.h to
avoid adding a new license.

llvm-svn: 98529
2010-03-15 04:57:55 +00:00
Chris Lattner 65a437fb80 don't forget to close a FD on an error condition, found by
cppcheck, PR6617.  Patch by Ettl Martin!

llvm-svn: 98525
2010-03-14 23:16:45 +00:00
Kovarththanan Rajaratnam 61bea8fe0b Remove superfluous NULL assignment
llvm-svn: 98350
2010-03-12 14:17:24 +00:00
Ted Kremenek a3b221f9a9 Update CMake build.
llvm-svn: 98250
2010-03-11 07:51:23 +00:00
Jeffrey Yasskin 0069d72c05 Make clang bootstrap happier on OSX 10.5 by reducing the number of headers
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().

llvm-svn: 98243
2010-03-11 06:14:32 +00:00
Chris Lattner 3b38fd6488 follow-on to PR6280
llvm-svn: 96172
2010-02-14 18:20:09 +00:00
Chris Lattner 62f50dad8d improve support for minix, PR6280, patch by
Kees van Reeuwijk!

llvm-svn: 95946
2010-02-12 00:37:46 +00:00
Douglas Gregor 1051937c21 Add llvm::Program::ChangeStderrToBinary().
llvm-svn: 94743
2010-01-28 06:42:08 +00:00
Chris Lattner dec86d7337 mark some libraries that currently require RTTI.
llvm-svn: 94377
2010-01-24 20:22:08 +00:00
Torok Edwin fbcd2c76d5 Fix TimeValue::now() on Unix.
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.

llvm-svn: 94178
2010-01-22 15:51:31 +00:00
Xerxes Ranby 17dc3a0a94 Stubs for getHostCPUFeatures API. This implements part of PR5389.
llvm-svn: 93913
2010-01-19 21:26:05 +00:00
Anton Korobeynikov 105682dc96 Remove spurious semicolon.
Patch by Diego Iastrubni!

llvm-svn: 93450
2010-01-14 20:19:51 +00:00
Douglas Gregor f94e00d869 Alternative fix to make sure that the extern declarations used by
DynamicLibrary::SearchForAddressOfSymbol refer to declarations in the
global namespace.

llvm-svn: 92023
2009-12-23 19:12:50 +00:00
Douglas Gregor 051b92c3cd Revert 92020 until I figure out a more portable fix
llvm-svn: 92021
2009-12-23 19:04:10 +00:00
Douglas Gregor 93254e1ffb Move the extern symbol declarations outside of
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.

llvm-svn: 92020
2009-12-23 18:56:27 +00:00
Nuno Lopes 129819de71 move a few more symbols to .rodata
llvm-svn: 92011
2009-12-23 17:48:10 +00:00
Daniel Dunbar cf7744e44d Fix Win32 Path.inc for API update.
llvm-svn: 91706
2009-12-18 19:59:48 +00:00
Jeffrey Yasskin 5908f1e27b Make Path use StringRef instead of std::string where possible.
llvm-svn: 91620
2009-12-17 21:02:39 +00:00
Chris Lattner a6fc9de9fc remove use of SmallVector from Path::makeUnique. Path::makeUnique
is not used by anything performance sensitive, so just use std::string.

llvm-svn: 91528
2009-12-16 08:40:44 +00:00
Chris Lattner e6be85661d eliminate an extraneous use of SmallVector in a case where
a fixed size buffer is perfectly fine.

llvm-svn: 91527
2009-12-16 08:35:54 +00:00
Torok Edwin 022336adf7 Add "generic" fallback.
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.).

llvm-svn: 91276
2009-12-14 12:38:18 +00:00
Torok Edwin abdc1c274b Using _MSC_VER there was wrong, better just use the already existing ifdefs for
x86 CPU detection for the X86 getHostCPUName too, and create a simple
getHostCPUName that returns "generic" for all else.

llvm-svn: 91240
2009-12-13 08:59:40 +00:00
Torok Edwin 5c9429fa47 Enable CPU detection when using MS VS 2k8 too.
MSVS2k8 doesn't define __i386__, hence all the CPU detection code was disabled.
Enable it by looking for _MSC_VER.

llvm-svn: 91217
2009-12-12 12:42:31 +00:00
Daniel Dunbar 5ea6200d06 Remove spurious extern.
llvm-svn: 90937
2009-12-09 03:26:33 +00:00
Oscar Fuentes 8b6d88d2f8 Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).

Patch by Michael Beck!

llvm-svn: 90748
2009-12-07 05:29:59 +00:00