llvm/unittests/Support
Duncan P. N. Exon Smith fbf768a4d3 Support: Implement StreamingMemoryObject::getPointer
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-27 23:00:59 +00:00
..
AlignOfTest.cpp Fixed compilation issue. 2016-01-28 20:36:46 +00:00
AllocatorTest.cpp
ArrayRecyclerTest.cpp
BlockFrequencyTest.cpp Add - and -= operators to BlockFrequency using saturating arithmetic. 2015-10-12 18:34:00 +00:00
BranchProbabilityTest.cpp BranchProbabilityTest.cpp: Suppress warnings. [-Wsign-compare] 2015-12-18 00:18:18 +00:00
Casting.cpp
CMakeLists.txt Support: Move StreamingMemoryObject{,Test}.cpp, NFC 2016-03-27 22:55:19 +00:00
CommandLineTest.cpp StringRef-ify some Option APIs 2015-11-17 19:00:52 +00:00
CompressionTest.cpp
ConvertUTFTest.cpp More UTF string conversion wrappers 2016-03-11 15:59:32 +00:00
DataExtractorTest.cpp
DwarfTest.cpp
EndianStreamTest.cpp Add a test showing we can write a vector of floats. 2016-01-25 19:02:20 +00:00
EndianTest.cpp Fix another UBSan test error from r248897 and follow on fix r249689 2015-10-08 20:52:23 +00:00
ErrorOrTest.cpp Use std::forward to make ErrorOr<T> constructible from a value that has a user-defined conversion to T. No functionality change intended. 2016-02-09 04:47:58 +00:00
ErrorTest.cpp [Support] Switch to RAII helper for error-as-out-parameter idiom. 2016-03-25 23:54:32 +00:00
FileOutputBufferTest.cpp
formatted_raw_ostream_test.cpp
IteratorTest.cpp
LEB128Test.cpp
LineIteratorTest.cpp
LockFileManagerTest.cpp
ManagedStatic.cpp
MathExtrasTest.cpp MathExtrasTest.cpp: Use EXPECT_DOUBLE_EQ here, instead of EXPECT_FLOAT_EQ. 2016-03-14 23:11:28 +00:00
MD5Test.cpp
MemoryBufferTest.cpp Remove excess white space 2015-11-18 00:31:34 +00:00
MemoryTest.cpp
Path.cpp Fix a -Wsign-compare in Support Path unittests 2016-02-10 19:29:01 +00:00
ProcessTest.cpp
ProgramTest.cpp Silence -Wsign-conversion issue in ProgramTest.cpp 2016-02-03 21:41:12 +00:00
raw_ostream_test.cpp Silence some MSVC warnings about zero extending unsigned to void* 2016-02-10 19:11:15 +00:00
raw_pwrite_stream_test.cpp
RegexTest.cpp
ReplaceFileTest.cpp Fix rename() sometimes failing if another process uses openFileForRead() 2015-10-12 15:11:47 +00:00
ScaledNumberTest.cpp
SourceMgrTest.cpp
SpecialCaseListTest.cpp
StreamingMemoryObjectTest.cpp Support: Implement StreamingMemoryObject::getPointer 2016-03-27 23:00:59 +00:00
StringPool.cpp
SwapByteOrderTest.cpp
TargetParserTest.cpp unitests: add some ARM TargetParser tests 2016-03-06 04:50:55 +00:00
ThreadLocalTest.cpp
ThreadPool.cpp ThreadPool unittests: do not hold mutex when calling condition_variable:notify() 2015-12-19 22:56:24 +00:00
TimerTest.cpp Unbreak LLVM_ENABLE_THREADS=OFF builds. 2015-12-23 01:04:53 +00:00
TimeValueTest.cpp
TrailingObjectsTest.cpp Remove TrailingObjects::operator delete. It's still suffering from 2016-02-09 02:09:16 +00:00
TypeNameTest.cpp [Support] Add a fancy helper function to get a static name for a type. 2016-02-25 03:58:21 +00:00
UnicodeTest.cpp
YAMLIOTest.cpp
YAMLParserTest.cpp Add != to YAMLParser's basic_collection_iterator. 2016-01-06 05:17:12 +00:00