Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: include/llvm/Bitcode/BitcodeStream.h

Issue 8393017: Bitcode streaming (Closed)
Patch Set: rebase against upstream LLVM Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/llvm/Bitcode/BitstreamReader.h » ('j') | include/llvm/Bitcode/BitstreamReader.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/BitcodeStream.h
diff --git a/include/llvm/Bitcode/BitcodeStream.h b/include/llvm/Bitcode/BitcodeStream.h
new file mode 100644
index 0000000000000000000000000000000000000000..44311a5d19836d0c3016c6edf0ec998fa523ff91
--- /dev/null
+++ b/include/llvm/Bitcode/BitcodeStream.h
@@ -0,0 +1,42 @@
+//===---- llvm/Bitcode/BitcodeStream.h - ----*- C++ -*-===//
nlewycky 2011/11/05 00:45:06 Missing explanation of the file, also make it exac
(google.com) Derek Schuff 2011/11/07 17:32:09 OK. I'm a little unclear on exactly what is suppos
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Support for streaming (lazy reading) of bitcode files on disk
nlewycky 2011/11/05 00:45:06 End with "."
(google.com) Derek Schuff 2011/11/07 17:59:35 Done.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef BITCODESTREAM_H_
nlewycky 2011/11/05 00:45:06 Please use LLVM_BITCODE_BITCODESTREAM_H for simila
(google.com) Derek Schuff 2011/11/07 17:59:35 Done.
+#define BITCODESTREAM_H_
+
+#include <stddef.h>
nlewycky 2011/11/05 00:45:06 What do you need this for?
(google.com) Derek Schuff 2011/11/07 17:59:35 Originally had it for size_t. no longer necessary
+#include <string>
+
+namespace llvm {
+class MemoryBuffer;
+
+class BitcodeStreamer {
+public:
+ /// Fetch bytes [start-end) from the bitcode stream, and write them to the
+ /// buffer pointed to by buf. Returns the number of bytes actually written.
+ // TODO(dschuff): what's the right way to get useful error info?
+ // string pointer out-arg? additional function to be called on short read?
+ virtual size_t GetBytes(unsigned char* buf, size_t len) = 0;
+ /// Returns true if the streamer owns its backing store (e.g. MemoryBuffer)
nlewycky 2011/11/05 00:45:06 Newline to separate from above decl
(google.com) Derek Schuff 2011/11/07 17:59:35 Done.
+ virtual ~BitcodeStreamer() {}
nlewycky 2011/11/05 00:45:06 Declare the virtual destructor here, but please it
(google.com) Derek Schuff 2011/11/07 17:59:35 Done.
+};
+
+BitcodeStreamer* getBitcodeFileStreamer(const std::string &Filename,
+ std::string *Err);
+
+BitcodeStreamer* getBitcodeMemoryStreamer(const char* Start, size_t Len);
+BitcodeStreamer* getBitcodeMemoryBufferStreamer(MemoryBuffer *Buf);
nlewycky 2011/11/05 00:45:06 "BitcodeStreamer* " vs. "MemoryBuffer *". Please b
(google.com) Derek Schuff 2011/11/07 17:59:35 OK. hopefully I got them all in this pass. On 2011
+}
+
+#endif // BITCODESTREAM_H_
« no previous file with comments | « no previous file | include/llvm/Bitcode/BitstreamReader.h » ('j') | include/llvm/Bitcode/BitstreamReader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698