view lld/MachO/LTO.h @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900 (2022-11-09)
parents 5f17cb93ff66
children 1f2b6ac9f198
line wrap: on
line source
//===- 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::lto {
class LTO;
} // namespace llvm::lto

namespace lld::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 lld::macho

#endif