Commit Graph

242 Commits

Author SHA1 Message Date
Reid Spencer
0a262ba7c3 For PR616:
These patches make threading optional in LLVM. The configuration scripts are now
modified to accept a --disable-threads switch. If this is used, the Mutex class
will be implemented with all functions as no-op. Furthermore, linking against
libpthread will not be done. Finally, the ParallelJIT example needs libpthread
so its makefile was changed to always add -lpthread to the link line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23003 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-24 10:07:20 +00:00
Misha Brukman
15d89cba85 Fix grammar: it's == "it is".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22587 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 16:04:59 +00:00
Jeff Cohen
64fe58490d It's dangerous coding on Mondays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 03:26:32 +00:00
Jeff Cohen
ee841a1a87 Implement SetInterruptFunction for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 03:04:47 +00:00
Chris Lattner
fa8c292ebd Implement sys::SetInterruptFunction on Unix, stub it on win32 so that the
build will not fail


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22578 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 02:14:22 +00:00
Andrew Lenharth
a00269bc3e support near allocations for the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22554 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-29 23:40:16 +00:00
Reid Spencer
3be872ed59 Fix a problem in getDirectoryContents where sub-directory names were
appended to a path string that didn't end in a slash, yielding invalid
path names.

Path contribute by Nicholas Riley.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22539 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 16:25:57 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Jeff Cohen
9eb59ec548 Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:53:44 +00:00
Reid Spencer
2499841461 Don't call pthread_mutexattr_setpshared on FreeBSD because its implementation
of pthreads is missing that call (despite it violating the spec).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22423 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-13 03:02:06 +00:00
Jeff Cohen
2497251e6d Note to self: don't introduce memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-13 02:58:04 +00:00
Jeff Cohen
6d2352249a Win32 support for Mutex class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-13 02:15:18 +00:00
Reid Spencer
b2164e5cb5 For PR540:
Add a Mutex class for thread synchronization in a platform-independent way.
The current implementation only supports pthreads. Win32 use of Critical
Sections will be added later. The design permits other threading models to
be used if (and only if) pthreads is not available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22403 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 15:37:43 +00:00
Jeff Cohen
966fa415d2 Fix bugs also fixed in Unix version, plus other general cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22363 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-09 18:42:49 +00:00
Jeff Cohen
73f36671b2 1. Fix bug in getBaseName where it mishandles suffixes
2. Fix bug in eraseSuffix where it allows /path/.suffix to become /path/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22362 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-09 18:42:02 +00:00
Reid Spencer
8b2d1aa37b Ensure that functions like isDirectory don't fail if the file doesn't
exist but just return false instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22361 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 17:46:10 +00:00
Reid Spencer
6371ccbd8d Two changes:
1. Use isValid() to check validity of the resulting path name in the
   eraseSuffix even though we can't think of a case where eraseSuffix could
   possibly cause an invalid path name.
2. Rewrite isValid() to not use the deprecated realpath function any more.
   It now just uses isascii to make sure all the characters are legit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22359 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 06:53:26 +00:00
Jeff Cohen
85c716f83d Stamp out tabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22357 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 05:02:13 +00:00
Jeff Cohen
8f0e8f2047 Make Win32 implementation conform to new paradigm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22356 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 04:50:08 +00:00
Jeff Cohen
563a17fb35 Fix eraseSuffix()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22355 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 04:49:16 +00:00
Reid Spencer
a229c5cce7 Final Changes For PR495:
This chagne just renames some sys::Path methods to ensure they are not
misused. The Path documentation now divides methods into two dimensions:
Path/Disk and accessor/mutator. Path accessors and mutators only operate
on the Path object itself without making any disk accesses. Disk accessors
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:

makeReadable        -> makeReadableOnDisk
makeWriteable       -> makeWriteableOnDisk
makeExecutable      -> makeExecutableOnDisk
setStatusInfo       -> setStatusInfoOnDisk
createDirectory     -> createDirectoryOnDisk
createFile          -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy             -> eraseFromDisk
rename              -> renamePathOnDisk

These changes pass the Linux Deja Gnu tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 03:08:58 +00:00
Jeff Cohen
edb9d6bc72 Fix VC++ breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22353 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-08 02:48:42 +00:00
Reid Spencer
1cf2d04351 Changes to mimic those in Unix/Path.inc in support of PR495. This hasn't
been compiled or tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22350 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 23:35:23 +00:00
Reid Spencer
dd04df0ec3 For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:

appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set

Changes pass Dejagnu and llvm-test/SingleSource tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 23:21:43 +00:00
Reid Spencer
c7f083297c For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 18:21:42 +00:00
Reid Spencer
932e2e33eb Put in a hack for Cygwin that prevents mkdtemp from being used since
configure seems to find it on Cygwin but linking against it fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22189 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-02 05:38:20 +00:00
Duraid Madina
26b1d42c84 comment the hpux bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22081 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-16 06:59:53 +00:00
Misha Brukman
6b8a63ae58 Remove vim settings from source code; people should use llvm/utils/vim/vimrc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-05 22:33:09 +00:00
Alkis Evlogimenos
38da41cc44 Silence gcc-4.0.0 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21453 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 17:56:01 +00:00
Misha Brukman
f976c856fc Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:55:34 +00:00
Reid Spencer
93b3473478 Provide an implementation of the GetCurrentUserId and GetCurrentGroupId
methods that were recently added to the interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21401 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 16:12:57 +00:00
Reid Spencer
2aafadcc76 For Bug 543:
Standardize the error messages to be in "path: what failed: why" format.
Also attempt to use the correct errno to ThrowErrno in situations where
the errno value is erased by subsequent system calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21385 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 02:50:10 +00:00
Reid Spencer
03aee2e3f2 For Bug 543:
Allow the ThrowErrno function to optionally accept an error number
parameter so that callers can specify the error number to be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21384 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 02:30:32 +00:00
Misha Brukman
22c46da12b Add FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH may
result in returning executable files that won't be runnable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21378 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-20 15:42:11 +00:00
Misha Brukman
8177bf8904 Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21377 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-20 15:33:22 +00:00
Misha Brukman
4619c75f64 Ignore dangling symlinks in getDirectoryContents()
Thanks to Markus Oberhumer for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21370 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-20 04:04:07 +00:00
Jeff Cohen
01c5513683 Eliminate tabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21216 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-11 03:44:22 +00:00
Reid Spencer
1af69a8131 Be slightly more accurate in an error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20397 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 05:45:56 +00:00
Jeff Cohen
45a1b26caa Fix silly mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20256 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-20 02:48:51 +00:00
Jeff Cohen
875d08e36b Implement standard I/O redirection in ExecuteAndWait().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20255 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-20 02:43:04 +00:00
Jeff Cohen
23a1cf3e08 Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20243 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-19 03:01:13 +00:00
Jeff Cohen
d79bcfddbc Make PreventCoreFiles() do the right thing on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20237 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-18 07:05:18 +00:00
Jeff Cohen
e5f7e65f95 Arg list already has program name in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20208 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-16 04:43:45 +00:00
Chris Lattner
0798056b28 Fix a bug in my previous change to this, which broke the build on sparcs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20184 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 21:42:10 +00:00
Chris Lattner
550c57cb30 Fix the llvm bootstrap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20170 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 23:37:09 +00:00
Chris Lattner
946af52687 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20165 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 22:46:37 +00:00
Jeff Cohen
9437bb6d27 Fix some Path bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19852 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 03:49:03 +00:00
Jeff Cohen
c690cc0465 Fix destroyDirectory bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19746 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 16:28:33 +00:00
Chris Lattner
8102fcde4c Fix bugpoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19605 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 04:23:22 +00:00
Reid Spencer
e1c6bfa385 We don't distribute the operating system specific directories any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19563 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14 22:43:01 +00:00