Commit Graph

63 Commits

Author SHA1 Message Date
Reid Spencer
8475ec068c For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:05:44 +00:00
Jeff Cohen
84892be310 Determine absolute paths the correct way :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:27:38 +00:00
Reid Spencer
4031befb62 Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:00:31 +00:00
Reid Spencer
69cce815e7 For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35456 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 16:43:20 +00:00
Jeff Cohen
d41b30def3 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31464 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 19:31:28 +00:00
Anton Korobeynikov
7d51544903 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 20:35:17 +00:00
Reid Spencer
0554575567 For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 21:37:17 +00:00
Reid Spencer
30300996b3 For PR797:
Adjust implementation to match the new interface after exception handling
was removed in the Unix verison. NOTE: this hasn't been compiled yet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29858 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-24 18:58:37 +00:00
Reid Spencer
5a060775da For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 07:30:48 +00:00
Reid Spencer
142ca8e818 For PR797:
Remove exception throwing from Path::getDirectoryContents and its users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29841 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 06:56:27 +00:00
Reid Spencer
a34a15765d For PR797:
Adjust code to compensate for Path class interface change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29837 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 23:54:35 +00:00
Reid Spencer
cab0e43829 Update for changes in Path class interface for exception removal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29834 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 22:46:39 +00:00
Chris Lattner
0d167276dd Remove some now-dead methods. Use getFileStatus instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 18:16:02 +00:00
Chris Lattner
c7c453a845 elimiante some syscalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 17:51:09 +00:00
Anton Korobeynikov
1a7d326359 Minor fix due to recent API changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29428 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01 08:07:22 +00:00
Chris Lattner
1bebfb5ae4 Modify setStatusInfoOnDisk to not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29402 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:36:17 +00:00
Chris Lattner
7dea1019c1 Update win32 for Path::getStatusInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29401 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:32:09 +00:00
Chris Lattner
0c33231eff Modify Path::eraseFromDisk to not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29400 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:29:50 +00:00
Reid Spencer
ab4d9b0446 Squelch a warning about signed/unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:08:43 +00:00
Reid Spencer
393830a33a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 17:00:08 +00:00
Reid Spencer
3e0c154240 For PR798:
Add support for Graphviz. Patch contributed by Anton Korobeynikov.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-05 15:44:46 +00:00
Jeff Cohen
e564de2d37 Unlike Unix, Windows won't let a file be implicitly replaced via renaming without explicit permission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28157 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-07 02:51:51 +00:00
Jeff Cohen
10a59ce701 Mingw32 patches supplied by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28023 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-29 18:41:44 +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
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
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
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
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
Jeff Cohen
9437bb6d27 Fix some Path bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19852 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 03:49:03 +00:00
Jeff Cohen
c690cc0465 Fix destroyDirectory bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19746 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 16:28:33 +00:00
Jeff Cohen
3bbbcc113b Fix and improve win32 path validation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19545 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-14 04:09:39 +00:00
Jeff Cohen
45e88d68b3 Where do these tabs keep coming from???
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-31 19:03:31 +00:00
Jeff Cohen
51b8d211f6 Mostly cleanup, but also some bug fixes, for win32/Path.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19202 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-31 19:01:08 +00:00
Jeff Cohen
d40a7de229 Get rid of those nasty tabs...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19199 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-31 05:07:26 +00:00
Jeff Cohen
ebcb9b3807 Bring win32/Path.cpp up to date with respect to Unix/Path.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19198 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-31 04:39:07 +00:00
Jeff Cohen
cb652550b6 Fix VC++ compilation error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19124 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-24 02:38:34 +00:00
Reid Spencer
a36c9a4dd3 Put CopyFile in the sys namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-23 22:14:32 +00:00
Jeff Cohen
f8cdb85d05 Fix win32 breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19028 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-18 06:42:15 +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
24ac21f937 Remove the CFE's lib directory from the bytecode path because LLVM should
be agnostic to the needs of any specific FE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18969 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 22:22:51 +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
Jeff Cohen
ab68df02bc Fix VC++ compilation errors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 04:08:15 +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
3b0cc78c60 Add the getMagicNumber method.
Patch contributed by Henrik Bach. Thanks Henrik!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18933 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 18:42:13 +00:00
Jeff Cohen
626e38e481 Implement Win32 Path::getStatusInfo(), TimeValue::toString()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 05:26:43 +00:00