Commit Graph

671 Commits

Author SHA1 Message Date
Duncan Sands
3dc7224379 Rather than using an ifdef on the target to zero out fields,
just use memset to zero the entire struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 14:32:33 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Chris Lattner
a6c04ee4c8 Path::isRootDirectory is unimplemented on Unix and not used,
remove it, fixing PR6909.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 04:39:07 +00:00
Chris Lattner
1f01109254 improve Path::makeUnique when mkstemp/mktemp are not available
patch by Lasse Kärkkäinen in PR7404.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 00:09:55 +00:00
Chris Lattner
29269d03af add some triple for minix, patch by Kees van Reeuwijk from PR7582
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:52:27 +00:00
Duncan Sands
fc6afa92d6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 16:23:15 +00:00
Dan Gohman
39f76bb6c8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 23:11:55 +00:00
Dan Gohman
02d5824266 Don't bother clearing the Magic string when the magic number
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
2010-05-27 17:14:10 +00:00
Dan Gohman
130de9c0b4 Don't bother checking canRead() before calling getMagicNumber();
getMagicNumber() does its own error checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 17:12:23 +00:00
Daniel Dunbar
fb89e08413 Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup
stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 02:10:34 +00:00
Dan Gohman
023f8aaa16 This doesn't need SmallVector.h anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 17:51:31 +00:00
Dan Gohman
17192a1dd8 Fix this for std::vectors which don't have .data().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 16:33:28 +00:00
Dan Gohman
985744ecc6 Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 15:55:10 +00:00
Dan Gohman
72bdd4ca07 Revert 91528 and use a std::vector instead, fixing an abuse of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 15:54:44 +00:00
Chris Lattner
d65077a509 avoid temporary std::string in non posix_spawn path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 17:34:10 +00:00
Benjamin Kramer
d7aef9b440 Eliminate temporary string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 09:19:41 +00:00
Benjamin Kramer
bceaffc7cc Properly inherit the environment on darwin where environ is not available for shared libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 09:16:04 +00:00
Nick Lewycky
6523803203 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 07:07:48 +00:00
Nick Lewycky
1a3eb953cc Revert r101701, Darwin doesn't have 'environ'. Go figure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 06:44:21 +00:00
Nick Lewycky
b7dfca9778 Fix linux build. posix_spawn doesn't inherit the environment by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 06:22:26 +00:00
Chris Lattner
4f098b68a5 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 04:14:37 +00:00
Chris Lattner
b221ecbc62 unnest from namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 03:33:55 +00:00
Dan Gohman
b35798347e Fix a bunch of namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 17:08:50 +00:00
Chris Lattner
47e476609b improve haiku portability, patch by Paul Davey.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 17:54:51 +00:00
Chris Lattner
21aa347c28 add minix support, patch by Kees van Reeuwijk! PR6797
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 20:45:04 +00:00
Torok Edwin
61633368cf AddSignalHandler was not releasing the critical section on win32.
Patch from Gianluigi Tiesi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 12:07:16 +00:00
Dan Gohman
4bb31bfaa3 Fix a grammaro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:04:57 +00:00
Anton Korobeynikov
81244298ea 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 15:07:02 +00:00
Chris Lattner
f35d88f439 remove a constructor implementation that isn't declared
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
2010-03-26 22:17:24 +00:00
Jeffrey Yasskin
b7ccf75de5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 07:08:12 +00:00
Jeffrey Yasskin
f28411f732 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 04:57:55 +00:00
Chris Lattner
cdff5f7787 don't forget to close a FD on an error condition, found by
cppcheck, PR6617.  Patch by Ettl Martin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98525 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-14 23:16:45 +00:00
Kovarththanan Rajaratnam
16ceb3aaf7 Remove superfluous NULL assignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 14:17:24 +00:00
Ted Kremenek
41b39e9908 Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 07:51:23 +00:00
Jeffrey Yasskin
6220754525 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 06:14:32 +00:00
Chris Lattner
782ab584e5 follow-on to PR6280
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-14 18:20:09 +00:00
Chris Lattner
6ae7bbb5ea improve support for minix, PR6280, patch by
Kees van Reeuwijk!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 00:37:46 +00:00
Douglas Gregor
21569cddc1 Add llvm::Program::ChangeStderrToBinary().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:42:08 +00:00
Chris Lattner
c0f8a361f5 mark some libraries that currently require RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 20:22:08 +00:00
Torok Edwin
b0a5baefaa 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 15:51:31 +00:00
Xerxes Ranby
1c8183df7f Stubs for getHostCPUFeatures API. This implements part of PR5389.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:26:05 +00:00
Anton Korobeynikov
f4b6d88cda Remove spurious semicolon.
Patch by Diego Iastrubni!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 20:19:51 +00:00
Douglas Gregor
37b7baec0d Alternative fix to make sure that the extern declarations used by
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
2009-12-23 19:12:50 +00:00
Douglas Gregor
0b64472737 Revert 92020 until I figure out a more portable fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 19:04:10 +00:00
Douglas Gregor
0f706ab789 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:56:27 +00:00
Nuno Lopes
ec9d8b0047 move a few more symbols to .rodata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:48:10 +00:00
Daniel Dunbar
1edcafe10f Fix Win32 Path.inc for API update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 19:59:48 +00:00
Jeffrey Yasskin
88cd3582b6 Make Path use StringRef instead of std::string where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:02:39 +00:00
Chris Lattner
dc5138d81f remove use of SmallVector from Path::makeUnique. Path::makeUnique
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
2009-12-16 08:40:44 +00:00
Chris Lattner
e4b0cd2856 eliminate an extraneous use of SmallVector in a case where
a fixed size buffer is perfectly fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:35:54 +00:00