llvm-capstone/lld/MachO/LTO.h
Jez Ng 21f831134c [lld-macho] Add very basic support for LTO
Just enough to consume some bitcode files and link them. There's more
to be done around the symbol resolution API and the LTO config, but I don't yet
understand what all the various LTO settings do...

Reviewed By: #lld-macho, compnerd, smeenai, MaskRay

Differential Revision: https://reviews.llvm.org/D90663
2020-11-10 12:19:28 -08:00

44 lines
907 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 <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;
};
} // namespace macho
} // namespace lld
#endif