Displaying 7 results from an estimated 7 matches for "path_storage".
2016 Apr 18
2
Redundant Twine->StringRef->Twine conversions in llvm::sys::fs::make_absolute?
...ngRef can implicitly convert to an llvm::Twine, p converts
to a bunch of Twine temporaries.
In a few places, namely path::has_root_directory & path::has_root_name,
that temporary Twine is again converted to a StringRef:
bool has_root_directory(const Twine &path) {
SmallString<128> path_storage;
StringRef p = path.toStringRef(path_storage);
return !root_directory(p).empty();
}
Is there some reason for this? If not, I'll write a patch to delay the
StringRef
p(path.data(), path.size()) construction until it's actually needed (calls
to path::root_name(p) & path::relative_pa...
2012 Mar 22
1
[LLVMdev] Infinite recursion in sys::fs::create_directories()
...curses and looks for the parent or "" which is "" which
doesn't exist etc. The function should perhaps check if parent is empty.
Here is how I fixed it:
//------------------
error_code create_directories(const Twine &path, bool &existed) {
SmallString<128> path_storage;
StringRef p = path.toStringRef(path_storage);
StringRef parent = path::parent_path(p);
if (!parent.empty()) {
bool parent_exists;
if (error_code ec = exists(parent, parent_exists)) return ec;
if (!parent_exists)
if (error_code ec = create_directories(parent, existed)) ret...
2012 Jun 19
0
[LLVMdev] llvm/include/Support/FileSystem.h
This is a proposed patch to enhance FileSystem.h to add functionality (getting and setting permission bits and mapping an unmapping files). This implementation follows the N3365 proposal regarding permission bits.
This functionality is needed for my next patch which will implement llvm/include/Support/FileOutputBuffer.h which is needed by lld.
-------------- next part --------------
A
2012 May 18
0
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
...th_null(path);
> @@ -496,6 +532,97 @@
> return error_code::success();
> }
>
> +error_code map_file_pages(const Twine &path, off_t file_offset, size_t size,
> + bool map_writable, void *&result) {
> + SmallString<128> path_storage;
> + StringRef name = path.toNullTerminatedStringRef(path_storage);
> + int oflags = map_writable ? O_RDWR : O_RDONLY;
> + int fd = ::open(name.begin(), oflags);
> + if ( fd == -1 )
> + return error_code(errno, system_category());
> + int flags = map_writable ? MAP_SHARED...
2012 May 18
2
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
On Fri, May 18, 2012 at 3:07 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
>
>> + error_code ec = sys::fs::status(filePathTwine, stat);
>
> stat is undefined if ec isn't success. ec will be success even in the case of
> file_not_found.
Actually I was wrong. The Windows and UNIX implementation disagree on
this point. I'm going to change it to match
2012 May 17
3
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
I now have an implementation of FileOutputBuffer (OutputBuffer was already taken). The patch supports the functionality listed below and I've tested that it works for lld.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileOutputBuffer.patch
Type: application/octet-stream
Size: 25308 bytes
Desc: not available
URL:
2012 Mar 21
0
[LLVMdev] Infinite recursion in sys::fs::create_directories()
...curses and looks for the parent or "" which is "" which
doesn't exist etc. The function should perhaps check if parent is empty.
Here is how I fixed it:
//------------------
error_code create_directories(const Twine &path, bool &existed) {
SmallString<128> path_storage;
StringRef p = path.toStringRef(path_storage);
StringRef parent = path::parent_path(p);
if (!parent.empty()) {
bool parent_exists;
if (error_code ec = exists(parent, parent_exists)) return ec;
if (!parent_exists)
if (error_code ec = create_directories(parent, existed)) ret...