search for: tonullterminatedstringref

Displaying 6 results from an estimated 6 matches for "tonullterminatedstringref".

2020 Sep 07
2
[ADT] Adding instrumentation for ASAN to SmallVector
...using Address sanitizer to detect cases where references used after they are invalidated. This basic implementation for this is here - https://reviews.llvm.org/D87237 However, in adding/testing this, I did uncover some questionable code. Firstly `SmallString<unsigned>::c_str()` and `Twine::toNullTerminatedStringRef(SmallVectorImpl<char>&)` both use bytes outside the range of the SmallVectors storage. This isn't inherently bad. Secondly calling `SmallVectorImpl<T>::insert(iterator, const T&)` results in a reference invalidation when the element to insert is contained inside the SmallVec...
2012 May 18
0
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
...; 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 : MAP_PRIVATE; > + int prot = map_writable ? (PROT_RE...
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 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
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
2017 Nov 09
10
Experiment on how to improve our temporary file handing.
Currently a power failure or other hard crash can cause lld leave a temporary file around. The same is true for other llvm tools. As an example, put a breakpoint in Writer.cpp:236 ("writeBuildId()") and restart the run a few times. You will get t.tmp43a735a t.tmp4deeabb t.tmp9bacdd3 t.tmpe4115c4 t.tmpeb01fff The same would happen if there was a fatal error between the