221
|
1 //===- LTO.h ----------------------------------------------------*- C++ -*-===//
|
|
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 #ifndef LLD_MACHO_LTO_H
|
|
10 #define LLD_MACHO_LTO_H
|
|
11
|
252
|
12 #include "lld/Common/LLVM.h"
|
|
13 #include "llvm/ADT/DenseSet.h"
|
221
|
14 #include "llvm/ADT/SmallString.h"
|
223
|
15 #include "llvm/Support/MemoryBuffer.h"
|
252
|
16 #include "llvm/Support/raw_ostream.h"
|
221
|
17 #include <memory>
|
|
18 #include <vector>
|
|
19
|
236
|
20 namespace llvm::lto {
|
221
|
21 class LTO;
|
236
|
22 } // namespace llvm::lto
|
221
|
23
|
236
|
24 namespace lld::macho {
|
221
|
25
|
|
26 class BitcodeFile;
|
|
27 class ObjFile;
|
|
28
|
|
29 class BitcodeCompiler {
|
|
30 public:
|
|
31 BitcodeCompiler();
|
|
32
|
|
33 void add(BitcodeFile &f);
|
|
34 std::vector<ObjFile *> compile();
|
|
35
|
|
36 private:
|
|
37 std::unique_ptr<llvm::lto::LTO> ltoObj;
|
|
38 std::vector<llvm::SmallString<0>> buf;
|
223
|
39 std::vector<std::unique_ptr<llvm::MemoryBuffer>> files;
|
252
|
40 std::unique_ptr<llvm::raw_fd_ostream> indexFile;
|
|
41 llvm::DenseSet<StringRef> thinIndices;
|
|
42 bool hasFiles = false;
|
221
|
43 };
|
|
44
|
236
|
45 } // namespace lld::macho
|
221
|
46
|
|
47 #endif
|