1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

288 Commits

Author SHA1 Message Date
Chris Lattner
2ba2324c96 Implement sys::SetInterruptFunction on Unix, stub it on win32 so that the
build will not fail

llvm-svn: 22578
2005-08-02 02:14:22 +00:00
Andrew Lenharth
d8bfbd99e9 support near allocations for the JIT
llvm-svn: 22554
2005-07-29 23:40:16 +00:00
Reid Spencer
69d45ce28e 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.

llvm-svn: 22539
2005-07-28 16:25:57 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Jeff Cohen
81980781a1 Eliminate tabs and trailing spaces.
llvm-svn: 22520
2005-07-27 05:53:44 +00:00
Reid Spencer
ed5ee0f4e8 Don't call pthread_mutexattr_setpshared on FreeBSD because its implementation
of pthreads is missing that call (despite it violating the spec).

llvm-svn: 22423
2005-07-13 03:02:06 +00:00
Jeff Cohen
f008a9d1a7 Note to self: don't introduce memory leaks.
llvm-svn: 22422
2005-07-13 02:58:04 +00:00
Jeff Cohen
0882aa2a75 Win32 support for Mutex class.
llvm-svn: 22420
2005-07-13 02:15:18 +00:00
Reid Spencer
5f037ea395 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.

llvm-svn: 22403
2005-07-12 15:37:43 +00:00
Jeff Cohen
d1901833d9 Fix bugs also fixed in Unix version, plus other general cleanup.
llvm-svn: 22363
2005-07-09 18:42:49 +00:00
Jeff Cohen
32d77a9154 1. Fix bug in getBaseName where it mishandles suffixes
2. Fix bug in eraseSuffix where it allows /path/.suffix to become /path/

llvm-svn: 22362
2005-07-09 18:42:02 +00:00
Reid Spencer
0db6c1f252 Ensure that functions like isDirectory don't fail if the file doesn't
exist but just return false instead.

llvm-svn: 22361
2005-07-08 17:46:10 +00:00
Reid Spencer
6bed5ca433 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.

llvm-svn: 22359
2005-07-08 06:53:26 +00:00
Jeff Cohen
00f7df2ba0 Stamp out tabs
llvm-svn: 22357
2005-07-08 05:02:13 +00:00
Jeff Cohen
2a6a854faf Make Win32 implementation conform to new paradigm
llvm-svn: 22356
2005-07-08 04:50:08 +00:00
Jeff Cohen
fff16d6986 Fix eraseSuffix()
llvm-svn: 22355
2005-07-08 04:49:16 +00:00
Reid Spencer
04d734c2f6 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.

llvm-svn: 22354
2005-07-08 03:08:58 +00:00
Jeff Cohen
abf7ec1fcc Fix VC++ breakage
llvm-svn: 22353
2005-07-08 02:48:42 +00:00
Reid Spencer
a23bbd3854 Changes to mimic those in Unix/Path.inc in support of PR495. This hasn't
been compiled or tested.

llvm-svn: 22350
2005-07-07 23:35:23 +00:00
Reid Spencer
5534b2d505 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.

llvm-svn: 22349
2005-07-07 23:21:43 +00:00
Reid Spencer
fb7bca6fa6 For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.

llvm-svn: 22345
2005-07-07 18:21:42 +00:00
Reid Spencer
2d5d7084ba 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.

llvm-svn: 22189
2005-06-02 05:38:20 +00:00
Duraid Madina
0cc90e2e4a comment the hpux bit
llvm-svn: 22081
2005-05-16 06:59:53 +00:00
Misha Brukman
f52511fcc6 Remove vim settings from source code; people should use llvm/utils/vim/vimrc
llvm-svn: 21704
2005-05-05 22:33:09 +00:00
Alkis Evlogimenos
9594d0b861 Silence gcc-4.0.0 warnings.
llvm-svn: 21453
2005-04-22 17:56:01 +00:00
Misha Brukman
933cdaf254 Remove trailing whitespace
llvm-svn: 21422
2005-04-21 22:55:34 +00:00
Reid Spencer
044ec874d5 Provide an implementation of the GetCurrentUserId and GetCurrentGroupId
methods that were recently added to the interface.

llvm-svn: 21401
2005-04-21 16:12:57 +00:00
Reid Spencer
4478133ab0 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.

llvm-svn: 21385
2005-04-21 02:50:10 +00:00
Reid Spencer
c3b52b74cd 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.

llvm-svn: 21384
2005-04-21 02:30:32 +00:00
Misha Brukman
7f08d0bc03 Add FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH may
result in returning executable files that won't be runnable.

llvm-svn: 21378
2005-04-20 15:42:11 +00:00
Misha Brukman
11854af05f Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer.

llvm-svn: 21377
2005-04-20 15:33:22 +00:00
Misha Brukman
4113ed635d Ignore dangling symlinks in getDirectoryContents()
Thanks to Markus Oberhumer for the patch!

llvm-svn: 21370
2005-04-20 04:04:07 +00:00
Jeff Cohen
1b89da675f Eliminate tabs
llvm-svn: 21216
2005-04-11 03:44:22 +00:00
Reid Spencer
a5fbf1d659 Be slightly more accurate in an error message.
llvm-svn: 20397
2005-03-02 05:45:56 +00:00
Jeff Cohen
91e04e17a7 Fix silly mistake.
llvm-svn: 20256
2005-02-20 02:48:51 +00:00
Jeff Cohen
96558e2f93 Implement standard I/O redirection in ExecuteAndWait().
llvm-svn: 20255
2005-02-20 02:43:04 +00:00
Jeff Cohen
b83e650f1f Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
llvm-svn: 20243
2005-02-19 03:01:13 +00:00
Jeff Cohen
fa31c775b6 Make PreventCoreFiles() do the right thing on Windows.
llvm-svn: 20237
2005-02-18 07:05:18 +00:00
Jeff Cohen
72f7799517 Arg list already has program name in it.
llvm-svn: 20208
2005-02-16 04:43:45 +00:00
Chris Lattner
51c55602c9 Fix a bug in my previous change to this, which broke the build on sparcs.
llvm-svn: 20184
2005-02-14 21:42:10 +00:00
Chris Lattner
efacfe896c Fix the llvm bootstrap
llvm-svn: 20170
2005-02-13 23:37:09 +00:00
Chris Lattner
535796ff26 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.

llvm-svn: 20165
2005-02-13 22:46:37 +00:00
Jeff Cohen
1502dd24d9 Fix some Path bugs
llvm-svn: 19852
2005-01-27 03:49:03 +00:00
Jeff Cohen
66b5805c50 Fix destroyDirectory bug
llvm-svn: 19746
2005-01-22 16:28:33 +00:00
Chris Lattner
e88e660817 Fix bugpoint
llvm-svn: 19605
2005-01-16 04:23:22 +00:00
Reid Spencer
ad96095c97 We don't distribute the operating system specific directories any more.
llvm-svn: 19563
2005-01-14 22:43:01 +00:00
Jeff Cohen
7dfbb46f7f Fix and improve win32 path validation.
llvm-svn: 19545
2005-01-14 04:09:39 +00:00
Reid Spencer
4e90250e81 Make asctime_r work for HP/UX.
llvm-svn: 19544
2005-01-14 00:50:50 +00:00
Reid Spencer
283688b80d Rename Unix/*.cpp and Win32/*.cpp to have a *.inc suffix so that the silly
gdb debugger doesn't get confused on which file it is reading (the one in
lib/System or the one in lib/System/{Win32,Unix})

llvm-svn: 19426
2005-01-09 23:29:00 +00:00
Jeff Cohen
aef3f70921 Use size_t instead of long to represent memory usage. long is 32 bits
on 64-bit Windows.

llvm-svn: 19393
2005-01-08 20:15:57 +00:00
Reid Spencer
110e76fd79 Correct the case of a #include directory name, just in case.
llvm-svn: 19254
2005-01-02 09:45:04 +00:00
Jeff Cohen
7466dd37d0 Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19236
2005-01-01 22:54:05 +00:00
Reid Spencer
ed2f874a8d Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19233
2005-01-01 22:29:26 +00:00
Jeff Cohen
a46121ed32 Where do these tabs keep coming from???
llvm-svn: 19203
2004-12-31 19:03:31 +00:00
Jeff Cohen
9b439381c3 Mostly cleanup, but also some bug fixes, for win32/Path.cpp
llvm-svn: 19202
2004-12-31 19:01:08 +00:00
Reid Spencer
7b4b2407c1 Fix a compilation error for the case where mallinfo() is not available.
llvm-svn: 19201
2004-12-31 05:53:27 +00:00
Jeff Cohen
01422b3799 Get rid of those nasty tabs...
llvm-svn: 19199
2004-12-31 05:07:26 +00:00
Jeff Cohen
82a2c68071 Bring win32/Path.cpp up to date with respect to Unix/Path.cpp
llvm-svn: 19198
2004-12-31 04:39:07 +00:00
Jeff Cohen
89e7c7553c Fix MINGW compilation errors
llvm-svn: 19190
2004-12-30 03:02:31 +00:00
Reid Spencer
1c90f8199e For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Account for variations in time.h and sys/time.h inclusion.
* Add macros for getting wait(2) exit status correctly (per autoconf sugg.)
* Implement ThrowErrno in terms of strerror_r, strerror or none based on
  what is available on the platform.

llvm-svn: 19161
2004-12-27 06:17:50 +00:00
Reid Spencer
73adbe7c2d For PR351:
* Remove redundant #includes that are now in Unix.h

llvm-svn: 19160
2004-12-27 06:17:39 +00:00
Reid Spencer
b454405d4a For PR351:
* Move implementation of sys::PreventCoreFiles function to this file from
  the now defunct SysConfig abstraction.

llvm-svn: 19159
2004-12-27 06:17:27 +00:00
Reid Spencer
4d34db1fe6 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Ensure variations in "dirent" structure are accounted for.

llvm-svn: 19158
2004-12-27 06:17:15 +00:00
Reid Spencer
537353c09e For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Consolidate implementation from operating system specific directory.

llvm-svn: 19157
2004-12-27 06:17:03 +00:00
Reid Spencer
7f7fd13285 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards

llvm-svn: 19156
2004-12-27 06:16:52 +00:00
Reid Spencer
3d53c8b8aa For PR351:
* Consolidate implementation for Unix systems into Unix/TimeValue.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19155
2004-12-27 06:16:38 +00:00
Reid Spencer
adaad82e3a For PR351:
* Consolidate implementation for Unix systems into Unix/Program.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19154
2004-12-27 06:16:25 +00:00
Reid Spencer
62ed25388e For PR351:
* Consolidate implementation for Unix systems into Unix/Signals.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19153
2004-12-27 06:16:11 +00:00
Reid Spencer
38ecc1456a For PR351:
* Consolidate implementation for Unix systems into Unix/Memory.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19152
2004-12-27 06:15:57 +00:00
Reid Spencer
75d13b2e49 For PR351:
* Consolidate implementation for Unix systems into Unix/MappedFile.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19151
2004-12-27 06:15:43 +00:00
Reid Spencer
ae90b4a287 For PR351:
* Consolidate implementation for Unix systems into Unix/Process.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19150
2004-12-27 06:15:29 +00:00
Reid Spencer
7da5e588d4 For PR351:
SysConf abstraction was pointless because it had a single function in it that
pertained only to the current process. So merge it into the Process abstraction
and remove the files completely.

llvm-svn: 19149
2004-12-27 06:15:14 +00:00
Jeff Cohen
1f2d9696bf mingw doesn't support the official debug API.
Old versions of the C runtime somehow get loaded into the process.  Make
sure they aren't searched for symbols.

llvm-svn: 19141
2004-12-25 04:50:17 +00:00
Jeff Cohen
724ac32c61 Get VC++ building again
llvm-svn: 19140
2004-12-24 16:26:47 +00:00
Jeff Cohen
f3543c32a5 Eliminate use of ltdl.c when doing a VC++ build. Because libtool isn't used,
ltdl's LGPL license would infect all of LLVM.

llvm-svn: 19137
2004-12-24 07:57:09 +00:00
Reid Spencer
870c0e8f4f For PR351:
Merge implementations of isValid and GetTemporaryDirectory into this file. There
is not any point having the operating system specific files for such little
variation between the Unix family of systems.

llvm-svn: 19134
2004-12-24 06:29:42 +00:00
Reid Spencer
d1a0baa811 For PR351:
This implementation is no longer needed, its been merged to Unix/Path.cpp since
there is such little variation between the platforms.

llvm-svn: 19133
2004-12-24 06:29:28 +00:00
Reid Spencer
9cf9b6fe85 For PR351:
Use the LLVM_ON_UNIX and LLVM_ON_WIN32 #defines to include the implementation
instead of relying upon the "platform" link

llvm-svn: 19132
2004-12-24 06:29:17 +00:00
Reid Spencer
b1eb2641f3 Resurrect this file.
llvm-svn: 19130
2004-12-24 06:03:31 +00:00
Reid Spencer
c2e45f4610 Remove these files as they are not being included any more. DynamicLibrary
is now implemented via ltdl.cpp which has its own way of dealing with
the different platforms.

llvm-svn: 19129
2004-12-24 03:59:46 +00:00
Jeff Cohen
916051a9fd Fix VC++ compilation error
llvm-svn: 19124
2004-12-24 02:38:34 +00:00
Reid Spencer
5885a388b8 Put CopyFile in the sys namespace.
llvm-svn: 19122
2004-12-23 22:14:32 +00:00
Jeff Cohen
9ffd97b636 Patch to fix mingw compilation problem contributed by Henrik.
llvm-svn: 19112
2004-12-23 03:44:40 +00:00
Reid Spencer
17e4392807 Put the CopyFile function explicitly in the sys namespace.
llvm-svn: 19079
2004-12-21 03:27:08 +00:00
Reid Spencer
6324bbcd91 Cygwin doesn't like .. through a link, so drop the ..
llvm-svn: 19076
2004-12-20 22:21:41 +00:00
Reid Spencer
76147edb0c Implement GetTimeUsage correctly.
llvm-svn: 19074
2004-12-20 21:43:33 +00:00
Reid Spencer
b9376dde14 Provide a getrusage based implementation of GetTotalMemoryUsage and use
the ru_maxrss field as an approximation.

llvm-svn: 19072
2004-12-20 16:33:37 +00:00
Reid Spencer
c34325ae5f Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
llvm-svn: 19071
2004-12-20 16:06:44 +00:00
Jeff Cohen
a61823c49e Keep up with lib/System changes
llvm-svn: 19057
2004-12-20 03:24:56 +00:00
Reid Spencer
3f8be49b9e For PR351:
* Implement GetMallocUsage to get usage of malloc heap
* Implement GetMemoryUsage to get total memory usage of process
* Implement GetTimeUsage to get elapsed/user/system time

llvm-svn: 19055
2004-12-20 00:59:28 +00:00
Reid Spencer
82588cf403 For PR351:
No need for Unix/SUS/Process.cpp any more, just ifdef it.

llvm-svn: 19054
2004-12-20 00:59:16 +00:00
Misha Brukman
272c37ff7b * Use "" for LLVM include files, not <>
* llvm/Config/alloca.h already #includes config.h
* Minor readability/stylistic changes

llvm-svn: 19048
2004-12-20 00:16:38 +00:00
Misha Brukman
247ee9ee4a Use <> for system #include files
llvm-svn: 19046
2004-12-19 19:27:11 +00:00
Brian Gaeke
63c01d5387 Make references to 'struct sigaction' compile under Solaris.
llvm-svn: 19045
2004-12-19 18:58:11 +00:00
Reid Spencer
e377d1308e For PR351:
Move the functionality of RunProgramWithTimeout into the ExecuteAndWait
function: support a timeout and I/O redirects

llvm-svn: 19043
2004-12-19 18:00:44 +00:00
Reid Spencer
5eba1617bf For PR351:
Add a needed include.

llvm-svn: 19042
2004-12-19 18:00:32 +00:00
Jeff Cohen
f6a4f3f347 Fix win32 breakage
llvm-svn: 19028
2004-12-18 06:42:15 +00:00
Jeff Cohen
21f0b01731 Expository comment submitted by Henrik Bach
llvm-svn: 18976
2004-12-16 04:06:56 +00:00
Reid Spencer
43693c5432 Change the signatures of the destroyFile and destroyDirectory methods to
const because they affect the file system, not the Path object.

llvm-svn: 18973
2004-12-15 23:02:10 +00:00
Reid Spencer
c5c37ed49f Remove the CFE's lib directory from the bytecode path because LLVM should
be agnostic to the needs of any specific FE.

llvm-svn: 18969
2004-12-15 22:22:51 +00:00