mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
c931ff72bd
This adds support for the lld-only `--thinlto-cache-policy` option, as well as implementations for ld64's `-cache_path_lto`, `-prune_interval_lto`, `-prune_after_lto`, and `-max_relative_cache_size_lto`. Test is adapted from lld/test/ELF/lto/cache.ll Differential Revision: https://reviews.llvm.org/D105922
46 lines
1004 B
C++
46 lines
1004 B
C++
//===- LTO.h ----------------------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLD_MACHO_LTO_H
|
|
#define LLD_MACHO_LTO_H
|
|
|
|
#include "llvm/ADT/SmallString.h"
|
|
#include "llvm/Support/MemoryBuffer.h"
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace llvm {
|
|
namespace lto {
|
|
class LTO;
|
|
} // namespace lto
|
|
} // namespace llvm
|
|
|
|
namespace lld {
|
|
namespace macho {
|
|
|
|
class BitcodeFile;
|
|
class ObjFile;
|
|
|
|
class BitcodeCompiler {
|
|
public:
|
|
BitcodeCompiler();
|
|
|
|
void add(BitcodeFile &f);
|
|
std::vector<ObjFile *> compile();
|
|
|
|
private:
|
|
std::unique_ptr<llvm::lto::LTO> ltoObj;
|
|
std::vector<llvm::SmallString<0>> buf;
|
|
std::vector<std::unique_ptr<llvm::MemoryBuffer>> files;
|
|
};
|
|
|
|
} // namespace macho
|
|
} // namespace lld
|
|
|
|
#endif
|