summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/PCHContainerOperations.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-11-08 04:17:11 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-11-08 04:17:11 +0000
commitcf26f429e818a308251ca9a54b88394e98642ccd (patch)
treefd5cbe8be973a01704700986e2d59e1f2f1c5a3a /include/clang/Frontend/PCHContainerOperations.h
parent97054171ba329891fa63df9b61414b60076b3142 (diff)
Bitcode: Decouple block info block state from reader.
As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html Move block info block state to a new class, BitstreamBlockInfo. Clients may set the block info for a particular cursor with the BitstreamCursor::setBlockInfo() method. At this point BitstreamReader is not much more than a container for an ArrayRef<uint8_t>, so remove it and replace all uses with direct uses of memory buffers. Differential Revision: https://reviews.llvm.org/D26259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/PCHContainerOperations.h')
-rw-r--r--include/clang/Frontend/PCHContainerOperations.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/clang/Frontend/PCHContainerOperations.h b/include/clang/Frontend/PCHContainerOperations.h
index 0c1b28e9a5..d323fb3e8b 100644
--- a/include/clang/Frontend/PCHContainerOperations.h
+++ b/include/clang/Frontend/PCHContainerOperations.h
@@ -17,7 +17,6 @@
namespace llvm {
class raw_pwrite_stream;
-class BitstreamReader;
}
using llvm::StringRef;
@@ -63,10 +62,8 @@ public:
/// Equivalent to the format passed to -fmodule-format=
virtual StringRef getFormat() const = 0;
- /// Initialize an llvm::BitstreamReader with the serialized AST inside
- /// the PCH container Buffer.
- virtual void ExtractPCH(llvm::MemoryBufferRef Buffer,
- llvm::BitstreamReader &StreamFile) const = 0;
+ /// Returns the serialized AST inside the PCH container Buffer.
+ virtual StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const = 0;
};
/// Implements write operations for a raw pass-through PCH container.
@@ -87,9 +84,8 @@ class RawPCHContainerWriter : public PCHContainerWriter {
class RawPCHContainerReader : public PCHContainerReader {
StringRef getFormat() const override { return "raw"; }
- /// Initialize an llvm::BitstreamReader with Buffer.
- void ExtractPCH(llvm::MemoryBufferRef Buffer,
- llvm::BitstreamReader &StreamFile) const override;
+ /// Simply returns the buffer contained in Buffer.
+ StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const override;
};
/// A registry of PCHContainerWriter and -Reader objects for different formats.