David Greene
cdde1bb0a6
Add an ExecuteNoWait interface to support asynchronous process spawning.
...
llvm-svn: 75055
2009-07-08 21:46:40 +00:00
Chris Lattner
d41531a2c0
remove two methods that no longer exist.
...
llvm-svn: 74982
2009-07-08 01:07:39 +00:00
Chris Lattner
e4807c5767
more getting windows to build.
...
llvm-svn: 74981
2009-07-08 00:52:12 +00:00
Chris Lattner
e3241b5719
hopefully fix the build on windows.
...
llvm-svn: 74977
2009-07-08 00:29:32 +00:00
Chris Lattner
3612256e2e
Eliminate the static constructors and locks from DynamicLibrary.cpp.
...
This fixes PR4512 and eliminating static ctors is always good. Losing
thread safety is unfortunate, but the code is just incredibly poorly
designed.
If someone is interested, the "right" solution is to split
DynamicLibrary.cpp into two separate pieces: a stateless piece in
libsystem, and a simple support file in libsupport that has the
"state" (e.g. AddSymbol) in managed static objects.
Doing this would both fix memory leaks we already have, as well as make
the code thread safe again. it would also make sense to move all the
unix specific code in System/DynamicLibrary.cpp into
System/Unix/DynamicLibrary.inc.
llvm-svn: 74927
2009-07-07 18:17:07 +00:00
Chris Lattner
5ceb2cb005
remove dead code, noone creates instances of "DynamicLibrary", so the ctor and dtor are dead.
...
llvm-svn: 74926
2009-07-07 18:01:58 +00:00
Chris Lattner
4efb280fb0
we don't use libtool anymore, update comments.
...
llvm-svn: 74924
2009-07-07 17:50:11 +00:00
Owen Anderson
2370b4d81f
No need to double-include config.h
...
llvm-svn: 74854
2009-07-06 21:24:37 +00:00
Owen Anderson
1d182d08ba
We need to include config.h to get the proper setting to LLVM_MULTITHREADED.
...
Patch by Xerxes Ranby.
llvm-svn: 74846
2009-07-06 18:50:47 +00:00
Chris Lattner
738cc28f4d
improve portability to windows, patch by Xerces Ranby!
...
llvm-svn: 74835
2009-07-06 17:24:48 +00:00
Jeffrey Yasskin
5a2e52182a
Oops, I #included errno.h from inside the llvm::sys namespace.
...
llvm-svn: 74834
2009-07-06 16:50:27 +00:00
Duncan Sands
f9cf4ffcc7
Fix windows build, patch by Howard Su.
...
llvm-svn: 74697
2009-07-02 12:09:50 +00:00
Jeffrey Yasskin
1a93330ffa
Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
...
Windows variant, strerror_s, but I couldn't test that.
I'll update configure and config.h.in in a subsequent patch.
llvm-svn: 74621
2009-07-01 18:11:20 +00:00
Owen Anderson
02c4de3573
Try again at making this work on OpenBSD.
...
llvm-svn: 74612
2009-07-01 16:19:23 +00:00
Owen Anderson
cb86e113a9
Fix the build on OpenBSD.
...
llvm-svn: 74597
2009-07-01 06:53:29 +00:00
Oscar Fuentes
136f9a6512
Fixed assert that checks return value of TlsSetValue.
...
See http://msdn.microsoft.com/en-us/library/ms686818(VS.85).aspx
Patch by Olaf Krzikalla!
llvm-svn: 74526
2009-06-30 14:12:28 +00:00
Owen Anderson
331c8ab96f
Fix compilation without pthreads.
...
Patch by Xerxes Ranby.
llvm-svn: 74283
2009-06-26 08:48:03 +00:00
Daniel Dunbar
aa311ca000
Fix unused variable warnings.
...
llvm-svn: 74250
2009-06-26 01:34:35 +00:00
Owen Anderson
276fc52b72
Fix error in the Win32 implementation pointed out by Howard Su.
...
llvm-svn: 74248
2009-06-26 00:51:20 +00:00
Owen Anderson
eba6e65291
Add support for const thread locals.
...
llvm-svn: 74226
2009-06-25 23:31:18 +00:00
Owen Anderson
eb51111851
Fix typo in assertion.
...
llvm-svn: 74225
2009-06-25 23:28:28 +00:00
Owen Anderson
1154983b9c
Add a configure test for pthread_getspecific, and use it when building ThreadLocal.
...
llvm-svn: 74222
2009-06-25 23:10:26 +00:00
Owen Anderson
bc17dc6ed4
Update cmake build files.
...
llvm-svn: 74210
2009-06-25 21:58:34 +00:00
Owen Anderson
f17f6f06fa
Add a class for supporting platform independent thread-local storage.
...
Windows people, please double-check/patch this.
llvm-svn: 74209
2009-06-25 21:58:01 +00:00
Owen Anderson
021c3b0756
Guard dynamic library loading.
...
I did my best at implementing this for Win32, but I don't have a way to test it.
Can someone with access to a Win32 machine test/fix this?
llvm-svn: 74188
2009-06-25 18:12:44 +00:00
Owen Anderson
1fdf01026b
Add atomic multiply and divide operations, built on top of CompareAndSwap.
...
llvm-svn: 74004
2009-06-23 21:19:04 +00:00
Owen Anderson
5cc4131063
Revert my last series of commits related to Timer and 64-bit atomics. Not all the targets
...
we care about are capable of supporting it.
llvm-svn: 73993
2009-06-23 20:17:22 +00:00
Owen Anderson
9262d43c5d
Atomic ops that do arithmetic use signed arithmetic.
...
llvm-svn: 73980
2009-06-23 18:30:27 +00:00
Owen Anderson
9e3df5b67f
Label the existing atomic functions as 32-bit specific, and add a 64-bit one that will be useful in
...
the near future.
llvm-svn: 73971
2009-06-23 18:01:04 +00:00
Owen Anderson
cdf2b2dfea
Add an atomic add operation.
...
llvm-svn: 73964
2009-06-23 17:39:31 +00:00
Owen Anderson
96c51a8de1
Workaround for an... interesting bug in Darwin's pthread_rwlock_init.
...
llvm-svn: 73806
2009-06-20 00:32:27 +00:00
Owen Anderson
ff5f14c15e
Fix bad paste-o in the MSVC atomics.
...
Patch by Ðван СоÑокин.
llvm-svn: 73779
2009-06-19 18:37:50 +00:00
Owen Anderson
1498a7a510
Give RWMutex the SmartRWMutex treatment too.
...
llvm-svn: 73710
2009-06-18 18:26:15 +00:00
Owen Anderson
68f6598c69
Insert a SmartMutex templated class into the class hierarchy, which takes a 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
2009-06-18 17:53:17 +00:00
Ted Kremenek
81ef65d491
Update CMake files to account for new location of Threading.cpp.
...
llvm-svn: 73708
2009-06-18 17:47:09 +00:00
Owen Anderson
7d42b95b6c
Move Threading.[h|cpp] from Support to System.
...
llvm-svn: 73707
2009-06-18 16:54:52 +00:00
Owen Anderson
6eb4a73633
Fix build when disable thread support.
...
Patch by Howard Su.
llvm-svn: 73680
2009-06-18 04:44:46 +00:00
Douglas Gregor
2761988cfd
Add RWMutex.cpp to the CMake makefiles
...
llvm-svn: 73615
2009-06-17 17:01:30 +00:00
Owen Anderson
74af4ee79d
Improve the Win32 reader-writer lock implementation by making it just a normal
...
lock. This is obviously bad, but at least it's threadsafe! If you know how
to improve this in a pre-Vista friendly well, patches welcome!
Patch by Max Burke.
llvm-svn: 73607
2009-06-17 09:10:42 +00:00
Owen Anderson
82b58a843b
Use atomic increment/decrement for reference counting of Type's.
...
llvm-svn: 73588
2009-06-17 00:28:49 +00:00
Owen Anderson
8d0fe6f0d7
Add an atomic increment and decrement implementation, which will be used for
...
thread-safe reference counting.
llvm-svn: 73587
2009-06-17 00:13:00 +00:00
Owen Anderson
79b76b5bea
Accidentally broke this file.
...
llvm-svn: 73552
2009-06-16 20:57:51 +00:00
Owen Anderson
896cee711f
Remove the Win32 implementation, since it doesn't compile pre-Vista.
...
llvm-svn: 73550
2009-06-16 20:49:20 +00:00
Owen Anderson
372a9289a5
Fix/cleanup trailing newlines.
...
llvm-svn: 73546
2009-06-16 20:23:05 +00:00
Owen Anderson
324f94c317
Add a portable wrapper for reader-writer locks.
...
llvm-svn: 73545
2009-06-16 20:19:28 +00:00
Dan Gohman
970da81e8a
glibc has two versions of strerror_r, a standards compliant one and a GNU
...
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
2009-06-15 18:05:46 +00:00
Chris Lattner
7038cd5247
"This patch implements the method with the GetModuleFileName function for windows."
...
Patch by Benjamin Kramer!
llvm-svn: 73379
2009-06-15 05:38:04 +00:00
Chris Lattner
3f556daa6e
add a new static method to portably determine whether a patch is
...
absolute or not, based on a patch by Gregory Curfman!
llvm-svn: 73368
2009-06-15 04:17:07 +00:00
Torok Edwin
63e44bb2a9
Fix comments.
...
llvm-svn: 72858
2009-06-04 08:18:25 +00:00
Torok Edwin
9b5a47fc3c
Add support for outputting ANSI colors to raw_fd_ostream.
...
llvm-svn: 72854
2009-06-04 07:09:50 +00:00