1 //===- tools/dsymutil/dsymutil.h - dsymutil high-level functionality ------===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 /// This file contains the class declaration for the code that parses STABS
13 /// debug maps that are embedded in the binaries symbol tables.
15 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
17 #define LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/ErrorOr.h"
28 bool Verbose; ///< Verbosity
29 bool NoOutput; ///< Skip emitting output
30 bool NoODR; ///< Do not unique types according to ODR
31 std::string PrependPath; ///< -oso-prepend-path
33 LinkOptions() : Verbose(false), NoOutput(false) {}
36 /// \brief Extract the DebugMaps from the given file.
37 /// The file has to be a MachO object file. Multiple debug maps can be
38 /// returned when the file is universal (aka fat) binary.
39 llvm::ErrorOr<std::vector<std::unique_ptr<DebugMap>>>
40 parseDebugMap(StringRef InputFile, ArrayRef<std::string> Archs,
41 StringRef PrependPath, bool Verbose, bool InputIsYAML);
43 /// \brief Dump the symbol table
44 bool dumpStab(StringRef InputFile, ArrayRef<std::string> Archs,
45 StringRef PrependPath = "");
47 /// \brief Link the Dwarf debuginfo as directed by the passed DebugMap
48 /// \p DM into a DwarfFile named \p OutputFilename.
49 /// \returns false if the link failed.
50 bool linkDwarf(StringRef OutputFilename, const DebugMap &DM,
51 const LinkOptions &Options);
53 /// \brief Exit the dsymutil process, cleaning up every temporary
54 /// files that we created.
55 LLVM_ATTRIBUTE_NORETURN void exitDsymutil(int ExitStatus);
57 void warn(const Twine &Warning, const Twine &Context);
58 bool error(const Twine &Error, const Twine &Context);
61 #endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H