summaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode/BitcodeWriter.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-20 21:19:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-20 21:19:10 +0000
commitd99dafe2e4a385dd2a6c76da6d8258deb100657b (patch)
treeba60bf957558bd114f25dbff3d4996b5d7a61c82 /include/llvm/Bitcode/BitcodeWriter.h
parent71d5a2540a98c81f5bcaeb48805e0e2881f530ef (diff)
Notes
Diffstat (limited to 'include/llvm/Bitcode/BitcodeWriter.h')
-rw-r--r--include/llvm/Bitcode/BitcodeWriter.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Bitcode/BitcodeWriter.h b/include/llvm/Bitcode/BitcodeWriter.h
index 271cb2d81bbb..23b5ae87b278 100644
--- a/include/llvm/Bitcode/BitcodeWriter.h
+++ b/include/llvm/Bitcode/BitcodeWriter.h
@@ -15,6 +15,7 @@
#define LLVM_BITCODE_BITCODEWRITER_H
#include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/MC/StringTableBuilder.h"
#include <string>
namespace llvm {
@@ -26,12 +27,25 @@ namespace llvm {
SmallVectorImpl<char> &Buffer;
std::unique_ptr<BitstreamWriter> Stream;
+ StringTableBuilder StrtabBuilder{StringTableBuilder::RAW};
+ bool WroteStrtab = false;
+
+ void writeBlob(unsigned Block, unsigned Record, StringRef Blob);
+
public:
/// Create a BitcodeWriter that writes to Buffer.
BitcodeWriter(SmallVectorImpl<char> &Buffer);
~BitcodeWriter();
+ /// Write the bitcode file's string table. This must be called exactly once
+ /// after all modules have been written.
+ void writeStrtab();
+
+ /// Copy the string table for another module into this bitcode file. This
+ /// should be called after copying the module itself into the bitcode file.
+ void copyStrtab(StringRef Strtab);
+
/// Write the specified module to the buffer specified at construction time.
///
/// If \c ShouldPreserveUseListOrder, encode the use-list order for each \a