search for: getbufferend

Displaying 13 results from an estimated 13 matches for "getbufferend".

2009 Sep 25
0
[LLVMdev] MemoryBuffer
...type, fully optimized for all situations. Policy based trumps hand-rolled trumps generic in terms of speed for all situations. I write code like that all the time, would be quite simple, would you accept such code? Just from a quick thought the interface would change from using getBufferStart()/getBufferEnd()/getBufferSize() to something like getRange() which returns a random_access_range_type<no_policy>, which would probably have an equivalent use like (using a monotype font to line things up): typedef const char cchar; MemoryBuffer mb; MemoryBuffer::range_type<policy> rt(mb.getRange());...
2009 Sep 24
7
[LLVMdev] MemoryBuffer
...l reason why getMemBuffer has the requirement that the EndPtr needs to be dereferencable except for that assert, and I do not really see a reason for that assert right off the bat. Basically, is there a rational section somewhere for the design of MemoryBuffer? Although the public member function getBufferEnd has no comments, from the looks of it, I think it returns one past the end based on how getBufferSize is implemented. Out of curiosity, since const char* fulfills the concept of a randomIterator concept, would there be any aversion to add an stl style begin/end that returns the same things? I have...
2020 Aug 28
2
End-to-end -fembed-bitcode .llvmbc and .llvmcmd
...// it's followed by another bitcode file). size_t GetBitcodeSize(MemoryBufferRef Buffer) { const unsigned char *BufPtr = reinterpret_cast<const unsigned char *>(Buffer.getBufferStart()); const unsigned char *EndBufPtr = reinterpret_cast<const unsigned char *>(Buffer.getBufferEnd()); if (isBitcodeWrapper(BufPtr, EndBufPtr)) { const unsigned char *FixedBufPtr = BufPtr; if (SkipBitcodeWrapperHeader(FixedBufPtr, EndBufPtr, true)) report_fatal_error("Invalid bitcode wrapper"); return EndBufPtr - BufPtr; } if (!isRawBitcode(BufPtr, EndBufPtr))...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...c.edu         http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > I like it in general. The only comment I have is that it should match the MemoryBuffer interface where possible. static error_code getFile(...); const char *getBufferStart() const; const char *getBufferEnd() const; size_t getBufferSize() const; StringRef getBuffer() const; const char *getBufferIdentifier() const; - Michael Spencer
2012 May 08
3
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > I like it in general. The only comment I have is that it should match > the MemoryBuffer interface where possible. > > static error_code getFile(...); > > const char *getBufferStart() const; > const char *getBufferEnd() const; > size_t getBufferSize() const; > StringRef getBuffer() const; > const char *getBufferIdentifier() const; Except that MemoryBuffer is about reading which is "getting". OutputBuffer is about writing, so the "get" part seems wrong. That said, some of the m...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
.../listinfo/llvmdev >>> >> >> I like it in general. The only comment I have is that it should match >> the MemoryBuffer interface where possible. >> >> static error_code getFile(...); >> >> const char *getBufferStart() const; >> const char *getBufferEnd() const; >> size_t getBufferSize() const; >> StringRef getBuffer() const; >> const char *getBufferIdentifier() const; > > Except that MemoryBuffer is about reading which is "getting". OutputBuffer is about writing, so the "get" part seems wrong. That...
2012 May 18
0
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
...0); Arguments should start with an upper case letter. (same for all of these) > + /// Returns a pointer to the start of the buffer. > + uint8_t *getBufferStart() const { > + return bufferStart; > + } > + > + /// Returns a pointer to the end of the buffer. > + uint8_t *getBufferEnd() const { > + return bufferEnd; > + } > + > + /// Returns size of the buffer. > + size_t getBufferSize() const { > + return bufferEnd - bufferStart; > + } > + > + /// Returns path where file will show up if buffer is committed. > + StringRef getPath() const...
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:
2020 Aug 28
4
End-to-end -fembed-bitcode .llvmbc and .llvmcmd
...). >> size_t GetBitcodeSize(MemoryBufferRef Buffer) { >> const unsigned char *BufPtr = >> reinterpret_cast<const unsigned char *>(Buffer.getBufferStart()); >> const unsigned char *EndBufPtr = >> reinterpret_cast<const unsigned char *>(Buffer.getBufferEnd()); >> if (isBitcodeWrapper(BufPtr, EndBufPtr)) { >> const unsigned char *FixedBufPtr = BufPtr; >> if (SkipBitcodeWrapperHeader(FixedBufPtr, EndBufPtr, true)) >> report_fatal_error("Invalid bitcode wrapper"); >> return EndBufPtr - BufPtr;...
2013 Jan 15
0
[LLVMdev] Need some brief explanation about llvm::MemoryBuffer and llvm::SourceMgr
And for this kind of question I think I would better hold in. There would be more important issue worth on this list. For this reason I am sorry. Sincerely Journeyer 2013/1/15 Journeyer J. Joh <oosaprogrammer at gmail.com>: > Hi Justin Holewinski, > >>> As far as I know, there is not a good way to implement user prompts with the LLVM APIs. > > This info helps me a
2007 Dec 15
2
[LLVMdev] fix warning with newer g++ compilers
...empty()) return; - + char *Buffer = &Str[0], *EndBuffer = Buffer+Str.size(); char *BOut = Buffer; for (char *BIn = Buffer; BIn != EndBuffer; ) { @@ -168,9 +168,9 @@ int LLLexer::getNextChar() { // a random nul in the file. Disambiguate that here. if (CurPtr-1 != CurBuf->getBufferEnd()) return 0; // Just whitespace. - + // Otherwise, return end of file. - --CurPtr; // Another call to lex will return EOF again. + --CurPtr; // Another call to lex will return EOF again. return EOF; case '\n': case '\r': @@ -180,24 +180,24 @...
2012 May 07
4
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
For the reasons listed in my 03-May-2012 email, I am proposing a new llvm/Support class for using in writing binary files: /// OutputBuffer - This interface provides simple way to create an in-memory /// buffer which when done will be written to a file. During the lifetime of /// these objects, the content or existence of the specified file is undefined. /// That is, creating an OutputBuffer
2013 Jan 15
2
[LLVMdev] Need some brief explanation about llvm::MemoryBuffer and llvm::SourceMgr
Hi Justin Holewinski, >> As far as I know, there is not a good way to implement user prompts with the LLVM APIs. This info helps me a lot. I tried to do a thing that is not possible. Thank you very much. Sincerely Journeyer 2013/1/15 Justin Holewinski <justin.holewinski at gmail.com>: > Is this for user prompts, or just reading data from stdin? You can use >