17#ifndef LLVM_CLANG_DRIVER_OFFLOADBUNDLER_H
18#define LLVM_CLANG_DRIVER_OFFLOADBUNDLER_H
20#include "llvm/Support/Compression.h"
21#include "llvm/Support/Error.h"
22#include "llvm/TargetParser/Triple.h"
23#include <llvm/Support/MemoryBuffer.h>
92 std::string
str()
const;
110 static inline const size_t MagicSize = 4;
111 static inline const size_t VersionFieldSize =
sizeof(uint16_t);
112 static inline const size_t MethodFieldSize =
sizeof(uint16_t);
113 static inline const size_t FileSizeFieldSize =
sizeof(uint32_t);
114 static inline const size_t UncompressedSizeFieldSize =
sizeof(uint32_t);
115 static inline const size_t HashFieldSize =
sizeof(uint64_t);
116 static inline const size_t V1HeaderSize =
117 MagicSize + VersionFieldSize + MethodFieldSize +
118 UncompressedSizeFieldSize + HashFieldSize;
119 static inline const size_t V2HeaderSize =
120 MagicSize + VersionFieldSize + FileSizeFieldSize + MethodFieldSize +
121 UncompressedSizeFieldSize + HashFieldSize;
122 static inline const llvm::StringRef MagicNumber =
"CCOB";
123 static inline const uint16_t Version = 2;
127 compress(llvm::compression::Params
P,
const llvm::MemoryBuffer &Input,
128 bool Verbose =
false);
130 decompress(
const llvm::MemoryBuffer &Input,
bool Verbose =
false);
llvm::MachO::Target Target
static llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > compress(llvm::compression::Params P, const llvm::MemoryBuffer &Input, bool Verbose=false)
static llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > decompress(const llvm::MemoryBuffer &Input, bool Verbose=false)
llvm::compression::Format CompressionFormat
std::vector< std::string > OutputFileNames
std::vector< std::string > TargetNames
std::vector< std::string > InputFileNames
bool PrintExternalCommands
llvm::Error BundleFiles()
Bundle the files. Return true if an error was found.
OffloadBundler(const OffloadBundlerConfig &BC)
llvm::Error UnbundleFiles()
llvm::Error UnbundleArchive()
UnbundleArchive takes an archive file (".a") as input containing bundled code object files,...
static llvm::Error ListBundleIDsInFile(llvm::StringRef InputFileName, const OffloadBundlerConfig &BundlerConfig)
const OffloadBundlerConfig & BundlerConfig
The JSON file list parser is used to communicate input to InstallAPI.
Obtain the offload kind, real machine triple, and an optional TargetID out of the target information ...
bool operator==(const OffloadTargetInfo &Target) const
bool isOffloadKindCompatible(const llvm::StringRef TargetOffloadKind) const
bool isTripleValid() const
llvm::StringRef OffloadKind
bool isOffloadKindValid() const
const OffloadBundlerConfig & BundlerConfig