Commit Graph

76 Commits

Author SHA1 Message Date
Reid Spencer
7c1e2f96cd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:50 +00:00
Reid Spencer
51b9f62462 For PR351:
* Remove redundant #includes that are now in Unix.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19160 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:39 +00:00
Reid Spencer
68fdcc123b For PR351:
* Move implementation of sys::PreventCoreFiles function to this file from
  the now defunct SysConfig abstraction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19159 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:27 +00:00
Reid Spencer
af2f208e7c For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Ensure variations in "dirent" structure are accounted for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19158 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:15 +00:00
Reid Spencer
07c00d3e9f For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Consolidate implementation from operating system specific directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19157 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:17:03 +00:00
Reid Spencer
cdf54d04c7 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19156 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:16:52 +00:00
Reid Spencer
d0ae93f022 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19149 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-27 06:15:14 +00:00
Reid Spencer
69a1616106 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19134 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-24 06:29:42 +00:00
Reid Spencer
48a1f4237d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19129 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-24 03:59:46 +00:00
Reid Spencer
78076f6140 Put the CopyFile function explicitly in the sys namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19079 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-21 03:27:08 +00:00
Reid Spencer
8b6628997f Implement GetTimeUsage correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19074 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 21:43:33 +00:00
Reid Spencer
ed5e7bf422 Provide a getrusage based implementation of GetTotalMemoryUsage and use
the ru_maxrss field as an approximation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19072 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 16:33:37 +00:00
Reid Spencer
bc1ee84001 Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19071 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 16:06:44 +00:00
Reid Spencer
721d9aa060 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 00:59:28 +00:00
Misha Brukman
210b32b16f * Use "" for LLVM include files, not <>
* llvm/Config/alloca.h already #includes config.h
* Minor readability/stylistic changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-20 00:16:38 +00:00
Misha Brukman
6782835604 Use <> for system #include files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-19 19:27:11 +00:00
Brian Gaeke
5d112c452a Make references to 'struct sigaction' compile under Solaris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-19 18:58:11 +00:00
Reid Spencer
2a7d9e98ba For PR351:
Move the functionality of RunProgramWithTimeout into the ExecuteAndWait
function: support a timeout and I/O redirects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19043 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-19 18:00:44 +00:00
Reid Spencer
41394ec672 For PR351:
Add a needed include.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19042 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-19 18:00:32 +00:00
Reid Spencer
00e8930206 Change the signatures of the destroyFile and destroyDirectory methods to
const because they affect the file system, not the Path object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18973 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 23:02:10 +00:00
Reid Spencer
835b6941fd Remove automatic insertion of CFE's lib directory into the bytecode path
because LLVM should be agnostic to the needs of specific front ends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18968 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 22:21:42 +00:00
Reid Spencer
07f9f4e2a4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18961 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 08:32:45 +00:00
Reid Spencer
c29befb554 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18947 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 01:50:13 +00:00
Reid Spencer
e2e2411f40 For PR351:
Implement the new environment pointer for ExecuteAndWait


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 04:18:51 +00:00
Reid Spencer
77cc91deaa 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18907 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 19:59:50 +00:00
Reid Spencer
3d595cba33 Remove an always false clause from an if statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 07:51:07 +00:00
Alkis Evlogimenos
07941b493d Fix a bug where directory names of length one or less where not set
properly (examples: "", ".", "a").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 07:41:35 +00:00
Reid Spencer
732f92d56e * Add a std::ostream inserter for sys::Path
* Correct the std::string constructor to take a const reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18877 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 06:57:15 +00:00
Reid Spencer
1b6b99bffc For PR351: \
* Remove IsLibrary and GetLibraryPath, replaced by FindLibrary in ../Path.cpp \
* Implement GetSystemLibraryPaths and GetBytecodeLibraryPaths, instead of the \
  GetSystemLibraryPath1 and GetSystemLibraryPath2 methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 03:00:51 +00:00
Reid Spencer
56c3ed854f Make the size() method const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 02:58:51 +00:00
Reid Spencer
1fce09125c Path::get -> Path::toString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 00:14:15 +00:00
Chris Lattner
194ca80fdb Make this work with the ICC compiler, contributed by Bjørn Wennberg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18626 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 16:10:52 +00:00
Reid Spencer
86ac2dcda1 Fix seriously broken implementation of GetMagicNumber.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-02 09:09:48 +00:00
Reid Spencer
441cc2ab01 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18341 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-29 10:39:46 +00:00
Reid Spencer
0de02a6ba9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 04:33:39 +00:00
Reid Spencer
be31d2ad78 * Use low-level unix I/O interface since we're on Unix.
* Don't use variable length arrays (replaced with alloca)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17901 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 17:14:08 +00:00
Reid Spencer
8bf7fba10b Per code review:
* get rid of (void) construct in function declarations
* make toString a const member
* add a default implementation of toString for Win32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17873 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:22:17 +00:00
Reid Spencer
b608a81a18 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17872 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:15:19 +00:00
Reid Spencer
2e83ea5211 Make it actually compile on Solaris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17815 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 04:42:44 +00:00
Reid Spencer
00b5df427f Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 04:36:35 +00:00
Reid Spencer
2fbf978cb7 Implement functionality suggested from code review: getStatusInfo should
returnn false if the file doesn't exist rather than throw ane exception.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17809 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 23:30:38 +00:00
Reid Spencer
64a10ce9ad Forget strerror_r, it causes problems. Fix later when threading matters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:10:54 +00:00
Reid Spencer
d351871d9b Implement the toString method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17782 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:10:08 +00:00
Reid Spencer
944655922e Update for prototype changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17781 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:09:22 +00:00
Reid Spencer
eaf181550a * Implement getDirectoryContents * Implement getStatusInfo * Implement setStatusInfo * Implement renameFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17780 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:08:36 +00:00
Reid Spencer
083507cd3f Fix bugs in class invariant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:07:50 +00:00
Reid Spencer
9195f37c5f * Implement getStatusInfo for getting stat(2) like information
* Implement createTemporaryFile for mkstemp(3) functionality
* Fix isBytecodeFile to accept llvc magic # (compressed) as bytecode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17654 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-09 20:26:31 +00:00
Reid Spencer
07adb2836b Stop propagating method names that violate the coding standard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17498 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 22:15:36 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18:45 +00:00
Brian Gaeke
e789a6bfff Must include sys/stat.h before declaring a 'struct stat'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-05 18:46:59 +00:00