Commit Graph

250 Commits

Author SHA1 Message Date
Jeff Cohen
85046901b8 Add AddSymbol() method to DynamicLibrary to work around Windows limitation
of being unable to search for symbols in an EXE.  It will also allow other
existing hacks to be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25805 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-30 04:33:51 +00:00
Jeff Cohen
715bd76487 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25795 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-29 22:02:52 +00:00
Reid Spencer
d555f413cd For PR351:
* Allow the ExecuteAndWait to return negative values if a signal is
  detected as the reason for the child termination. This is needed to
  support bugpoint detecting bad things in its child processes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24960 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 20:00:16 +00:00
Reid Spencer
b13cf98e6b Implement a generic polled Alarm function. This merely removes the system
dependent portion of the lib/Support/SlowOperationTimer code into the
lib/System implementation where it can be ported to different platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24937 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 03:23:46 +00:00
Chris Lattner
c590e9afc9 instead of using mstats, use malloc_zone_statistics which returns numbers
that actually make sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24352 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:27:56 +00:00
Chris Lattner
513a9547f5 Teach -track-memory to work on darwin. Looking at sbrk doesn't work because
the default allocator uses mmap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:00:29 +00:00
Chris Lattner
f36aeedaa3 DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:26:13 +00:00
Chris Lattner
e3242e2392 Only build .a file versions of these libraries, instead of .a and .o versions.
This should speed up build times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23937 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 02:11:51 +00:00
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