[ThinLTO] Add code comment. NFC
[llvm-complete.git] / tools / dsymutil / MachOUtils.h
blob3dda747dc0f9f7c51a97bc8c86195cd02c72d16e
1 //===-- MachOUtils.h - Mach-o specific helpers for dsymutil --------------===//
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 #ifndef LLVM_TOOLS_DSYMUTIL_MACHOUTILS_H
9 #define LLVM_TOOLS_DSYMUTIL_MACHOUTILS_H
11 #include "SymbolMap.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/FileSystem.h"
16 #include <string>
18 namespace llvm {
19 class MCStreamer;
20 class raw_fd_ostream;
21 namespace dsymutil {
22 class DebugMap;
23 struct LinkOptions;
24 namespace MachOUtils {
26 struct ArchAndFile {
27 std::string Arch;
28 std::unique_ptr<llvm::sys::fs::TempFile> File;
30 llvm::Error createTempFile();
31 llvm::StringRef path() const;
33 ArchAndFile(StringRef Arch) : Arch(Arch) {}
34 ArchAndFile(ArchAndFile &&A) = default;
35 ArchAndFile &operator=(ArchAndFile &&A) = default;
36 ~ArchAndFile();
39 bool generateUniversalBinary(SmallVectorImpl<ArchAndFile> &ArchFiles,
40 StringRef OutputFileName, const LinkOptions &,
41 StringRef SDKPath);
43 bool generateDsymCompanion(const DebugMap &DM, SymbolMapTranslator &Translator,
44 MCStreamer &MS, raw_fd_ostream &OutFile);
46 std::string getArchName(StringRef Arch);
47 } // namespace MachOUtils
48 } // namespace dsymutil
49 } // namespace llvm
50 #endif // LLVM_TOOLS_DSYMUTIL_MACHOUTILS_H