llvm.org GIT mirror llvm / 85a1c21
Add missing file from r286566 Add the new BitcodeWriter.h header, which was missed in my r286566 commit, and should fix all the bot failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286569 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 3 years ago
1 changed file(s) with 53 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 //===-- llvm/Bitcode/BitcodeWriter.h - Bitcode writers ----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header defines interfaces to write LLVM bitcode files/streams.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_BITCODE_BITCODEWRITER_H
14 #define LLVM_BITCODE_BITCODEWRITER_H
15
16 #include "llvm/IR/ModuleSummaryIndex.h"
17 #include
18
19 namespace llvm {
20 class Module;
21 class raw_ostream;
22
23 /// \brief Write the specified module to the specified raw output stream.
24 ///
25 /// For streams where it matters, the given stream should be in "binary"
26 /// mode.
27 ///
28 /// If \c ShouldPreserveUseListOrder, encode the use-list order for each \a
29 /// Value in \c M. These will be reconstructed exactly when \a M is
30 /// deserialized.
31 ///
32 /// If \c Index is supplied, the bitcode will contain the summary index
33 /// (currently for use in ThinLTO optimization).
34 ///
35 /// \p GenerateHash enables hashing the Module and including the hash in the
36 /// bitcode (currently for use in ThinLTO incremental build).
37 void WriteBitcodeToFile(const Module *M, raw_ostream &Out,
38 bool ShouldPreserveUseListOrder = false,
39 const ModuleSummaryIndex *Index = nullptr,
40 bool GenerateHash = false);
41
42 /// Write the specified module summary index to the given raw output stream,
43 /// where it will be written in a new bitcode block. This is used when
44 /// writing the combined index file for ThinLTO. When writing a subset of the
45 /// index for a distributed backend, provide the \p ModuleToSummariesForIndex
46 /// map.
47 void WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
48 const std::map
49 *ModuleToSummariesForIndex = nullptr);
50 } // End llvm namespace
51
52 #endif