1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

251 Commits

Author SHA1 Message Date
Reid Spencer
353b72a7c0 Make the sys::Path::GetTemporaryDirectory method not throw exceptions and
adjust users of it to compensate.

llvm-svn: 29831
2006-08-22 19:01:30 +00:00
Reid Spencer
4e1170d5d3 Fix some indentation.
llvm-svn: 29825
2006-08-22 17:38:05 +00:00
Reid Spencer
9fbfd7c399 For PR797:
Make MappedFile not throw any exceptions.

llvm-svn: 29816
2006-08-22 16:04:22 +00:00
Reid Spencer
8b5b0a7fb3 For PR797:
Change interface for error recovery without exceptions.

llvm-svn: 29789
2006-08-21 06:00:58 +00:00
Reid Spencer
5ed787710d For PR797:
Make sys::Program::ExecuteAndWait not throw exceptions and update any
affected code. It now return -9999 to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.

llvm-svn: 29785
2006-08-21 02:04:43 +00:00
Chris Lattner
ceecdbc08e Remove some now-dead methods. Use getFileStatus instead.
llvm-svn: 29447
2006-08-01 18:16:02 +00:00
Chris Lattner
504adc58b7 Modify setStatusInfoOnDisk to not throw an exception.
llvm-svn: 29402
2006-07-28 22:36:17 +00:00
Chris Lattner
d7873a0757 Modify Path::eraseFromDisk to not throw an exception.
llvm-svn: 29400
2006-07-28 22:29:50 +00:00
Chris Lattner
f4c7ceebaf Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.

llvm-svn: 29395
2006-07-28 22:03:44 +00:00
Reid Spencer
c2eb650e39 For PR780:
Put the rest of lib/System into LinkAllVMCore.h. This makes all of
lib/System available to programs that #include LinkALlVMCore.h so that
loadable modules linked into those programs can depend on all of lib/System
being available.

llvm-svn: 29288
2006-07-26 16:55:39 +00:00
Reid Spencer
10b9edbb69 For PR780:
1. Move IncludeFile.h to System library
2. Move IncludeFile.cpp to System library
3. #1 and #2 required to prevent cyclic library dependencies for libSystem
4. Convert all existing uses of Support/IncludeFile.h to System/IncludeFile.h
5. Add IncludeFile support to various lib/System classes.
6. Add new lib/System classes to LinkAllVMCore.h
All this in an attempt to pull in lib/System to what's required for VMCore

llvm-svn: 29287
2006-07-26 16:18:00 +00:00
Chris Lattner
14264d4f2e #include <iosfwd> not <ostream>
llvm-svn: 29061
2006-07-07 18:10:59 +00:00
Chris Lattner
8116948fa5 Change AllocateRWX/DeallocateRWX to not throw an exception.
llvm-svn: 29058
2006-07-07 17:32:37 +00:00
Chris Lattner
832e60566f Change LoadLibraryPermanently to not throw an exception.
llvm-svn: 29048
2006-07-07 17:12:36 +00:00
Reid Spencer
aa140d6fef For PR804:
Change the file size field of StatusInfo to be uint64_t instead of size_t
so that we know it is always 64 bits. This prevents some overflow on
systems where size_t is 32 bits when it ought to be 64.

llvm-svn: 28726
2006-06-08 17:00:08 +00:00
Reid Spencer
3c338b3803 For PR787:
Provide new llvm::sys::Program facilities for converting the stdout and
stdin to binary mode. There is no standard way to do this and the available
mechanisms are platform specific. Adjust the bytecode reader and writer to
use these methods when their input is stdin or output is stdout. THis avoids
the problem with \n writing CRLF to a bytecode file on windows.

Patch Contributed by Michael Smith.

llvm-svn: 28722
2006-06-07 23:18:34 +00:00
Reid Spencer
560366562b For PR780:
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.

llvm-svn: 28715
2006-06-07 22:00:26 +00:00
Reid Spencer
fb62eb9b47 For PR780:
This change was suggested by Chris so that we can select an alternate
(or even no-op) implementation of the link assurance. I'm committing this
for your review, Chris. If the names and definitions are okay, I'll adjust
all the .h and .cpp files in a later patch.

llvm-svn: 28712
2006-06-07 20:35:46 +00:00
Reid Spencer
3832b7f9c4 For PR780:
Break the "IncludeFile" mechanism into its own header file and adjust other
files accordingly. Use this facility for the IntrinsicInst problem which
was the subject of PR800.
More to follow on this.

llvm-svn: 28709
2006-06-07 20:00:19 +00:00
Reid Spencer
55df120f95 Fix some doxygen usage in these headers.
llvm-svn: 28394
2006-05-19 19:07:54 +00:00
Chris Lattner
ed45ad33b7 Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!

llvm-svn: 26313
2006-02-22 16:23:43 +00:00
Jeff Cohen
d80b0d7375 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.

llvm-svn: 25805
2006-01-30 04:33:51 +00:00
Reid Spencer
fb5ba86d31 Add some documentation.
llvm-svn: 25150
2006-01-08 22:41:22 +00:00
Reid Spencer
7c8ac1cf8c Fix documentation for the AlarmSetup function.
llvm-svn: 24940
2005-12-22 03:57:15 +00:00
Reid Spencer
94bbff0319 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.

llvm-svn: 24937
2005-12-22 03:23:46 +00:00
Reid Spencer
a1470f81ae 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.

llvm-svn: 23003
2005-08-24 10:07:20 +00:00
Jeff Cohen
82a6b596d0 Implement SetInterruptFunction for Windows.
llvm-svn: 22582
2005-08-02 03:04:47 +00:00
Chris Lattner
4558fc8536 add a new function proto
llvm-svn: 22577
2005-08-02 02:13:42 +00:00
Andrew Lenharth
d8bfbd99e9 support near allocations for the JIT
llvm-svn: 22554
2005-07-29 23:40:16 +00:00
Jeff Cohen
81980781a1 Eliminate tabs and trailing spaces.
llvm-svn: 22520
2005-07-27 05:53:44 +00:00
Jeff Cohen
6e01930e34 Eliminate tabs
llvm-svn: 22421
2005-07-13 02:19:59 +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
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
341ba60e2e fix typo
llvm-svn: 22352
2005-07-08 02:48:04 +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
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
Misha Brukman
8018cc9e05 Remove trailing whitespace
llvm-svn: 21411
2005-04-21 20:48:15 +00:00
Reid Spencer
9990a77646 Add two new methods for getting the User Id and Group Id values for the
current process.

llvm-svn: 21400
2005-04-21 16:12:04 +00:00
Chris Lattner
a7ce993d7f Do not clean up if the MappedFile was never used or if the client already
closed the file.  This unbreaks the build.

llvm-svn: 19871
2005-01-28 16:08:23 +00:00
Reid Spencer
710115945a Fix the documentation for executeAndWait so the argument comments are
actually attributed to the arguments by doxygen.

llvm-svn: 19473
2005-01-11 06:37:27 +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
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
1d174640fe Fix bountiful sources of VC++ 'possible loss of data' warnings
llvm-svn: 19224
2005-01-01 18:58:23 +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
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
Reid Spencer
d244303b05 For PR351:
* Add GetMallocUsage as a wrapper around mallinfo()
* Add GetTotalMemoryUsage to get approximate RSS size
* Add GetTimeUsage to get elapsed/system/user time

llvm-svn: 19051
2004-12-20 00:58:53 +00:00
Reid Spencer
8ef5b3a158 Wrap long lines
llvm-svn: 19050
2004-12-20 00:58:41 +00:00
Reid Spencer
944664fd34 For PR351:
Incorporate the abilities of RunPRogramWithTimeout into
sys::Program::ExecuteAndWait so that redirection and a timeout are optionally
supported.

llvm-svn: 19039
2004-12-19 17:59:57 +00:00
Reid Spencer
97e79cf40a Correct the name of the method. CopyFiles -> CopyFile.
llvm-svn: 19025
2004-12-18 00:14:24 +00:00
Reid Spencer
652f1f43fd Adjust documentation of GetBytecodeLibraryPaths after removing LLVMGCCDIR
support from it.

llvm-svn: 18972
2004-12-15 22:49:18 +00:00
Reid Spencer
9d3a8ad836 Fix a file overwrite bug in llvm-ar introduced by changes to
createTemporaryFile semantics where it doesn't create a fully unique name
if the basename doesn't exist. This functionality is now optionally
provided by the boolean reuse_current parameter to createTemporaryFile and
makeUnique. The default values differ because of the way these functions
are used in LLVM.

llvm-svn: 18961
2004-12-15 08:32:45 +00:00
Reid Spencer
8fe73b4d39 For PR351:
* Fix implementation and documentation about LLVMGCCDIR/bytecode-libs
* Add the makeUnique method, replacement for getUniqueFilename in Support.
* Add the sys::CopyFile function, replacement for CopyFile in Support.
* Move GetLLVMConfigDir() into generic code area since its generic.

llvm-svn: 18947
2004-12-15 01:50:13 +00:00
Jeff Cohen
cc0adb0271 Implement Win32 Path::getStatusInfo(), TimeValue::toString()
llvm-svn: 18930
2004-12-14 05:26:43 +00:00
Reid Spencer
165388298b For PR351:
* Fix commentary, wrap lines, etc.
* Add an environment pointer to the ExecuteAndWait function.

llvm-svn: 18926
2004-12-14 04:17:12 +00:00
Reid Spencer
5a18b63eb5 For PR351:
Implement three new functions to allow setting access/permission bits on
the file referenced by a path. The makeReadable and makeExecutable methods
replace the FileUtilities MakeFileReadable and MakeFileExecutable
functions. The makeWritable function is new and provided for consistency
since Path has a writable() method.

llvm-svn: 18907
2004-12-13 19:59:50 +00:00
Reid Spencer
dd50ab43d0 For PR351: \
The getFileTimestamp and getFileSize functions have been removed from  \
FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and  \
Path::getSize,respectively.

llvm-svn: 18892
2004-12-13 17:01:53 +00:00
Reid Spencer
24cf14cef6 * Add a std::ostream inserter for sys::Path
* Correct the std::string constructor to take a const reference.

llvm-svn: 18877
2004-12-13 06:57:15 +00:00
Reid Spencer
1e51643433 Make the size() method const
llvm-svn: 18852
2004-12-13 02:58:51 +00:00
Reid Spencer
b4cb7f30c3 For PR351:\
* Consolidate path retrieval into just two methods. \
* Add FindLibrary as a convenience function. \
* Add isDynamicLibrary for testing for dynamic libs. \
* Make toString constant and reference clean.

llvm-svn: 18847
2004-12-13 02:57:53 +00:00
Reid Spencer
e2af9dc813 Path::get -> Path::toString
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
Reid Spencer
fea77c07f6 Add in some methods for use by the JIT. LoadLibraryPermanently brings the
library into the address space permanently. SearchForAddressOfSymbol looks
in all previously permanently loaded libraries and any currently open
libraries for a symbol, instead of just one library like GetAddressOfSymbol

llvm-svn: 18354
2004-11-29 13:27:56 +00:00
Reid Spencer
19f0bd4d59 Make the default constructor cause the program's symbols to be loaded as
if it was a dynamic library.

llvm-svn: 18340
2004-11-29 10:38:54 +00:00
Reid Spencer
c1871a4eaa Dynamic Library abstraction. This makes the abstraction of a single dynamic
library (shared library/shared object) whose symbols can be looked up
dynamically. Used for plug-ins.

llvm-svn: 17940
2004-11-18 04:33:39 +00:00
Reid Spencer
bcef3fef1d Per code review:
* get rid of (void) construct in function declarations
* make toString a const member
* add a default implementation of toString for Win32

llvm-svn: 17873
2004-11-16 06:22:17 +00:00
Reid Spencer
4031ff44bb Per code review:
* Clean up the StatusInfo constructor to construct all members and give
  them reasonable values.
* Get rid of the Vector typedef and make the interface to
  getDirectoryContent use a std::set instead of a std::vector so the dir
  content is sorted.
* Make the getStatusInfo method const and not return a useless boolean.

llvm-svn: 17872
2004-11-16 06:15:19 +00:00
Reid Spencer
32924c8d62 Changes per code review:
* Document StatusInfo fields better
* No lines > 80 cols
* Have getStatusInfo return bool if file doesn't exist
* Don't document in detail how temporary file name should be created.

llvm-svn: 17808
2004-11-14 23:29:00 +00:00
Reid Spencer
e902694309 *Make naming convention consistent.*Add convertion to/from Unix Epoch time.*Add ability to convert to readable string.
llvm-svn: 17762
2004-11-14 21:53:55 +00:00
Reid Spencer
73e4677779 Make the remove*OnSignal functions deal with Paths not strings
llvm-svn: 17761
2004-11-14 21:53:09 +00:00
Reid Spencer
63a08a4cef *Put the StatusInfo type in the right section. *Provide the ability to rename a file.*Provide the ability to get/set stat(2) information.*Provide the ability to identify LLVM file types.
llvm-svn: 17760
2004-11-14 21:52:22 +00:00
Reid Spencer
858bc78223 Allow explicit closing of the MappedFile, before destruction
llvm-svn: 17759
2004-11-14 21:51:36 +00:00
Reid Spencer
97f373cf98 Provide conversion from posix time.
llvm-svn: 17656
2004-11-09 20:29:10 +00:00
Reid Spencer
28ceb24005 * Implement getStatusInfo for getting stat(2) like information
* Implement createTemporaryFile for mkstemp(3) functionality
* Fix isBytecodeFile to accept llvc magic # (compressed) as bytecode.

llvm-svn: 17654
2004-11-09 20:26:31 +00:00
Reid Spencer
7090e6a875 Stop propagating method names that violate the coding standard
llvm-svn: 17498
2004-11-05 22:15:36 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Misha Brukman
6d5e98bb06 Wrap comments at 80 cols
llvm-svn: 17261
2004-10-26 18:00:03 +00:00
Misha Brukman
fd9bef227a * Fit constructor initializer on a single line
* Delete blank chars at end of line to fit into 80 cols

llvm-svn: 17137
2004-10-19 00:29:16 +00:00
Misha Brukman
4a81cf32a5 Fix file comment header
llvm-svn: 16942
2004-10-12 21:48:02 +00:00
Chris Lattner
4463fcc2f8 Fix #include flavor
llvm-svn: 16658
2004-10-04 18:10:18 +00:00
Reid Spencer
024857a516 Minor corrections suggested by Chris' ever-watchful eye.
llvm-svn: 16651
2004-10-04 17:26:26 +00:00
Reid Spencer
da2e8b9943 First version of the MappedFile abstraction for operating system idependent
mapping of files. This first version uses mmap where its available. The
class needs to implement an alternate mechanism based on malloc'd memory
and file reading/writing for platforms without virtual memory.

llvm-svn: 16649
2004-10-04 11:08:32 +00:00
Reid Spencer
0dbad34203 Clean up the interface of TimeValue:
- get rid of unneeded constructors
- get rid of duplicate methods/constructors/operators
- normalize to LLVM coding standards
- wrap to 80 columns.

Many thanks to Alkis Evlogimenos for his suggestions.

llvm-svn: 16514
2004-09-25 08:29:54 +00:00
Reid Spencer
894f394594 Initial implementation of the TimeValue abstraction.
llvm-svn: 16511
2004-09-24 23:25:19 +00:00
Reid Spencer
28035a5b25 Add the GetLibraryPath method.
llvm-svn: 16322
2004-09-13 23:46:23 +00:00
Reid Spencer
ce7c15737a Simplify the sys::Memory interface per Chris' request.
llvm-svn: 16318
2004-09-13 22:38:11 +00:00
Reid Spencer
2114c143cf Clean up the interface and implementation of sys::Program so that it is
cleanly dissociated from the sys::Path class.

llvm-svn: 16315
2004-09-13 21:48:44 +00:00
Reid Spencer
a166926577 Initial commit of a file to declare the interface for platform independent
support for various memory allocation operations.

llvm-svn: 16279
2004-09-11 04:20:58 +00:00
Reid Spencer
af9d3fdc9d Add methods for detecting file types by magic number, getting the file name
suffix for shared objects, and stripping a path down to its base name.

llvm-svn: 16278
2004-09-11 04:19:17 +00:00
Reid Spencer
455a47373b Add methods for detecting different kinds of files by their magic number,
getting the suffix for shared objects, and extracting the basename from a
path.

llvm-svn: 16277
2004-09-11 04:18:05 +00:00
Reid Spencer
7043c4670f Initial commit for platform independent system configuration support.
llvm-svn: 16128
2004-08-31 18:13:52 +00:00
Reid Spencer
9954f96013 Put the lib/System interface functions in llvm::sys namespace.
llvm-svn: 16083
2004-08-29 19:19:07 +00:00
Reid Spencer
114a2123ac Initial commit of the platform agnostic interface to finding and executing
programs.

llvm-svn: 16080
2004-08-29 05:29:35 +00:00
Reid Spencer
923b7083e0 Add a function to remove whole directorys on fatal signal.
Doxygenify function comments.

llvm-svn: 16079
2004-08-29 05:27:15 +00:00
Reid Spencer
f7b4fa2e24 Revise the design of the Path concept per peer review. Too many changes to
note individually but these essence of it is to not derive from
std::string, clarify the interface, and provide better documentation.
There is now also (untested) implementations for AIX, Darwin, and SunOS.

llvm-svn: 16078
2004-08-29 05:24:01 +00:00
Reid Spencer
a50f1b794a Initial implementation of the Path operating system concept.
llvm-svn: 16048
2004-08-25 06:20:07 +00:00
Reid Spencer
8b1c93c9fb Back out include/llvm/System changes until a satisfactory solution can
be determined.

llvm-svn: 15817
2004-08-16 07:10:09 +00:00
Reid Spencer
4f35f90cec First version of a class to represent the notion of an operating system
path to a file or directory and some rudimentary operations on them.

llvm-svn: 15762
2004-08-15 08:13:01 +00:00
Reid Spencer
bbd423eea8 First version of a class to represent operating system and lib/System
error codes in a platform independent way.

llvm-svn: 15761
2004-08-15 08:12:14 +00:00
Reid Spencer
38fe11e63e Added a README to point users to the documentation on the design of this
library which is a prerequisite for maintaining the library.

llvm-svn: 14909
2004-07-17 08:39:53 +00:00
Chris Lattner
04dd3fe76d Moved header from include/Support/ to include/llvm/System
llvm-svn: 13810
2004-05-27 05:30:18 +00:00