[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / tools / dsymutil / dsymutil.h
blobf88f57bb20a55145ec9d40ddfb2fcc8120605b1e
1 //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
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 //
9 /// \file
10 ///
11 /// This file contains the class declaration for the code that parses STABS
12 /// debug maps that are embedded in the binaries symbol tables.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
17 #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
19 #include "DebugMap.h"
20 #include "LinkUtils.h"
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/Support/Compiler.h"
24 #include "llvm/Support/ErrorOr.h"
25 #include <memory>
26 #include <string>
27 #include <vector>
29 namespace llvm {
30 namespace dsymutil {
32 class BinaryHolder;
34 /// Extract the DebugMaps from the given file.
35 /// The file has to be a MachO object file. Multiple debug maps can be
36 /// returned when the file is universal (aka fat) binary.
37 ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
38 parseDebugMap(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
39 StringRef InputFile, ArrayRef<std::string> Archs,
40 StringRef PrependPath, bool PaperTrailWarnings, bool Verbose,
41 bool InputIsYAML);
43 /// Dump the symbol table.
44 bool dumpStab(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
45 StringRef InputFile, ArrayRef<std::string> Archs,
46 StringRef PrependPath = "");
48 /// Link the Dwarf debug info as directed by the passed DebugMap \p DM into a
49 /// DwarfFile named \p OutputFilename. \returns false if the link failed.
50 bool linkDwarf(raw_fd_ostream &OutFile, BinaryHolder &BinHolder,
51 const DebugMap &DM, LinkOptions Options);
53 } // end namespace dsymutil
54 } // end namespace llvm
56 #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H