Rafael Espindola
0b68f0368b
Remove declared but not implemented function.
...
llvm-svn: 193637
2013-10-29 18:31:14 +00:00
Benjamin Kramer
b0d0e9091e
Speling fixes.
...
llvm-svn: 193165
2013-10-22 15:18:03 +00:00
NAKAMURA Takumi
acf0c41730
Support/FileSystem.h: Remove a trailing comma in enum file_magic::Impl.
...
llvm-svn: 192745
2013-10-15 23:01:44 +00:00
Rui Ueyama
a0789cb92a
Path: Recognize Windows compiled resource file.
...
Some background: One can pass compiled resource files (.res files) directly
to the linker on Windows. If a resource file is given, the linker will run
"cvtres" command in background to convert the resource file to a COFF file
to link it.
What I'm trying to do with this patch is to make the linker to recognize
the resource file by file magic, so that it can run cvtres command.
Differential Revision: http://llvm-reviews.chandlerc.com/D1943
llvm-svn: 192742
2013-10-15 22:45:38 +00:00
Nick Lewycky
53a892abea
Fix typos in assert message.
...
llvm-svn: 190034
2013-09-05 06:53:59 +00:00
Benjamin Kramer
8ffebfb497
Make directory iterator sentinels free.
...
This trades some complexity in operator== for not introducing static objects
into any functions using recursive directory iterators.
llvm-svn: 188081
2013-08-09 17:03:39 +00:00
Rafael Espindola
c3846d42e3
Expose that the unique file ID has a device and a file component.
...
The use of sd_dev and st_ino has reached libclang, so expose the two components
in UniqueID so that we can use it in clang.
llvm-svn: 187616
2013-08-01 21:36:02 +00:00
Rafael Espindola
197ab4ef5c
Make file_status::getUniqueID const.
...
llvm-svn: 187383
2013-07-29 21:55:38 +00:00
Rafael Espindola
2bf7932f99
Include st_dev to make the result of getUniqueID actually unique.
...
This will let us use getUniqueID instead of st_dev directly on clang.
llvm-svn: 187378
2013-07-29 21:26:49 +00:00
Rafael Espindola
d5796b9a12
Remove dead code.
...
llvm-svn: 186561
2013-07-18 03:29:51 +00:00
Rafael Espindola
52e19a1bf7
Add simpler version of is_directory. It will be used in clang.
...
llvm-svn: 186486
2013-07-17 04:20:49 +00:00
Rafael Espindola
2a9326a78f
Add a wrapper for open.
...
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).
llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Rafael Espindola
11c4a6dce3
Add a version of sys::fs::status that uses fstat.
...
llvm-svn: 186378
2013-07-16 03:20:13 +00:00
Rafael Espindola
4e9e39062b
Instead friending status, provide windows and posix constructors to file_status.
...
This opens the way of having static helpers in the .inc files that can
construct a file_status.
llvm-svn: 186376
2013-07-16 02:55:33 +00:00
Benjamin Kramer
60ca836ce0
Update doxygen comment to match renamed parameters.
...
Found by -Wdocumentation.
llvm-svn: 186021
2013-07-10 18:01:16 +00:00
Rafael Espindola
af2c19d481
Use status to implement file_size.
...
The status function is already using a syscall that returns the file size.
Remember it and implement file_size as a simple wrapper.
No functionally change, but clients that already use status now can avoid
calling file_size.
llvm-svn: 186016
2013-07-10 17:16:40 +00:00
Rafael Espindola
1732782ad3
clang-format this enum.
...
llvm-svn: 185835
2013-07-08 16:55:56 +00:00
Rafael Espindola
fc25f0c6cf
We now always create files with the correct permissions. Simplify the interface.
...
llvm-svn: 185834
2013-07-08 16:42:01 +00:00
Rafael Espindola
5d9e1a875f
Remove unique_file now that it is unused.
...
llvm-svn: 185728
2013-07-05 21:19:35 +00:00
Rafael Espindola
66da97e093
Add a createUniqueFile function and switch llvm's users of unique_file.
...
This function is complementary to createTemporaryFile. It handles the case were
the unique file is *not* temporary: we will rename it in the end. Since we
will rename it, the file has to be in the same filesystem as the final
destination and we don't prepend the system temporary directory.
This has a small semantic difference from unique_file: the default mode is 0666.
This matches the behavior of most unix tools. For example, with this change
lld now produces files with the same permissions as ld. I will add a test
of this change when I port clang over to createUniqueFile (next commit).
llvm-svn: 185726
2013-07-05 21:01:08 +00:00
Rafael Espindola
b874aa69e3
Add a higher level createTemporaryFile function.
...
This function is inspired by clang's Driver::GetTemporaryPath. It hides the
pattern used for uniquing and requires simple file names that are always
placed in the system temporary directory.
llvm-svn: 185716
2013-07-05 19:56:49 +00:00
Rafael Espindola
4cfcd31f11
Don't ask for a mode when we are not keeping the file.
...
llvm-svn: 185123
2013-06-28 01:05:47 +00:00
Matt Arsenault
b23dabd21b
Fix typo
...
llvm-svn: 185120
2013-06-28 00:25:36 +00:00
Rafael Espindola
ac62522b9b
Add a convenience createUniqueDirectory function.
...
There are a few valid situation where we care about the structure inside a
directory, but not about the directory itself. A simple example is for unit
testing directory traversal.
PathV1 had a function like this, add one to V2 and port existing users of the
created temp file and delete it hack to using it.
llvm-svn: 185059
2013-06-27 03:45:31 +00:00
Rafael Espindola
86155d2520
Use enums instead of raw octal values.
...
Patch by 罗勇刚(Yonggang Luo).
llvm-svn: 184971
2013-06-26 17:28:04 +00:00
Rafael Espindola
b77cf0c5fd
Add a convenience functions that don't return if the directory existed.
...
llvm-svn: 184955
2013-06-26 15:21:13 +00:00
Rafael Espindola
61fa1327a4
Add a simpler version of remove_all.
...
llvm-svn: 184919
2013-06-26 06:06:54 +00:00
Rafael Espindola
07ffa7d08b
Port GetMainExecutable over to PathV2.
...
I will remove the V1 version as soon as I change clang in the next commit.
llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Rafael Espindola
c337eb5b91
Add a simpler version of is_regular_file.
...
llvm-svn: 184764
2013-06-24 17:54:24 +00:00
Rafael Espindola
9636a2717e
Remove last use of PathV1.h from Archive.cpp.
...
llvm-svn: 184484
2013-06-20 22:02:10 +00:00
Rafael Espindola
932ff464b9
make getLastModificationTime const. Move it with the other getters.
...
llvm-svn: 184478
2013-06-20 21:51:49 +00:00
Rafael Espindola
695308b067
Add a setLastModificationAndAccessTime to PathV2.
...
With this we can remove the last use of PathV1 from llvm-ar.cpp.
llvm-svn: 184464
2013-06-20 20:56:14 +00:00
Rafael Espindola
ffbd9ee39f
Add support for getting the last modification time from a file_status.
...
Use that in llvm-ar.cpp to replace a use of sys::PathWithStatus.
llvm-svn: 184450
2013-06-20 18:42:04 +00:00
Rafael Espindola
0a090bf840
Remove the transitional GetUniqueID.
...
llvm-svn: 184433
2013-06-20 15:20:11 +00:00
Rafael Espindola
dc37cdb22d
Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.
...
llvm-svn: 184431
2013-06-20 15:06:35 +00:00
Aaron Ballman
406fa22a89
Modified the implementation of fs::GetUniqueID on Windows such that it actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID.
...
llvm-svn: 184351
2013-06-19 21:03:50 +00:00
Rafael Espindola
40fa7cd224
Add a can_write function to PathV2.
...
llvm-svn: 184233
2013-06-18 20:56:38 +00:00
Rafael Espindola
c014b80c02
Add a GetUniqueID that will replace the uniqueID of PathV1.h.
...
llvm-svn: 184217
2013-06-18 19:34:49 +00:00
Rafael Espindola
18bf1abdc7
Add a version of unique_file that return just the file name.
...
llvm-svn: 184206
2013-06-18 17:01:00 +00:00
Alexey Samsonov
50c414e3d0
Basic support for parsing Mach-O universal binaries in LLVMObject library
...
llvm-svn: 184191
2013-06-18 15:03:28 +00:00
Rafael Espindola
2b411d1243
Don't use PathV1.h in LTOCodeGenerator.cpp
...
This patch also adds a simpler version of sys::fs::remove and a tool_output_file
constructor for when we already have an open file.
llvm-svn: 184095
2013-06-17 18:05:35 +00:00
Rafael Espindola
a92eae8cb9
Delete declared but not implemented functions.
...
llvm-svn: 184087
2013-06-17 17:15:00 +00:00
Rafael Espindola
109393c56d
Replace use of PathV1.h in Program.cpp.
...
llvm-svn: 183996
2013-06-14 19:38:45 +00:00
Rafael Espindola
d506a5e174
Remove sys::identifyFileType.
...
llvm-svn: 183763
2013-06-11 18:18:02 +00:00
Rafael Espindola
3ae9fcd908
Fix variable name style. Don't cast to and from int.
...
This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.
llvm-svn: 183749
2013-06-11 15:29:10 +00:00
Rafael Espindola
1df3f4fedd
Add a missing 'e'.
...
llvm-svn: 183692
2013-06-10 20:32:27 +00:00
Michael J. Spencer
dc23417a6b
[Support] Fix lifetime of file descriptors when using MemoryBuffer.
...
Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file
descriptor passed in. So don't.
llvm-svn: 176995
2013-03-14 00:20:10 +00:00
Jakub Staszak
f1ea1a7f37
Fix include guards so they exactly match file names.
...
llvm-svn: 172025
2013-01-10 00:45:19 +00:00
Chandler Carruth
5286042938
Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.
...
Rationale:
1) This was the name in the comment block. ;]
2) It matches Clang's __has_feature naming convention.
3) It matches other compiler-feature-test conventions.
Sorry for the noise. =]
I've also switch the comment block to use a \brief tag and not duplicate
the name.
llvm-svn: 168996
2012-11-30 11:45:22 +00:00
Dmitri Gribenko
8982c8a34d
Fix a couple of Doxygen comment issues pointed out by -Wdocumentation.
...
llvm-svn: 163721
2012-09-12 16:59:47 +00:00