summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StreamingMemoryObject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Support: Remove MemoryObject and DataStreamer interfaces.Peter Collingbourne2016-11-021-138/+0
| | | | | | | | These interfaces are no longer used. Differential Revision: https://reviews.llvm.org/D26222 llvm-svn: 285774
* Support: Implement StreamingMemoryObject::getPointerDuncan P. N. Exon Smith2016-03-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation is fairly obvious. This is preparation for using some blobs in bitcode. For clarity (and perhaps future-proofing?), I moved the call to JumpToBit in BitstreamCursor::readRecord ahead of calling MemoryObject::getPointer, since JumpToBit can theoretically (a) read bytes, which (b) invalidates the blob pointer. This isn't strictly necessary the two memory objects we have: - The return of RawMemoryObject::getPointer is valid until the memory object is destroyed. - StreamingMemoryObject::getPointer is valid until the next chunk is read from the stream. Since the JumpToBit call is only going ahead to a word boundary, we'll never load another chunk. However, reordering makes it clear by inspection that the blob returned by BitstreamCursor::readRecord will be valid. I added some tests for StreamingMemoryObject::getPointer and BitstreamCursor::readRecord. llvm-svn: 264549
* Revert "Bitcode: Collect all MDString records into a single blob"Duncan P. N. Exon Smith2016-03-251-6/+0
| | | | | | | This reverts commit r264409 since it failed to bootstrap: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/8302/ llvm-svn: 264410
* Bitcode: Collect all MDString records into a single blobDuncan P. N. Exon Smith2016-03-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Optimize output of MDStrings in bitcode. This emits them in big blocks (currently 1024) in a pair of records: - BULK_STRING_SIZES: the sizes of the strings in the block, and - BULK_STRING_DATA: a single blob, which is the concatenation of all the strings. Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this should (a) slightly reduce bitcode size, since there is less record overhead, and (b) greatly improve reading speed, since blobs are super cheap to deserialize. I needed to add support for blobs to streaming input to get the test suite passing. - StreamingMemoryObject::getPointer reads ahead and returns the address of the blob. - To avoid a possible reallocation of StreamingMemoryObject::Bytes, BitstreamCursor::readRecord needs to move the call to JumpToEnd forward so that getPointer is the last bitstream operation. llvm-svn: 264409
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Use std::unique_ptr to manage the DataStreamer in bitcode parsing.Rafael Espindola2015-06-161-4/+5
| | | | | | We were already deleting it, this just makes it explicit. llvm-svn: 239867
* Fix StreamingMemoryObject to respect known object size.Derek Schuff2015-05-211-5/+12
| | | | | | | | | | | | | The existing code for method StreamingMemoryObject.fetchToPos does not respect the corresonding call to setKnownObjectSize(). As a result, it allows the StreamingMemoryObject to read bytes past the object size. This patch provides a test case, and code to fix the problem. Patch by Karl Schimpf Differential Revision: http://reviews.llvm.org/D8931 llvm-svn: 237939
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-3/+0
| | | | | | NFC. llvm-svn: 232976
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Fixing -Wtype-limits warnings with the asserts (the expression would always ↵Aaron Ballman2014-11-131-3/+3
| | | | | | evaluate to true). Also fixing a -Wcast-qual warning, where the cast expression isn't required. llvm-svn: 221888
* Read 64 bits at a time in the bitcode reader.Rafael Espindola2014-11-131-4/+3
| | | | | | | The reading of 64 bit values could still be optimized, but at least this cuts down on the number of virtual calls to fetch more data. llvm-svn: 221865
* Use the return of readBytes to find out if we are at the end of the stream.Rafael Espindola2014-11-121-12/+0
| | | | | | | This allows the removal of isObjectEnd and opens the way for reading 64 bits at a time. llvm-svn: 221804
* Return the number of read bytes in MemoryObject::readBytes.Rafael Espindola2014-11-121-14/+30
| | | | | | | Returning more information will allow BitstreamReader to be simplified a bit and changed to read 64 bits at a time. llvm-svn: 221794
* Merge StreamableMemoryObject into MemoryObject.Rafael Espindola2014-11-121-0/+124
Every MemoryObject is a StreamableMemoryObject since the removal of StringRefMemoryObject, so just merge the two. I will clean up the MemoryObject interface in the upcoming commits. llvm-svn: 221766
OpenPOWER on IntegriCloud