aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/BinaryStreamRef.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-03 20:26:11 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-03 20:26:11 +0000
commit148779df305667b6942fee7e758fdf81a6498f38 (patch)
tree976d85fb9cb4bc8ed54348b045f742be90e10c57 /include/llvm/Support/BinaryStreamRef.h
parenta303c417bbdb53703c2c17398b08486bde78f1f6 (diff)
Diffstat (limited to 'include/llvm/Support/BinaryStreamRef.h')
-rw-r--r--include/llvm/Support/BinaryStreamRef.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/BinaryStreamRef.h b/include/llvm/Support/BinaryStreamRef.h
index 23ce02fd7ca4..465e724a6886 100644
--- a/include/llvm/Support/BinaryStreamRef.h
+++ b/include/llvm/Support/BinaryStreamRef.h
@@ -98,6 +98,9 @@ public:
BinaryStreamRef(BinaryStreamRef &S, uint32_t Offset,
uint32_t Length) = delete;
+ /// Check if a Stream is valid.
+ bool valid() const { return Stream != nullptr; }
+
/// Given an Offset into this StreamRef and a Size, return a reference to a
/// buffer owned by the stream.
///