diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-03-27 23:00:59 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-03-27 23:00:59 +0000 |
commit | 456c9968e51cc015f803cca1063703fbbc6fe958 (patch) | |
tree | e3784174127e00deb1f71b70b3503e70047f2ff6 /llvm/test/Bitcode | |
parent | 6648a0817ef664d75374b303c1f4abb350576f31 (diff) | |
download | bcm5719-llvm-456c9968e51cc015f803cca1063703fbbc6fe958.tar.gz bcm5719-llvm-456c9968e51cc015f803cca1063703fbbc6fe958.zip |
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.
llvm-svn: 264549
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-fixme-streaming-blob.bc | bin | 371 -> 0 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/invalid.test | 5 |
2 files changed, 0 insertions, 5 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-fixme-streaming-blob.bc b/llvm/test/Bitcode/Inputs/invalid-fixme-streaming-blob.bc Binary files differdeleted file mode 100644 index 7e32f8b0774..00000000000 --- a/llvm/test/Bitcode/Inputs/invalid-fixme-streaming-blob.bc +++ /dev/null diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test index 3425adc8410..499320140d7 100644 --- a/llvm/test/Bitcode/invalid.test +++ b/llvm/test/Bitcode/invalid.test @@ -168,11 +168,6 @@ RUN: FileCheck --check-prefix=INVALID-ARGUMENT-TYPE %s INVALID-ARGUMENT-TYPE: Invalid function argument type -RUN: not llvm-dis -disable-output %p/Inputs/invalid-fixme-streaming-blob.bc 2>&1 | \ -RUN: FileCheck --check-prefix=STREAMING-BLOB %s - -STREAMING-BLOB: getPointer in streaming memory objects not allowed - RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-comdat-id.bc 2>&1 | \ RUN: FileCheck --check-prefix=INVALID-FCOMDAT-ID %s |