Commit Graph

205 Commits

Author SHA1 Message Date
Reid Spencer 107410613b Put the CopyFile function explicitly in the sys namespace.
llvm-svn: 19079
2004-12-21 03:27:08 +00:00
Reid Spencer 22dd8b15c0 Cygwin doesn't like .. through a link, so drop the ..
llvm-svn: 19076
2004-12-20 22:21:41 +00:00
Reid Spencer d4c6988809 Implement GetTimeUsage correctly.
llvm-svn: 19074
2004-12-20 21:43:33 +00:00
Reid Spencer 8005e66f0a 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 1cf74cee21 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 7ae0bc7111 Keep up with lib/System changes
llvm-svn: 19057
2004-12-20 03:24:56 +00:00
Reid Spencer ac38f3a028 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 27fa6c6d49 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 f06cb1db24 * 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 0eb431c04c Use <> for system #include files
llvm-svn: 19046
2004-12-19 19:27:11 +00:00
Brian Gaeke 8062bde121 Make references to 'struct sigaction' compile under Solaris.
llvm-svn: 19045
2004-12-19 18:58:11 +00:00
Reid Spencer 6cb551b279 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 72d1627d16 For PR351:
Add a needed include.

llvm-svn: 19042
2004-12-19 18:00:32 +00:00
Jeff Cohen 81184bb528 Fix win32 breakage
llvm-svn: 19028
2004-12-18 06:42:15 +00:00
Jeff Cohen fc6ebc9cb7 Expository comment submitted by Henrik Bach
llvm-svn: 18976
2004-12-16 04:06:56 +00:00
Reid Spencer e56242780c 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 35d15bdf52 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
Reid Spencer 879f11df3d Remove automatic insertion of CFE's lib directory into the bytecode path
because LLVM should be agnostic to the needs of specific front ends.

llvm-svn: 18968
2004-12-15 22:21:42 +00:00
Reid Spencer 98ce23ffb0 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
Jeff Cohen 92e02d40cb Make Win32 TimeValue::toString() re-entrant and work with mingw
llvm-svn: 18954
2004-12-15 04:28:44 +00:00
Jeff Cohen e408341854 Fix VC++ compilation errors
llvm-svn: 18953
2004-12-15 04:08:15 +00:00
Reid Spencer f66d93239e 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
Reid Spencer c936ad1208 Add the getMagicNumber method.
Patch contributed by Henrik Bach. Thanks Henrik!

llvm-svn: 18933
2004-12-14 18:42:13 +00:00
Jeff Cohen 2b60d39499 Implement Win32 Path::getStatusInfo(), TimeValue::toString()
llvm-svn: 18930
2004-12-14 05:26:43 +00:00
Reid Spencer cdefe0aebc For PR351:
Implement the new environment pointer for ExecuteAndWait

llvm-svn: 18928
2004-12-14 04:18:51 +00:00
Reid Spencer 94bf2265df 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 e05ab4a1ec Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT
available.

llvm-svn: 18904
2004-12-13 18:41:28 +00:00
Reid Spencer 790100674a Fix a bug where "." or any single character file name doesn't get the
terminating / when setDirectory is called.

llvm-svn: 18886
2004-12-13 07:51:52 +00:00
Reid Spencer a85abc23d5 Remove an always false clause from an if statement.
llvm-svn: 18885
2004-12-13 07:51:07 +00:00
Alkis Evlogimenos 5b1a05fb7c Fix a bug where directory names of length one or less where not set
properly (examples: "", ".", "a").

llvm-svn: 18883
2004-12-13 07:41:35 +00:00
Reid Spencer 0230a5eead * 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
Jeff Cohen ccd99b9b61 Fix recent breakage of win32 build
llvm-svn: 18876
2004-12-13 06:26:35 +00:00
Reid Spencer 0a0d582719 Implement new functions per new interface
llvm-svn: 18866
2004-12-13 03:03:42 +00:00
Reid Spencer 9b155dc4c0 For PR351: \
* Remove IsLibrary and GetLibraryPath, replaced by FindLibrary in ../Path.cpp \
* Implement GetSystemLibraryPaths and GetBytecodeLibraryPaths, instead of the \
  GetSystemLibraryPath1 and GetSystemLibraryPath2 methods

llvm-svn: 18862
2004-12-13 03:00:51 +00:00
Reid Spencer 66b8182866 For PR351: \
* Move generic isArchive method here from Unix/Path.cpp \
* Implement isDynamicLibrary \
* Implement FindLibrary for Linker

llvm-svn: 18861
2004-12-13 03:00:39 +00:00
Reid Spencer 35f16dd40b Make the size() method const
llvm-svn: 18852
2004-12-13 02:58:51 +00:00
Reid Spencer 5625dec232 Rename Path::get -> Path::toString
llvm-svn: 18802
2004-12-11 17:37:01 +00:00
Reid Spencer 5ccfd5a48b Path::get -> Path::toString
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
Jeff Cohen 07a900f0b7 Fix residual Visual Studio build problems
llvm-svn: 18688
2004-12-09 05:51:11 +00:00
Chris Lattner 6ef473f53c Make this work with the ICC compiler, contributed by Bjørn Wennberg
llvm-svn: 18626
2004-12-08 16:10:52 +00:00
Chris Lattner 73a1914131 Fix compilation error on Darwin.
llvm-svn: 18485
2004-12-04 04:17:20 +00:00
Chris Lattner 4cf8b36469 Move darwin-specific majik here.
llvm-svn: 18466
2004-12-03 23:02:42 +00:00
Reid Spencer f473185cbc Fix seriously broken implementation of GetMagicNumber.
llvm-svn: 18422
2004-12-02 09:09:48 +00:00
Reid Spencer 0e6a4fc448 Implement two new functions: LoadLibraryPermanently and
SearchForAddressOfSymbol.

llvm-svn: 18355
2004-11-29 13:33:28 +00:00
Reid Spencer 3468ae1a87 We just use ltdl's implementation for this abstraction now. Its portable to
more platforms than LLVM supports.

llvm-svn: 18352
2004-11-29 12:39:10 +00:00
Reid Spencer 47430cf2a5 Mods for compilation with llvm.
llvm-svn: 18346
2004-11-29 12:04:27 +00:00
Reid Spencer 11ba920d55 Original version of ltdl.h from libtool 1.5.10
llvm-svn: 18345
2004-11-29 12:02:48 +00:00
Reid Spencer 6717b80ba2 Original version of ltdl.c from libtool 1.5.10
llvm-svn: 18344
2004-11-29 12:02:25 +00:00
Reid Spencer 72a7457a90 Implement the default constructor which causes the current program to be
opened as if it was a dynamic library so its symbols can be searched too.

llvm-svn: 18341
2004-11-29 10:39:46 +00:00
Reid Spencer 9afecaf4ff Cast the void* handle data member to HMODULE* to keep the VC++ compiler
happy. Thanks to Henrik Bach for pointing this out.

llvm-svn: 18056
2004-11-20 23:30:55 +00:00
Reid Spencer 4a763ca854 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 1b13a7cdb8 * Use low-level unix I/O interface since we're on Unix.
* Don't use variable length arrays (replaced with alloca)

llvm-svn: 17901
2004-11-16 17:14:08 +00:00
Misha Brukman c356686749 Erase non-applicable Unix comment, this is Win32
llvm-svn: 17896
2004-11-16 07:35:32 +00:00
Reid Spencer 7cdcb2b0cb Remove useless #include.
Patch contributed by Jeff Cohen.

llvm-svn: 17891
2004-11-16 07:00:23 +00:00
Reid Spencer f070b6c4ac Simplify code.
Patch contributed by Jeff Cohen.

llvm-svn: 17890
2004-11-16 06:59:53 +00:00
Reid Spencer 09e9f2a37b 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 91f505eae9 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 1ae1656363 Provide the ThrowErrno utility.
Patch contributed by Morten Ofstad

llvm-svn: 17827
2004-11-15 17:21:57 +00:00
Reid Spencer b96afe4b7e Adjust implementation to match new interface.
Patch provided by Morten Ofstad

llvm-svn: 17826
2004-11-15 17:20:28 +00:00
Reid Spencer dacbf466c8 Actually get the #include correct so it compiles .. duh.
llvm-svn: 17817
2004-11-15 04:47:22 +00:00
Reid Spencer 315efa1a84 Make it actually compile on Solaris.
llvm-svn: 17815
2004-11-15 04:42:44 +00:00
Reid Spencer bfb7b3eb68 Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.

llvm-svn: 17813
2004-11-15 04:36:35 +00:00
Reid Spencer 7705ec231c Implement functionality suggested from code review: getStatusInfo should
returnn false if the file doesn't exist rather than throw ane exception.

llvm-svn: 17809
2004-11-14 23:30:38 +00:00
Reid Spencer 6881623775 Make sure IdentifyFileType is in the sys namespace.
llvm-svn: 17806
2004-11-14 23:26:18 +00:00
Alkis Evlogimenos 55117fa471 Add missing include.
llvm-svn: 17799
2004-11-14 22:37:42 +00:00
Reid Spencer 2dd5e71836 Forget strerror_r, it causes problems. Fix later when threading matters
llvm-svn: 17783
2004-11-14 22:10:54 +00:00
Reid Spencer 0d455997f8 Implement the toString method
llvm-svn: 17782
2004-11-14 22:10:08 +00:00
Reid Spencer 26e2bd44f2 Update for prototype changes
llvm-svn: 17781
2004-11-14 22:09:22 +00:00
Reid Spencer c1d474f069 * Implement getDirectoryContents * Implement getStatusInfo * Implement setStatusInfo * Implement renameFile
llvm-svn: 17780
2004-11-14 22:08:36 +00:00
Reid Spencer 60c72a339b Fix bugs in class invariant
llvm-svn: 17779
2004-11-14 22:07:50 +00:00
Reid Spencer 8b89b8333e Include the correct implementation file
llvm-svn: 17778
2004-11-14 22:07:04 +00:00
Reid Spencer 05be57b518 Don't exceed 80 columns.
llvm-svn: 17777
2004-11-14 22:06:18 +00:00
Reid Spencer 0d0d07e0f0 Implement IdentifyFileType function
llvm-svn: 17776
2004-11-14 22:05:32 +00:00
Reid Spencer 202eaeb272 Fix isBytecodeFile to correctly recognized compressed bytecode too.
llvm-svn: 17655
2004-11-09 20:27:23 +00:00
Reid Spencer fb1f7357c2 * 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 e7d98cccd9 Fix a typo: isvalid -> isValid
llvm-svn: 17621
2004-11-08 08:27:51 +00:00
Misha Brukman 7ee6c5525e Consistently use llvm.cs.uiuc.edu instead of llvm.org
llvm-svn: 17548
2004-11-07 00:58:20 +00:00
Reid Spencer 0c6a283b2a Stop propagating method names that violate the coding standard
llvm-svn: 17498
2004-11-05 22:15:36 +00:00
Reid Spencer 57cbe39d1e Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer aa4887b482 Add EXTRA_DIST for additional files to be distributed.
llvm-svn: 17233
2004-10-26 03:12:11 +00:00
Reid Spencer c1c320c335 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Misha Brukman 648ad57b85 Fix some grammar
llvm-svn: 17141
2004-10-19 05:55:54 +00:00
Reid Spencer 6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Misha Brukman 22cf52374e AIX does not have mkdtemp() so emulate its behavior using mktemp() and mkdir()
llvm-svn: 17131
2004-10-18 17:39:45 +00:00
Reid Spencer 69812714cd Allow this file to compile on Darwin.
llvm-svn: 16971
2004-10-14 03:33:25 +00:00
Reid Spencer 37d4d6b2a2 Use __MINGW instead of __MING. Patch contributed by Henrik Bach.
llvm-svn: 16970
2004-10-14 03:09:02 +00:00
Reid Spencer 2f5fd88036 Get proper BSD #includes for MappedFile implementation.
llvm-svn: 16969
2004-10-14 03:06:59 +00:00
Reid Spencer 9cb9354d17 Implementation of MappedFile for Win32. Patch provided by Jeff Cohen.
llvm-svn: 16968
2004-10-14 03:05:59 +00:00
Reid Spencer ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer b84cbf2725 Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Brian Gaeke c5a630bd3c Must include sys/stat.h before declaring a 'struct stat'
llvm-svn: 16728
2004-10-05 18:46:59 +00:00
Reid Spencer abb04cfc79 Adjust sys/stat.h inclusion so its only for SunOS.
llvm-svn: 16686
2004-10-05 00:56:46 +00:00
Tanya Lattner c3ef3cc7e5 Added a couple of includes to get this to compile on Sparc.
llvm-svn: 16685
2004-10-05 00:51:26 +00:00
Chris Lattner 9895937618 Solaris doesn't have MAP_FILE.
llvm-svn: 16682
2004-10-05 00:46:21 +00:00
Reid Spencer 161a459d42 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
Misha Brukman a468200286 That should actually be __MING, not __MINGW.
llvm-svn: 16617
2004-09-30 18:28:07 +00:00
Misha Brukman ba94e672c3 Check for __MINGW define instead of __MINGW_H, patch by Henrik Bach.
llvm-svn: 16615
2004-09-30 18:24:58 +00:00
Reid Spencer 7aed44892c Improve validity checking of windows path names and fix file creation
problems.

Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16565
2004-09-29 00:01:17 +00:00
Reid Spencer 70b6835853 Use llvm::sys::Path to destroy the file.
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16564
2004-09-28 23:58:03 +00:00
Reid Spencer 364cce404a Win32 implementation of TimeValue::now().
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16563
2004-09-28 23:56:20 +00:00