LLVM 22.0.0git
ThinLTOBitcodeWriter.h
Go to the documentation of this file.
1//===- ThinLTOBitcodeWriter.h - Bitcode writing pass for ThinLTO ----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This pass prepares a module containing type metadata for ThinLTO by splitting
10// it into regular and thin LTO parts if possible, and writing both parts to
11// a multi-module bitcode file. Modules that do not contain type metadata are
12// written unmodified as a single module.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_TRANSFORMS_IPO_THINLTOBITCODEWRITER_H
17#define LLVM_TRANSFORMS_IPO_THINLTOBITCODEWRITER_H
18
20#include <llvm/IR/PassManager.h>
21
22namespace llvm {
23class Module;
24class raw_ostream;
25
27 : public PassInfoMixin<ThinLTOBitcodeWriterPass> {
28 raw_ostream &OS;
29 raw_ostream *ThinLinkOS;
30 const bool ShouldPreserveUseListOrder;
31
32public:
33 // Writes bitcode to OS. Also write thin link file to ThinLinkOS, if
34 // it's not nullptr.
36 bool ShouldPreserveUseListOrder = false)
37 : OS(OS), ThinLinkOS(ThinLinkOS),
38 ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {}
39
41
42 static bool isRequired() { return true; }
43};
44
45} // namespace llvm
46
47#endif
#define LLVM_ABI
Definition Compiler.h:213
This header defines various interfaces for pass management in LLVM.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
ThinLTOBitcodeWriterPass(raw_ostream &OS, raw_ostream *ThinLinkOS, bool ShouldPreserveUseListOrder=false)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70